fdcavalcanti opened a new pull request, #16291: URL: https://github.com/apache/nuttx/pull/16291
This change affects esp32s2-saola-1 board when optimizations are enabled. Fixes issue on timer defconfig. ## Summary The timer defconfig has been failing when running with the timer application after `ls` command, if full optimization is enabled. This issue has been tracked to a missing flag: `fno-omit-frame-pointer`. ## Impact Impact on user: No. Impact on build: No. Impact on hardware: Only the esp32s2-saola-1 board. Impact on documentation: No. Impact on security: No. Impact on compatibility: No. ## Testing ### Building - `./tools/configure.sh esp32s2-saola-1:timer` - Enable `CONFIG_DEBUG_FEATURES` and `CONFIG_ESP32S2_MERGE_BINS` - make and flash ### Running Call the timer test on `/dev/timer0` after `ls /dev/` a couple of times. This test is normally automated with Pytest, so it seems there is a timing issue that causes this crash. ### Results Before the fix we had a crash scenario: ``` nsh> ls /dev /dev: console null timer0 timer1 timer2 timer3 ttyS0 zero nsh> nsh> ls /dev /dev: console null timer0 timer1 timer2 timer3 ttyS0 zero nsh> nsh> timer -d /dev/timer0 Open /dev/timer0 flags: 00000000 timeout: 0 timeleft: 0 nsignals: 0 Set timer interval to 1000000 flags: 00000000 timeout: 1000000 timeleft: 1000000 nsignals: 0 Attach timer handler flags: 00000002 timeout: 1000000 timeleft: 1000000 nsignals: 0 Start the timer xtensa_user_panic: User Exception: EXCCAUSE=0000 task: timer dump_assert_info: Current Version: NuttX 10.4.0 faed5f6107-dirty Apr 29 2025 15:02:11 xtensa dump_assert_info: Assertion failed user panic: at file: common/xtensa_assert.c:190 task: timer process: timer 0x400a4080 up_dump_register: PC: 4009b988 PS: 00060a30 up_dump_register: A0: 8009c42d A1: 3ffbc120 A2: 00000003 A3: 3ffbc14c up_dump_register: A4: 00000000 A5: 00000000 A6: 3ffbb640 A7: 00060920 up_dump_register: A8: 8009ba7d A9: 3ffbc100 A10: 3ffbb944 A11: 00000003 up_dump_register: A12: 400a4c70 A13: 3ffbb640 A14: 00000072 A15: 3f016a06 up_dump_register: SAR: 0000001f CAUSE: 00000000 VADDR: 00000000 dump_stackinfo: User Stack: dump_stackinfo: base: 0x3ffbbaa8 dump_stackinfo: size: 00001976 dump_stackinfo: sp: 0x3ffbc120 stack_dump: 0x3ffbc100: 3ffbb640 00000072 3f016a06 0000001f 800a4035 3ffbc140 00000003 00001603 stack_dump: 0x3ffbc120: 000007b8 3ffbba68 3ffbbaa8 00000000 800a4274 3ffbc190 00000003 00001601 stack_dump: 0x3ffbc140: 3ffbc1a0 3ffbc180 00000008 00000000 00000010 3ffbb858 3ffbc190 00000000 stack_dump: 0x3ffbc160: 00000510 400a4010 000186a0 00001601 3ffbc190 00000000 00000510 400a4010 stack_dump: 0x3ffbc180: 80094125 3ffbc1c0 00000000 00000003 00000000 05f5e100 000f4240 00000003 stack_dump: 0x3ffbc1a0: 00000000 3ffbae30 00000002 3ffbb5f8 80092848 3ffbc220 400a4080 00000003 stack_dump: 0x3ffbc1c0: 400a4010 ffffffff fffffffe 00000002 503457bf 85b52001 00000000 0327866b stack_dump: 0x3ffbc1e0: 00000002 40092701 7665642f 6d69742f 00307265 00000000 00000000 00000000 stack_dump: 0x3ffbc200: 00000013 00000002 00000000 3ffb6bec 00000000 3ffbc240 00000000 400a4080 stack_dump: 0x3ffbc220: 3ffbba78 3ffbad50 00000001 3ffbad50 00000000 3ffbc260 00000000 00000000 stack_dump: 0x3ffbc240: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 stack_dump: 0x3ffbc260: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 dump_tasks: PID GROUP PRI POLICY TYPE NPX STATE EVENT SIGMASK STACKBASE STACKSIZE COMMAND dump_task: 0 0 0 FIFO Kthread - Ready 0000000000000000 0x3ffb8040 3056 Idle_Task dump_task: 1 1 100 RR Task - Waiting Semaphore 0000000000000000 0x3ffba478 3016 nsh_main dump_task: 2 2 100 RR Task - Running 0000000000000000 0x3ffbbaa8 1976 timer -d /dev/timer0 ``` After this change, the timer works normally: ``` [...] nsh> timer -d /dev/timer0 Open /dev/timer0 flags: 00000000 timeout: 1000000 timeleft: 998939 nsignals: 20 Set timer interval to 1000000 flags: 00000000 timeout: 1000000 timeleft: 998939 nsignals: 20 Attach timer handler flags: 00000002 timeout: 1000000 timeleft: 998939 nsignals: 0 Start the timer flags: 00000003 timeout: 1000000 timeleft: 999666 nsignals: 1 flags: 00000003 timeout: 1000000 timeleft: 999700 nsignals: 2 flags: 00000003 timeout: 1000000 timeleft: 999696 nsignals: 3 flags: 00000003 timeout: 1000000 timeleft: 999700 nsignals: 4 flags: 00000003 timeout: 1000000 timeleft: 999696 nsignals: 5 flags: 00000003 timeout: 1000000 timeleft: 999700 nsignals: 6 flags: 00000003 timeout: 1000000 timeleft: 999696 nsignals: 7 flags: 00000003 timeout: 1000000 timeleft: 999700 nsignals: 8 flags: 00000003 timeout: 1000000 timeleft: 999696 nsignals: 9 flags: 00000003 timeout: 1000000 timeleft: 999700 nsignals: 10 flags: 00000003 timeout: 1000000 timeleft: 999702 nsignals: 11 flags: 00000003 timeout: 1000000 timeleft: 999704 nsignals: 12 flags: 00000003 timeout: 1000000 timeleft: 999698 nsignals: 13 flags: 00000003 timeout: 1000000 timeleft: 999704 nsignals: 14 flags: 00000003 timeout: 1000000 timeleft: 999700 nsignals: 15 flags: 00000003 timeout: 1000000 timeleft: 999704 nsignals: 16 flags: 00000003 timeout: 1000000 timeleft: 999700 nsignals: 17 flags: 00000003 timeout: 1000000 timeleft: 999704 nsignals: 18 flags: 00000003 timeout: 1000000 timeleft: 999700 nsignals: 19 flags: 00000003 timeout: 1000000 timeleft: 999704 nsignals: 20 Stop the timer flags: 00000000 timeout: 1000000 timeleft: 998946 nsignals: 20 Finished nsh> echo $? 0 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org