Chat freely about anything...

User avatar
By ting
#88731 Hi,team
I encountered a problem, when I created a new task, the program would stop running.As shown below:
Code: Select allI (116) esp_image: segment 0: paddr=0x00010010 vaddr=0x40210010 size=0x5f8cc (391372) map
I (257) esp_image: segment 1: paddr=0x0006f8e4 vaddr=0x4026f8dc size=0x102f0 ( 66288) map
I (279) esp_image: segment 2: paddr=0x0007fbdc vaddr=0x3ffe8000 size=0x0149c (  5276) load
I (282) esp_image: segment 3: paddr=0x00081080 vaddr=0x40100000 size=0x00bd0 (  3024) load
I (287) esp_image: segment 4: paddr=0x00081c58 vaddr=0x40100bd0 size=0x058e0 ( 22752) load
I (303) boot: Loaded app from partition at offset 0x10000
I (330) system_api: Base MAC address is not set, read default base MAC address from EFUSE
I (337) system_api: Base MAC address is not set, read default base MAC address from EFUSE
phy_version: 1159.0, 85b471e, Apr 21 2020, 17:03:08, RTOS new
I (393) phy_init: phy ver: 1159_0
I (397) reset_reason: RTC reset 2 wakeup 0 store 0, reason is 2
I (403) gpio: GPIO[2]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (411) gpio: GPIO[5]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
E (419) DBS: Parameter memory format...

E (504) DBS: Parameter memory self-diagnosis pass.

E (509) DBS: Parameter memory load defaults...

E (513) DBS: Parameter memory self-diagnosis start...

E (565) DBS: Parameter memory self-diagnosis pass.

I (570) system_api: Base MAC address is not set, read default base MAC address from EFUSE
esp_read_mac(): ec:fa:bc:b3:89:87
This is ESP8266 chip with 1 CPU cores, WiFi, 2MB external flash
Application start...
Application driver init. finished.
I (609) WiFi_STA: wifi_init_sta finished.
I (613) WiFi_STA: Waiting for AP connection...
I (620) gpio: GPIO[0]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:3 


I tried to change "#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 768) " to "#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 1024*5) " , the problem already exists.

I don't know, is it the limit of the number of tasks created or the limit of the stack space?
Below is the task function I created. When I shield the last task, the program can run normally.
Code: Select all   xTaskCreate(Button_SmartConfigThread, "SmartConfig", 1024, NULL, 0, NULL);   // 按键配网线程
   xTaskCreate(Cfg_handleRxThread, "cfg", 512, NULL, 1, NULL);                // 参数配置线程
   xTaskCreate(Sys_doNetworkThread, "net", 1024*5, NULL, 10, NULL);           // 网络线程 
   xTaskCreate(Sys_HBServiceThread, "hb", 1024*5, NULL, 2, NULL);               // 心跳线程
   xTaskCreate(Sys_reportAppNotificationThread, "ant", 1024, NULL, 3, NULL);   // 监控线程
   xTaskCreate(Sys_reportAppParametersThread, "apt", 1024, NULL, 4, NULL);       // 应用线程
   xTaskCreate(Sys_reportAppFaultsThread, "aft", 1024*4, NULL, 5, NULL);           // 故障线程
   xTaskCreate(Sys_doDOTAThread,"dota", 1024, NULL, 6, NULL);                  // OTA线程
    xTaskCreate(Sys_syncServerTimeThread,"tsync", 1024*5, NULL, 7, NULL);       // 时间线程
    xTaskCreate(Sys_reportSelfDiagnonsisFalultThread,"sdfr", 1024*2, NULL, 8, NULL);       // 故障上报线程
    xTaskCreate(Sys_runNetworkThread,"EDGRX", 1024*5, NULL, 9, NULL);                     // 数据接收线程
 //xTaskCreate(Ned_writeThread,"cmbtx", 1024, NULL, 0, NULL);                          // 总线线程
Attachments
微信截图_20200910092811.png
User avatar
By eriksl
#88745 This may be related to an issue I have with the NONOS_SDK.

In the latest changes of the SDK Espressif changed the location of the stack during startup. It is now located completely below the well-known stack space area. This is also the case in the init and init2 functions. Only when your code is called from a timer or event, the stack area is at the usual location again.

I object against this, because it makes it impossible to stack painting and therefore I can't know how much stack space is left.

I filed a complaint at github. No reaction of course. But maybe if many people complain, something will happen.