Closed imliubo closed 2 years ago
@imliubo I have looked into it, but so far I still don't know the cause.
MicroPython v1.18-1-g1760a2a on 2022-03-01; M5STACK C3 with ESP32C3
Type "help()" for more information.
>>>
***ERROR*** A stack overflow in task IDLE has been detected.
From this part of the log, it seems that a stack overflow is occurring in the IDLE task after the initialization process is completed, but we need to find out how far the process has progressed in the program. Is there a log when MODULE_M5UNIFIED_ENABLED is disabled?
@lovyan03
Here is the log when set MODULE_M5UNIFIED_ENABLED to 0.
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0xe3c
load:0x403ce000,len:0x6f4
load:0x403d0000,len:0x28ec
entry 0x403ce000
I (258) cpu_start: Pro cpu up.
D (258) efuse: In EFUSE_BLK2__DATA4_REG is used 3 bits starting with 0 bit
D (258) efuse: In EFUSE_BLK2__DATA4_REG is used 8 bits starting with 12 bit
D (265) efuse: In EFUSE_BLK1__DATA3_REG is used 3 bits starting with 18 bit
D (272) efuse: In EFUSE_BLK1__DATA5_REG is used 5 bits starting with 5 bit
D (279) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 7 bit
D (285) efuse: In EFUSE_BLK1__DATA4_REG is used 7 bits starting with 14 bit
D (293) efuse: In EFUSE_BLK1__DATA4_REG is used 8 bits starting with 21 bit
D (300) efuse: In EFUSE_BLK1__DATA4_REG is used 3 bits starting with 29 bit
D (307) efuse: In EFUSE_BLK1__DATA5_REG is used 5 bits starting with 0 bit
D (321) clk: RTC_SLOW_CLK calibration value: 3853350
I (330) cpu_start: Pro cpu start user code
I (330) cpu_start: cpu freq: 160000000
I (330) cpu_start: Application information:
I (333) cpu_start: Compile time: Mar 1 2022 15:08:26
I (339) cpu_start: ELF file SHA256: 7c7ed13651295993...
I (345) cpu_start: ESP-IDF: v4.4-beta1-286-g014ee65f1f
D (351) memory_layout: Checking 4 reserved memory ranges:
D (357) memory_layout: Reserved memory range 0x3fc80000 - 0x3fc92e00
D (363) memory_layout: Reserved memory range 0x3fc92e00 - 0x3fc9d720
D (370) memory_layout: Reserved memory range 0x3fcdf060 - 0x3fce0000
D (376) memory_layout: Reserved memory range 0x50000000 - 0x50000830
D (383) memory_layout: Building list of available memory regions:
D (389) memory_layout: Available memory region 0x3fc9d720 - 0x3fca0000
D (395) memory_layout: Available memory region 0x3fca0000 - 0x3fcc0000
D (402) memory_layout: Available memory region 0x3fcc0000 - 0x3fcdf060
D (408) memory_layout: Available memory region 0x50000830 - 0x50002000
I (415) heap_init: Initializing. RAM available for dynamic allocation:
D (422) heap_init: New heap initialised at 0x3fc9d720
I (427) heap_init: At 3FC9D720 len 000228E0 (138 KiB): D/IRAM
I (434) heap_init: At 3FCC0000 len 0001F060 (124 KiB): STACK/DRAM
D (441) heap_init: New heap initialised at 0x50000830
I (446) heap_init: At 50000830 len 000017D0 (5 KiB): RTCRAM
D (452) FLASH_HAL: extra_dummy: 0
D (456) spi_flash: trying chip: issi
D (459) spi_flash: trying chip: gd
D (463) spi_flash: trying chip: mxic
D (466) spi_flash: trying chip: winbond
D (470) spi_flash: trying chip: boya
D (474) spi_flash: trying chip: generic
I (478) spi_flash: detected chip: generic
I (482) spi_flash: flash io: dio
D (486) cpu_start: calling init function: 0x4210022e
0x4210022e: _GLOBAL__sub_I___cxa_get_globals_fast at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/gcc/libstdc++-v3/libsupc++/eh_globals.cc:145
D (491) cpu_start: calling init function: 0x420ffbac
0x420ffbac: _GLOBAL__sub_I__ZN10__cxxabiv111__terminateEPFvvE at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/build/build-cc-gcc-final/riscv32-esp-elf/rv32imc/ilp32/libstdc++-v3/include/riscv32-esp-elf/bits/gthr-default.h:745
(inlined by) __gnu_cxx::__mutex::__mutex() at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/build/build-cc-gcc-final/riscv32-esp-elf/rv32imc/ilp32/libstdc++-v3/include/ext/concurrence.h:135
(inlined by) __static_initialization_and_destruction_0 at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:36
(inlined by) _GLOBAL__sub_I__ZN10__cxxabiv111__terminateEPFvvE at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:125
D (496) cpu_start: calling init function: 0x420ffaac
0x420ffaac: _GLOBAL__sub_I__ZN9__gnu_cxx9__freeresEv at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/gcc/libstdc++-v3/libsupc++/eh_alloc.cc:348
D (501) cpu_start: calling init function: 0x420ff90c
0x420ff90c: _GLOBAL__sub_I__ZSt7nothrow at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/build/build-cc-gcc-final/riscv32-esp-elf/rv32imc/ilp32/libstdc++-v3/include/riscv32-esp-elf/bits/gthr-default.h:745
(inlined by) __gnu_cxx::__mutex::__mutex() at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/build/build-cc-gcc-final/riscv32-esp-elf/rv32imc/ilp32/libstdc++-v3/include/ext/concurrence.h:135
(inlined by) __static_initialization_and_destruction_0 at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/gcc/libstdc++-v3/libsupc++/new_handler.cc:33
(inlined by) _GLOBAL__sub_I__ZSt7nothrow at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/gcc/libstdc++-v3/libsupc++/new_handler.cc:71
D (506) cpu_start: calling init function: 0x42087870
0x42087870: esp_reset_reason_get_hint at /home/imliubo/CodingBug/espressif/esp-idf-uiflow-v4.4/components/esp_system/port/soc/esp32c3/reset_reason.c:107
(inlined by) esp_reset_reason_init at /home/imliubo/CodingBug/espressif/esp-idf-uiflow-v4.4/components/esp_system/port/soc/esp32c3/reset_reason.c:68
D (511) cpu_start: calling init function: 0x420807fc
0x420807fc: adc2_init_code_calibration at /home/imliubo/CodingBug/espressif/esp-idf-uiflow-v4.4/components/driver/esp32c3/adc2_init_cal.c:24
D (516) efuse: In EFUSE_BLK2__DATA4_REG is used 3 bits starting with 0 bit
D (523) efuse: In EFUSE_BLK2__DATA5_REG is used 10 bits starting with 18 bit
D (530) cpu_start: calling init function: 0x42049782
0x42049782: cpp::bitwizeshift::detail::result_union<lgfx::v1::i2c::i2c_context_t::state_t, lgfx::v1::error_t, true>::result_union<>(cpp::bitwizeshift::in_place_t) at /home/imliubo/CodingBug/m5stack/uiflow_micropython/m5stack/build-M5STACK_C3/../libs/m5unified/M5GFX/src/lgfx/v1/platforms/esp32/../esp32/../../../utility/result.hpp:3837
(inlined by) cpp::bitwizeshift::detail::result_construct_base<lgfx::v1::i2c::i2c_context_t::state_t, lgfx::v1::error_t>::result_construct_base<>(cpp::bitwizeshift::in_place_t) at /home/imliubo/CodingBug/m5stack/uiflow_micropython/m5stack/build-M5STACK_C3/../libs/m5unified/M5GFX/src/lgfx/v1/platforms/esp32/../esp32/../../../utility/result.hpp:3954
(inlined by) cpp::bitwizeshift::result<lgfx::v1::i2c::i2c_context_t::state_t, lgfx::v1::error_t>::result<lgfx::v1::i2c::i2c_context_t::state_t, void>() at /home/imliubo/CodingBug/m5stack/uiflow_micropython/m5stack/build-M5STACK_C3/../libs/m5unified/M5GFX/src/lgfx/v1/platforms/esp32/../esp32/../../../utility/result.hpp:4292
(inlined by) lgfx::v1::i2c::i2c_context_t::i2c_context_t() at /home/imliubo/CodingBug/m5stack/uiflow_micropython/m5stack/build-M5STACK_C3/../libs/m5unified/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp:487
(inlined by) __static_initialization_and_destruction_0 at /home/imliubo/CodingBug/m5stack/uiflow_micropython/m5stack/build-M5STACK_C3/../libs/m5unified/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp:560
(inlined by) _GLOBAL__sub_I__ZN4lgfx2v115getApbFrequencyEv at /home/imliubo/CodingBug/m5stack/uiflow_micropython/m5stack/build-M5STACK_C3/../libs/m5unified/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp:1090
D (535) cpu_start: calling init function: 0x42027a96
0x42027a96: _GLOBAL__sub_I_M5 at /home/imliubo/CodingBug/m5stack/uiflow_micropython/m5stack/build-M5STACK_C3/../libs/m5unified/M5Unified/src/M5Unified.cpp:669
D (541) cpu_start: calling init function: 0x42003fbc
0x42003fbc: s_set_default_wifi_log_level at /home/imliubo/CodingBug/espressif/esp-idf-uiflow-v4.4/components/esp_wifi/src/wifi_init.c:70
D (546) cpu_start: calling init function: 0x4200002a
0x4200002a: esp_ota_get_app_elf_sha256 at /home/imliubo/CodingBug/espressif/esp-idf-uiflow-v4.4/components/app_update/esp_app_desc.c:82
(inlined by) esp_ota_init_app_elf_sha256 at /home/imliubo/CodingBug/espressif/esp-idf-uiflow-v4.4/components/app_update/esp_app_desc.c:69
D (551) intr_alloc: Connected src 39 to int 2 (cpu 0)
I (556) sleep: Configure to isolate all GPIO pins in sleep state
I (563) sleep: Enable automatic switching of GPIO sleep configuration
I (581) coexist: coexist rom version 9387209
D (581) intr_alloc: Connected src 50 to int 3 (cpu 0)
I (581) cpu_start: Starting scheduler.
D (585) intr_alloc: Connected src 37 to int 4 (cpu 0)
D (585) heap_init: New heap initialised at 0x3fcc0000
D (585) intr_alloc: Connected src 33 to int 7 (cpu 0)
D (595) partition: Loading the partition table
D (595) partition: Partition table MD5 verified
D (605) intr_alloc: Connected src 21 to int 9 (cpu 0)
D (605) intr_alloc: Connected src 16 to int 10 (cpu 0)
MicroPython v1.18-1-g1760a2a-dirty on 2022-03-01; M5STACK C3 with ESP32C3
Type "help()" for more information.
>>>
By the way, i add riscv port to libffi, libffi riscv src libffi riscv include
It took from here: libffi
Generate riscv header files commands:
./autogen.sh
./configure -host=riscv
If it boots successfully, does _boot.py run and output the uiflow logo text?
Yes, uiflow log text it will print, need change this line:
set(MICROPY_FROZEN_MANIFEST ${CMAKE_SOURCE_DIR}/boards/manifest.py)
log:
D (614) intr_alloc: Connected src 21 to int 9 (cpu 0)
D (614) intr_alloc: Connected src 16 to int 10 (cpu 0)
_ __ _
_ _(_)/ _| | _____ __
| | | | | |_| |/ _ \ \ /\ / /
| |_| | | _| | (_) \ V V /
\__,_|_|_| |_|\___/ \_/\_/
MicroPython v1.18-1-g1760a2a-dirty on 2022-03-01; M5STACK C3 with ESP32C3
Type "help()" for more information.
>>>
***ERROR*** A stack overflow in task IDLE has been detected.
According to menuconfig, the initial value of the stack size for IDLE tasks was 1536 bytes. I found that setting this to 2048 prevented the error.
Probably the global instance of M5Unified uses the stack of the IDLE task.
You are right.
It seems esp32c3 is different with esp32.Use default size it works well with esp32.I think it should be because the architecture is different, and the low level implementation is different.
Hi @lovyan03 ,
At this commit 1760a2a with esp32c3 support.
If enable this MODULE_M5UNIFIED_ENABLED will cause the below error, what do you think?