-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace outdated use of c_types.h with stdint #4
Conversation
Replace outdated use of c_types.h with stdint uint32 -> uint32_t
Thanks Rudi! I've added this PR and #5 into our internal change queue. For future reference, if you make changes on the same branch then you can add commits to an existing PR. You don't need to create a new PR each time (but github will do this if you create a new branch each time.) |
ah - thanks - have not seen "Add more commits by pushing to the" - ok now i know. |
It's possible for esp_pm_impl_isr_hook(...) to be nested due to the fact that interrupts are nested on the ESP32. To fix this we need to place the acquiring of the lock into a critical section to ensure it does not get nested on the system, otherwise the system will never release the idle lock when this occurs and will not go into lower power states. A sample backtrace encountering this (the code was instrumented to go into a while(1) loop when the condition was hit to get this backtrace) from commit d7a7a68: #0 leave_idle () at esp-idf/components/esp32/pm_esp32.c:444 espressif#1 0x4008143a in esp_pm_impl_isr_hook () at esp-idf/components/esp32/pm_esp32.c:473 espressif#2 0x40082750 in _xt_medint2 () at esp-idf/components/freertos/xtensa_vectors.S:1243 espressif#3 0x4000bff0 in ?? () espressif#4 0x40090bb0 in vTaskExitCritical (mux=0x3ffbd230) at esp-idf/components/freertos/tasks.c:4304 espressif#5 0x40081758 in esp_pm_lock_acquire (handle=0x3ffbd218) at esp-idf/components/esp32/pm_locks.c:126 espressif#6 0x40081399 in leave_idle () at esp-idf/components/esp32/pm_esp32.c:440 espressif#7 0x4008143a in esp_pm_impl_isr_hook () at esp-idf/components/esp32/pm_esp32.c:473 espressif#8 0x400826b8 in _xt_lowint1 () at esp-idf/components/freertos/xtensa_vectors.S:1154 espressif#9 0x400d14b0 in esp_pm_impl_waiti () at esp-idf/components/esp32/pm_esp32.c:483 espressif#10 0x400d2c77 in esp_vApplicationIdleHook () at esp-idf/components/esp32/freertos_hooks.c:63 espressif#11 0x40091008 in prvIdleTask (pvParameters=0x0) at esp-idf/components/freertos/tasks.c:3412 espressif#12 0x40090344 in vPortTaskWrapper (pxCode=0x40090ffc <prvIdleTask>, pvParameters=0x0) at esp-idf/components/freertos/port.c:143 Signed-off-by: Tim Nordell <tim.nordell@nimbelink.com>
Before this change _invalid_pc_placeholder pointed to address of _init function from crti.o This made GDB input a bit confusing: 0x40080400 in _init () (gdb) bt #0 0x40080400 in _init () #1 0x400e519a in test_instr_fetch_prohibited () at /home/alex/git/esp-idf/tools/test_apps/system/panic/main/test_panic.c:271 #2 0x400d89a7 in app_main () at /home/alex/git/esp-idf/tools/test_apps/system/panic/main/test_app_main.c:116 #3 0x400e5f22 in main_task (args=0x0) at /home/alex/git/esp-idf/components/freertos/app_startup.c:208 #4 0x400895a8 in vPortTaskWrapper (pxCode=0x400e5eb0 <main_task>, pvParameters=0x0) at /home/alex/git/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:139 After the change GDB prints output that contains a hint: _invalid_pc_placeholder () at /home/alex/git/esp-idf/components/xtensa/xtensa_vectors.S:2235 2235 UNREACHABLE_INSTRUCTION_CHECK_PREVIOUS_FRAMES (gdb) bt #0 _invalid_pc_placeholder () at /home/alex/git/esp-idf/components/xtensa/xtensa_vectors.S:2235 #1 0x400e519e in test_instr_fetch_prohibited () at /home/alex/git/esp-idf/tools/test_apps/system/panic/main/test_panic.c:271 #2 0x400d89ab in app_main () at /home/alex/git/esp-idf/tools/test_apps/system/panic/main/test_app_main.c:116 #3 0x400e5f26 in main_task (args=0x0) at /home/alex/git/esp-idf/components/freertos/app_startup.c:208 #4 0x400895a8 in vPortTaskWrapper (pxCode=0x400e5eb4 <main_task>, pvParameters=0x0) at /home/alex/git/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:139
Replace outdated use of c_types.h with stdint
uint32 -> uint32_t