|
| 1 | +System Tasks |
| 2 | +************ |
| 3 | + |
| 4 | +This document explains the ESP8266 RTOS SDK internal system tasks. |
| 5 | + |
| 6 | +Overview |
| 7 | +======== |
| 8 | + |
| 9 | +The main tasks and their attributes are as following: |
| 10 | + |
| 11 | ++-------------------------+----------------+----------------+ |
| 12 | +| Names | stack size | Priority | |
| 13 | ++=========================+================+================+ |
| 14 | +| uiT | 3584(C) | 14 | |
| 15 | ++-------------------------+----------------+----------------+ |
| 16 | +| IDLE | 768 | 0 | |
| 17 | ++-------------------------+----------------+----------------+ |
| 18 | +| Tmr | 2048(C) | 2 | |
| 19 | ++-------------------------+----------------+----------------+ |
| 20 | +| ppT | 2048(C) | 13 | |
| 21 | ++-------------------------+----------------+----------------+ |
| 22 | +| pmT | 1024 | 11 | |
| 23 | ++-------------------------+----------------+----------------+ |
| 24 | +| rtT | 2048 | 12 | |
| 25 | ++-------------------------+----------------+----------------+ |
| 26 | +| tiT | 2048(C) | 8 | |
| 27 | ++-------------------------+----------------+----------------+ |
| 28 | +| esp_event_loop_task | 2048(C) | 10 | |
| 29 | ++-------------------------+----------------+----------------+ |
| 30 | + |
| 31 | +Note: (C) means it is configurable by "menuconfig". |
| 32 | + |
| 33 | +Tasks Introduction |
| 34 | +================== |
| 35 | + |
| 36 | +uiT |
| 37 | +--- |
| 38 | + |
| 39 | +This task initializes the system, including peripherals, file system, user entry function and so on. |
| 40 | +This task will delete itself and free the resources after calling `app_main`. |
| 41 | + |
| 42 | +IDLE |
| 43 | +---- |
| 44 | + |
| 45 | +This task is freeRTOS internal idle callback task, it is created when starting the freeRTOS. |
| 46 | +Its hook function is `vApplicationIdleHook`. |
| 47 | +The system's function of `sleep` and function of feeding `task watch dog` are called in the `vApplicationIdleHook`. |
| 48 | + |
| 49 | +Tmr |
| 50 | +--- |
| 51 | + |
| 52 | +This task is the processor of freeRTOS internal software timer. |
| 53 | + |
| 54 | +ppT |
| 55 | +--- |
| 56 | + |
| 57 | +This task is to process Wi-Fi hardware driver and stack. It posts messages from the logic link layer to the upper layer TCP/IP stack after transforming them into ethernet packets. |
| 58 | + |
| 59 | +pmT |
| 60 | +--- |
| 61 | + |
| 62 | +The task is for system power management. It will check if the system can sleep right now, and if it is, it will start preparing for system sleep. |
| 63 | + |
| 64 | +rtT |
| 65 | +--- |
| 66 | + |
| 67 | +The task is the processor of high priority hardware timer. It mainly process Wi-Fi real time events. |
| 68 | +It is suggested that functions based on this component should not be called in application, because it may block other low layer Wi-Fi functions. |
| 69 | + |
| 70 | +tiT |
| 71 | +--- |
| 72 | + |
| 73 | +The task is the main task of TCP-IP stack(LwIP) , it is to deal with TCP-IP packets. |
| 74 | + |
| 75 | +esp_event_loop_task |
| 76 | +------------------- |
| 77 | + |
| 78 | +The task processes system events, for example, Wi-Fi and TCP-IP stack events. |
| 79 | + |
| 80 | +Suggestions |
| 81 | +=========== |
| 82 | + |
| 83 | +In general, the priority of user task should NOT be higher than the system real timer task's priority (12). So it is suggested that keep your user tasks' priorities less than 12. |
| 84 | +If you want to speed up the TCP/UDP throughput, you can try to set the priority of send/receive task to be higher than the "rtT" task's priority (8). |
0 commit comments