Project

General

Profile

ESP32 reboots infinitely, but compilation of Waijung2 in Simulink succuessfully without errors

Added by Leonard GUO about 1 year ago

Hello,

I met a problem that I build my esp32 file successfully in MATLAB/Simulink R2020b with Waijung2.
But after I open PuTTY, I found the system reboot again and again.

Log information in PuTTY for ESP32 are as follows, and the compilation information is in the attached file. It is possible that because of the program is too large?

Best regards,
Léonard
_________________________
ELF file SHA256: 342486aa78edd8f5

Rebooting...
ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6632
load:0x40078000,len:14780
ho 0 tail 12 room 4
load:0x40080400,len:3792
entry 0x40080694
I (29) boot: ESP-IDF v4.4-beta1-177-ge104dd7f27-dirt 2nd stage bootloader
I (29) boot: compile time 13:40:07
I (30) boot: chip revision: 3
I (34) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (41) boot.esp32: SPI Speed : 40MHz
I (46) boot.esp32: SPI Mode : DIO
I (50) boot.esp32: SPI Flash Size : 4MB
I (55) boot: Enabling RNG early entropy source...
I (60) boot: Partition Table:
I (64) boot: ## Label Usage Type ST Offset Length
I (71) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (79) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (86) boot: 2 factory factory app 00 00 00010000 00100000
I (94) boot: End of partition table
I (98) boot_comm: chip revision: 3, min. application chip revision: 0
I (105) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=08d84h ( 36228) map
I (127) esp_image: segment 1: paddr=00018dac vaddr=3ffb0000 size=0236ch ( 9068) load
I (130) esp_image: segment 2: paddr=0001b120 vaddr=40080000 size=04ef8h ( 20216) load
I (141) esp_image: segment 3: paddr=00020020 vaddr=400d0020 size=1756ch ( 95596) map
I (176) esp_image: segment 4: paddr=00037594 vaddr=40084ef8 size=062bch ( 25276) load
I (186) esp_image: segment 5: paddr=0003d858 vaddr=50000000 size=00010h ( 16) load
I (192) boot: Loaded app from partition at offset 0x10000
I (192) boot: Disabling RNG early entropy source...
I (207) cpu_start: Pro cpu up.
I (207) cpu_start: Starting app cpu, entry point is 0x40080fec
I (0) cpu_start: App cpu up.
I (221) cpu_start: Pro cpu start user code
I (221) cpu_start: cpu freq: 160000000
I (221) cpu_start: Application information:
I (225) cpu_start: Project name: waijung2_esp32
I (231) cpu_start: App version: 1
I (235) cpu_start: Compile time: Jan 24 2023 13:39:50
I (242) cpu_start: ELF file SHA256: 342486aa78edd8f5...
I (248) cpu_start: ESP-IDF: v4.4-beta1-177-ge104dd7f27-dirt
I (255) heap_init: Initializing. RAM available for dynamic allocation:
I (262) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (268) heap_init: At 3FFB2DD0 len 0002D230 (180 KiB): DRAM
I (274) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (280) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (287) heap_init: At 4008B1B4 len 00014E4C (83 KiB): IRAM
I (294) spi_flash: detected chip: generic
I (298) spi_flash: flash io: dio
I (303) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
ADC1 val = 0; ADC2 val = 0; ADC3 val = 0; ADC4 val = 0

ERROR A stack overflow in task tBaseRate has been detected.

Backtrace:0x40081826:0x3ffb71f00x40085051:0x3ffb7210 0x40087ca6:0x3ffb7230 0x400869ba:0x3ffb72b0 0x40085150:0x3ffb72d0 0x40085102:0x3ffb7510 0x3ffb7511:0xa5a5a5a5 |<-CORRUPTED

ELF file SHA256: 342486aa78edd8f5

Rebooting...
________________________________


Replies (4)

RE: ESP32 reboots infinitely, but compilation of Waijung2 in Simulink succuessfully without errors - Added by Parth Maheshwari (พาร์ท) about 1 year ago

Hi Leonard,

Is it possible to also attach your model file? That would help us test on our end.

Sincere regards,
Parth

RE: ESP32 reboots infinitely, but compilation of Waijung2 in Simulink succuessfully without errors - Added by Leonard GUO about 1 year ago

Hi Parth,
Can I send you the model file by e-mail? This file is related to my project, so it is not convenient to be public.
Thank you!
Best regards,
Léonard

RE: ESP32 reboots infinitely, but compilation of Waijung2 in Simulink succuessfully without errors - Added by Parth Maheshwari (พาร์ท) about 1 year ago

Certainly! Please send it to

Sincere regards,
Parth

RE: ESP32 reboots infinitely, but compilation of Waijung2 in Simulink succuessfully without errors - Added by Parth Maheshwari (พาร์ท) about 1 year ago

Hi Leonard,

I was waiting to receive your file to try the model out myself before letting you know whether the solution solves the problem or not.

You can try it out too.

The problem is actually insufficient stack depth as has been stated in the log

Please go to your Waijung 2 Target Setup and increase your stack depth size. The default is 2048 but that can be insufficient for more complex models. You may try 4096, 8192, 10240 and so on if needed.

Hope that helps.

Sincere regards,
Parth

    (1-4/4)