15 Commits

Author SHA1 Message Date
5b83e820d2 fix(ESPCS-924): Fixed a potential freertos crash
- Reason:
A task and B interrupt indirectly access the shared resource pxDelayedTaskList without proper security protection, leading to further crash.
A task uses xEventGroupSetBits() to access the pxDelayedTaskList resource:
xEventGroupSetBits() -> vTaskRemoveFromUnorderedEventList() -> uxListRemove() -> pxList, where pxList is the pxDelayedTaskList.
At this point, another B interrupt is triggered (xEventGroupSetBits only suspends task scheduling and does not disable interrupts) and also accesses the pxDelayedTaskList resource:
MacIsrSigPostDefHdl() -> __wifi_queue_send_from_isr() -> xQueueGenericSendFromISR() -> xTaskRemoveFromEventList() -> prvResetNextTaskUnblockTime() -> pxDelayedTaskList.
This leads to an unsafe access to the pxDelayedTaskList resource by two entities, causing subsequent crash exceptions.

- Fix:
Modify the timing of the call to prvResetNextTaskUnblockTime() within xTaskRemoveFromEventList from unconditional execution to only execute when task scheduling is enabled.
This way, when the B interrupt reaches xTaskRemoveFromEventList, it will not call prvResetNextTaskUnblockTime to access the pxDelayedTaskList resource (due to task scheduling being disabled).
After the B interrupt execution is complete and control returns to A task, xTaskResumeAll() will be called, and then prvResetNextTaskUnblockTime() will update the pxDelayedTaskList resource again.
2023-11-06 14:02:44 +08:00
5f61afc090 feat(freertos): add feature to modify task stack deepth dynamically 2020-07-17 16:58:47 +08:00
99de07db83 feat(freertos): add thread local private "errno" 2020-03-13 10:24:54 +08:00
1e69cbd242 feat(gdbstub): modify GDB stub for ESP8266 2019-12-19 11:33:38 +08:00
b061230056 feat(esp8266): refactor CCOMPARE timer and system time by microseconds
old: CCOMPARE timer triggers when CCOUNT increase to equal to CCOMPARE, then ISR will increase integer of "_xt_tick_divisor"
     to CCOMPARE and wait for next interrupt triggering

now: CCOMPARE timer triggers when CCOUNT increase to equal to CCOMPARE, then ISR will reset CCOUNT to be 0 and reset CCOMPARE
     to be integer of "_xt_tick_divisor", then wait for next interrupt triggering

Using the new method, we may get the CCOUNT value without considing if it has overflowed.
System running microseconds = g_os_ticks * microseconds per tick + CCOUNT.
2019-08-19 14:03:20 +08:00
b3658b4eb1 feat(freertos): Add option for idle task stack size
Modify min size from 768 to 1024 bytes.
2019-04-17 10:13:38 +08:00
b6ea4eab21 feat(freertos): Cleanup tick/idle hook functionality
Closes https://github.com/espressif/ESP8266_RTOS_SDK/issues/500
2019-03-07 11:42:50 +08:00
723faf08d9 feat(freertos): Add option to FreeRTOS sleep module 2019-02-28 15:51:05 +08:00
6fd342dd0f feat(freertos): Add configuration to speed up task switch
The global heap is 74332 bytes when connect to AP and get IP by DHCP.
2018-11-29 09:47:33 +08:00
bc239c0ed3 feat(esp8266): Link some functions from IRAM to flash 2018-09-17 13:50:34 +08:00
94fc5d6276 feat(freertos): Add FreeRTOS private data API 2018-05-14 16:55:15 +08:00
0e8280e1dc feat(freertos): Put freertos in flash by default 2018-04-27 21:56:36 +08:00
8418cb26d2 feat(freertos): Make components compiling OK 2018-04-27 20:54:32 +08:00
e10c902c3e feat(freertos): Update FreeRTOS version to TAG 1.2.3
URL: https://github.com/aws/amazon-freertos
2018-04-27 20:54:32 +08:00
48f338bf35 feat(freertos): Change FreeRTOS directory structure to prepare updating it 2018-04-27 19:54:53 +08:00