Assert failed changing cpu freq

felixcollins
Posts: 125
Joined: Fri May 24, 2019 2:02 am

Assert failed changing cpu freq

Postby felixcollins » Tue Oct 17, 2023 8:13 pm

I had my ESP32 WROOM32E N16 based device running connected to JTAG. I'm using the VSCODE extension. I got a panic due to a failed assertion. It looks like the power management library was doing a freq switch and timed out notifying the other core. Can an ESP person comment? Should I log a bug or is this something that is already fixed? If so has it been backported to a version that the ADF can use?

ESP-IDF version 4.4.5

Here is a screen grab of my IDE showing the relevant stacks (only valid for 3 months - I'll copy the stacks below).

Image

Code: Select all

xPortEnterCriticalTimeout (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\freertos\port\xtensa\port.c:314)
vPortEnterCritical (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\freertos\port\xtensa\include\freertos\portmacro.h:578)
do_switch (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_pm\pm_impl.c:470)
esp_pm_impl_switch_mode (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_pm\pm_impl.c:400)
esp_pm_lock_acquire (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_pm\pm_locks.c:112)
leave_idle (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_pm\pm_impl.c:569)
esp_pm_impl_isr_hook (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_pm\pm_impl.c:824)
_xt_medint2 (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\freertos\port\xtensa\xtensa_vectors.S:1203)
cpu_ll_waiti (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\hal\esp32\include\hal\cpu_ll.h:183)
esp_pm_impl_waiti (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_pm\pm_impl.c:838)
esp_vApplicationIdleHook (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_system\freertos_hooks.c:63)
prvIdleTask (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\freertos\tasks.c:3987)

Code: Select all

panic_abort (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_system\panic.c:408)
esp_system_abort (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_system\esp_system.c:137)
__assert_func (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\newlib\assert.c:85)
on_freq_update (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_pm\pm_impl.c:447)
on_freq_update (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_pm\pm_impl.c:410)
do_switch (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_pm\pm_impl.c:507)
esp_pm_impl_switch_mode (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_pm\pm_impl.c:400)
esp_pm_lock_release (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_pm\pm_locks.c:143)
esp_pm_impl_idle_hook (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_pm\pm_impl.c:804)
esp_pm_impl_waiti (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_pm\pm_impl.c:843)
esp_vApplicationIdleHook (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\esp_system\freertos_hooks.c:63)
prvIdleTask (c:\Users\felix\esp\esp-adf\esp-adf\esp-idf\components\freertos\tasks.c:3987)
DUMP from ESP doctor
---------------------------------------------- ESP-IDF Extension for Visual Studio Code report ---------------------------------------------
OS win32 x64 10.0.19045
System environment variable IDF_PYTHON_ENV_PATH
undefined
System environment variable PATH (CLIPPED for Privacy)
System environment variable PYTHON
undefined
Visual Studio Code version 1.83.0
Visual Studio Code language en
Visual Studio Code shell C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
ESP-IDF Extension version 1.6.5
Workspace folder c:<HOMEPATH>\source\beakbox\Firmware\beakbox3
---------------------------------------------------- Extension configuration settings ------------------------------------------------------
ESP-ADF Path (idf.espAdfPath) C:<HOMEPATH>\.espressif\esp-adf
ESP-IDF Path (idf.espIdfPath) c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf
ESP-MDF Path (idf.espMdfPath) ${env:MDF_PATH}
ESP-Matter Path (idf.espMatterPath) ${env:ESP_MATTER_PATH}
Custom extra paths (idf.customExtraPaths) c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\xtensa-esp-elf-gdb\11.2_20220823\xtensa-esp-elf-gdb\bin;c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\riscv32-esp-elf-gdb\11.2_20220823\riscv32-esp-elf-gdb\bin;c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\xtensa-esp32-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32-elf\bin;c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\xtensa-esp32s2-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32s2-elf\bin;c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\xtensa-esp32s3-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\bin;c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\riscv32-esp-elf\esp-2021r2-patch5-8.4.0\riscv32-esp-elf\bin;c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin;c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\cmake\3.23.1\bin;c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\openocd-esp32\v0.11.0-esp32-20221026\openocd-esp32\bin;c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\ninja\1.10.2;c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\idf-exe\1.0.3;c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\ccache\4.3\ccache-4.3-windows-64;c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\dfu-util\0.9\dfu-util-0.9-win64
Custom extra vars (idf.customExtraVars)
OPENOCD_SCRIPTS: c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\openocd-esp32\v0.11.0-esp32-20221026\openocd-esp32\share\openocd\scripts
IDF_CCACHE_ENABLE: 1
Virtual env Python Path (idf.pythonBinPath) c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\python_env\idf4.4_py3.8_env\Scripts\python.exe
Serial port (idf.port) COM6
OpenOCD Configs (idf.openOcdConfigs) interface/ftdi/tumpa-lite.cfg,target/esp32.cfg
ESP-IDF Tools Path (idf.toolsPath) c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools
Git Path (idf.gitPath) c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\idf-git\2.30.1\cmd\git.exe
-------------------------------------------------------- Configurations access -------------------------------------------------------------
Access to ESP-ADF Path (idf.espAdfPath) true
Access to ESP-IDF Path (idf.espIdfPath) true
Access to ESP-MDF Path (idf.espMdfPath) false
Access to ESP-Matter Path (idf.espMatterPath) false
Access to ESP-IDF Custom extra paths
Access to c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\xtensa-esp-elf-gdb\11.2_20220823\xtensa-esp-elf-gdb\bin: true
Access to c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\riscv32-esp-elf-gdb\11.2_20220823\riscv32-esp-elf-gdb\bin: true
Access to c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\xtensa-esp32-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32-elf\bin: true
Access to c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\xtensa-esp32s2-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32s2-elf\bin: true
Access to c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\xtensa-esp32s3-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\bin: true
Access to c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\riscv32-esp-elf\esp-2021r2-patch5-8.4.0\riscv32-esp-elf\bin: true
Access to c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin: true
Access to c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\cmake\3.23.1\bin: true
Access to c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\openocd-esp32\v0.11.0-esp32-20221026\openocd-esp32\bin: true
Access to c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\ninja\1.10.2: true
Access to c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\idf-exe\1.0.3: true
Access to c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\ccache\4.3\ccache-4.3-windows-64: true
Access to c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\dfu-util\0.9\dfu-util-0.9-win64: true
Access to Virtual env Python Path (idf.pythonBinPath) true
Access to CMake in environment PATH undefined
Access to Ninja in environment PATH undefined
Access to ESP-IDF Tools Path (idf.toolsPath) true
-------------------------------------------------------- Configurations has spaces -------------------------------------------------------------
Spaces in system environment Path true
Spaces in ESP-ADF Path (idf.espAdfPath) false
Spaces in ESP-IDF Path (idf.espIdfPath) false
Spaces in ESP-MDF Path (idf.espMdfPath) false
Spaces in ESP-Matter Path (idf.espMatterPath) false
Spaces in ESP-IDF Custom extra paths
Spaces in c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\xtensa-esp-elf-gdb\11.2_20220823\xtensa-esp-elf-gdb\bin: false
Spaces in c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\riscv32-esp-elf-gdb\11.2_20220823\riscv32-esp-elf-gdb\bin: false
Spaces in c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\xtensa-esp32-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32-elf\bin: false
Spaces in c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\xtensa-esp32s2-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32s2-elf\bin: false
Spaces in c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\xtensa-esp32s3-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32s3-elf\bin: false
Spaces in c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\riscv32-esp-elf\esp-2021r2-patch5-8.4.0\riscv32-esp-elf\bin: false
Spaces in c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin: false
Spaces in c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\cmake\3.23.1\bin: false
Spaces in c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\openocd-esp32\v0.11.0-esp32-20221026\openocd-esp32\bin: false
Spaces in c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\ninja\1.10.2: false
Spaces in c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\idf-exe\1.0.3: false
Spaces in c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\ccache\4.3\ccache-4.3-windows-64: false
Spaces in c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\tools\tools\dfu-util\0.9\dfu-util-0.9-win64: false
Spaces in Virtual env Python Path (idf.pythonBinPath) false
Spaces in ESP-IDF Tools Path (idf.toolsPath) false
----------------------------------------------------------- Executables Versions -----------------------------------------------------------
Git version 2.30.1.windows.1
ESP-IDF version 4.4.5
Python version 3.8.7
Python's pip version 21.2.3
-------------------------------------------------- Project configuration settings ----------------------------------------------------------
-------------------------------------------------- Python packages in idf.pythonBinPath ----------------------------------------------------
bitstring version: 3.1.9
Brotli version: 1.0.9
CacheControl version: 0.13.0
certifi version: 2023.5.7
cffi version: 1.15.1
charset-normalizer version: 3.1.0
click version: 8.0.4
colorama version: 0.4.6
construct version: 2.10.54
contextlib2 version: 21.6.0
cryptography version: 41.0.1
ecdsa version: 0.18.0
esp-debug-backend version: 1.0.3
esp-windows-curses version: 0.1
filelock version: 3.12.0
Flask version: 0.12.5
Flask-Compress version: 1.13
Flask-SocketIO version: 2.9.6
future version: 0.18.2
gcovr version: 6.0
gdbgui version: 0.13.2.0
gevent version: 1.5.0
greenlet version: 2.0.2
idf-component-manager version: 1.4.0
idna version: 3.4
itsdangerous version: 2.0.1
Jinja2 version: 3.0.3
kconfiglib version: 13.7.1
lxml version: 4.9.2
MarkupSafe version: 2.1.3
msgpack version: 1.0.5
packaging version: 23.1
pip version: 21.2.3
psutil version: 5.9.5
pycparser version: 2.21
pyelftools version: 0.29
pygdbmi version: 0.9.0.2
Pygments version: 2.15.1
pyparsing version: 2.2.0
pyserial version: 3.5
python-engineio version: 3.14.2
python-socketio version: 4.6.1
pywin32 version: 306
PyYAML version: 6.0
reedsolo version: 1.5.4
requests version: 2.31.0
requests-file version: 1.5.1
requests-toolbelt version: 1.0.0
schema version: 0.7.5
setuptools version: 68.2.2
six version: 1.16.0
tqdm version: 4.65.0
urllib3 version: 1.26.16
websocket-client version: 1.6.3
Werkzeug version: 0.16.1
wheel version: 0.36.2
windows-curses version: 2.3.1
xmlrunner version: 1.7.7
---------------------------------------------------- Check ESP-IDF python requirements.txt -------------------------------------------------
Check ESP-IDF Python packages Python requirements from c:<HOMEPATH>\esp\esp-adf\esp-adf\esp-idf\requirements.txt are satisfied.
---------------------------------------------------- Check extension requirements.txt ------------------------------------------------------
Check Extension Python packages Python requirements from c:<HOMEPATH>\.vscode\extensions\espressif.esp-idf-extension-1.6.5\requirements.txt are satisfied.
---------------------------------------------------- Check ESP-IDF debug adapter requirements.txt ------------------------------------------
Check Debug AdapterPython packages Python requirements from c:<HOMEPATH>\.vscode\extensions\espressif.esp-idf-extension-1.6.5\esp_debug_adapter\requirements.txt are satisfied.
---------------------------------------------------- Visual Studio Code launch.json --------------------------------------------------------
{
"version": "0.2.0",
"configurations": [
{
"type": "espidf",
"name": "DefaultIDF",
"request": "launch",
"logLevel": 5,
},
{
"type": "espidf",
"name": "IDF",
"request": "launch",
"debugPort": 43474,
"logLevel": 5,
"mode": "auto",
"verifyAppBinBeforeDebug": false,
"tmoScaleFactor": 2,
"initGdbCommands": [
"target remote :3333",
"set remote hardware-watchpoint-limit 2",
"symbol-file build/beakbox3.elf",
"mon reset halt",
"flushregs",
"thb app_main"
],
"env": {
"CUSTOM_ENV_VAR": "SOME_VALUE"
}
},
{
"name": "CPPDBG",
"type": "cppdbg",
"request": "launch",
"program": "C:\\Users\\felix\\source\\beakbox\\Firmware\\beakbox3\\build\\beakbox3.elf",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "${command:espIdf.getXtensaGdb}",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"text": "target remote localhost:3333"
},
{
"text": "monitor reset halt"
},
{
"text": "flushregs"
},
{
"text": "thb app_main"
}
],
"logging": {
"trace": true,
"traceResponse": true,
"engineLogging": true
}
}

MicroController
Posts: 1708
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Assert failed changing cpu freq

Postby MicroController » Wed Oct 18, 2023 12:24 am

I'm not 100% positive about how this is handled in the ESP/gdb, but if one core is stopped on a breakpoint by the debugger while the other core keeps running, I would actually expect timing violations all over the place.

Who is online

Users browsing this forum: rsimpsonbusa and 84 guests