Hi,
I'm soliciting help investigating ISR Hard Faults to do with using FreeRTOS on pico_w, specifically seen in the sdk-examples picow_freertos_ping NO_SYS=0 example, as well as my own application.
Have tried raising stack size to 2048, not a solution.
Setup
My software setup:
* pico-sdk v1.5.1
* pico-examples v1.5.1
* FreeRTOS from Feb 6 2024 (https://github.com/FreeRTOS/FreeRTOS-Ke ... 4fa1354ea8)
* Windows 11
* VSCode
* arm-none-eabi
Problem
I have a more complex application that would Hard Fault, after having BLE working and trying to introduce pico_cyw43_arch_lwip_sys_freertos.
So I tried to test the minimal example of the pico-examples and selected the picow_freertos_ping example since it covers the pico_cyw43_arch_lwip_sys_freertos library.
I am surprised to see in my tests that:
* The example doesn't appear to build properly against most recent FreeRTOS
* The example works sometimes and doesn't others
* The example hard faults
* The example faults in other ways
I default believe I'm doing something wrong, but I can't figure out what that is. Please help if able.
Build Caveats
Seemingly the picow_freertos_ping example doesn't build properly against recent versions of FreeRTOS.
I had to change the FreeRTOSConfig.h of the example to stop using 2 cores otherwise there was a build error:
I think this breaks due to:
* example is setting "configNUM_CORES"
* FreeRTOS is looking for "configNUMBER_OF_CORES"
* FreeRTOS then defaults configNUMBER_OF_CORES to 1 (which example wanted to be 2)
* FreeRTOS then notices that configUSE_CORE_AFFINITY == 1, which triggers the error
Tests
I compiled the example application and ran it on 2 different pico_w devices, sometimes under a debugger.
Without the whole chronology (available), I have seen:
* Hard Faults
* Some other kind of fault
Example ISR Hard Fault:The stack trace shows TestMainThread under __wrap_vprintf... signal handler ... isr_hardfault.
I thought I'd be able to upload/embed an image here, which I have, but seemingly not? Happy to provide if I can figure that out later.
Another non-HardFault:Resulted in the async_context having an undiagnosed signal handler called at 0xff...fe.
Alternative Scenarios
I did try compiling for SMP by changing the FreeRTOSConfiguration.h to be this (to actually compile and also work with the example):
This simply hung as follows:
Finally
As stated, I want to believe I'm doing something wrong here. Please help if you can find areas for me to investigate.
I've extracted the sdk-example and other than some CMake twiddling to get it to build it's stock code. Happy to be challenged to prove it out more.
I'll lastly state that I've also noticed discrepancies in the operation of the software on this device. Sometimes it runs seemingly successfully, other times not. Sometimes I hear a plainly audible high-frequency noise from the hardware, other times not. Repeated power cycles of the software produce different results.
The non-determinism strikes me as a race somewhere, but it's not clear where that would be or how it affects the outcome.
Thanks for the help, please let me know what I can add to help move this forward.
Thanks.
Doug
I'm soliciting help investigating ISR Hard Faults to do with using FreeRTOS on pico_w, specifically seen in the sdk-examples picow_freertos_ping NO_SYS=0 example, as well as my own application.
Have tried raising stack size to 2048, not a solution.
Setup
My software setup:
* pico-sdk v1.5.1
* pico-examples v1.5.1
* FreeRTOS from Feb 6 2024 (https://github.com/FreeRTOS/FreeRTOS-Ke ... 4fa1354ea8)
* Windows 11
* VSCode
* arm-none-eabi
Problem
I have a more complex application that would Hard Fault, after having BLE working and trying to introduce pico_cyw43_arch_lwip_sys_freertos.
So I tried to test the minimal example of the pico-examples and selected the picow_freertos_ping example since it covers the pico_cyw43_arch_lwip_sys_freertos library.
I am surprised to see in my tests that:
* The example doesn't appear to build properly against most recent FreeRTOS
* The example works sometimes and doesn't others
* The example hard faults
* The example faults in other ways
I default believe I'm doing something wrong, but I can't figure out what that is. Please help if able.
Build Caveats
Seemingly the picow_freertos_ping example doesn't build properly against recent versions of FreeRTOS.
I had to change the FreeRTOSConfig.h of the example to stop using 2 cores otherwise there was a build error:
Code:
// #if FREE_RTOS_KERNEL_SMP // set by the RP2040 SMP port of FreeRTOS#if 0/* SMP port only */#define configNUM_CORES 2#define configTICK_CORE 0#define configRUN_MULTIPLE_PRIORITIES 1#define configUSE_CORE_AFFINITY 1#endif
I think this breaks due to:
* example is setting "configNUM_CORES"
* FreeRTOS is looking for "configNUMBER_OF_CORES"
* FreeRTOS then defaults configNUMBER_OF_CORES to 1 (which example wanted to be 2)
* FreeRTOS then notices that configUSE_CORE_AFFINITY == 1, which triggers the error
Tests
I compiled the example application and ran it on 2 different pico_w devices, sometimes under a debugger.
Without the whole chronology (available), I have seen:
* Hard Faults
* Some other kind of fault
Example ISR Hard Fault:
Code:
Starting FreeRTOS on core 0:Version: 7.95.49 (2271bb6 CY) CRC: b7a28ef3 Date: Mon 2021-11-29 22:50:27 PST Ucode Ver: 1043.2162 FWID 01-c51d9400cyw43 loaded ok, mac 28:cd:c1:0c:88:92[CYW43] do_ioctl(2, 263, 20): timeoutIgnoring packet with wrong id 7 != 8API: 12.2Data: RaspberryPi.PicoWCompiler: 1.29.4ClmImport: 1.47.1Customization: v5 22/06/24Creation: 2022-06-24 06:55:08Connecting to Wi-Fi...connect status: joining
I thought I'd be able to upload/embed an image here, which I have, but seemingly not? Happy to provide if I can figure that out later.
Another non-HardFault:
Code:
Starting FreeRTOS on core 0:Version: 7.95.49 (2271bb6 CY) CRC: b7a28ef3 Date: Mon 2021-11-29 22:50:27 PST Ucode Ver: 1043.2162 FWID 01-c51d9400cyw43 loaded ok, mac 28:cd:c1:0c:88:92[CYW43] do_ioctl(2, 263, 20): timeout[CYW43] do_ioctl(0, 262, 128): timeoutclmverIgnoring packet with wrong id 7 != 9Ignoring packet with wrong id 8 != 9Connecting to Wi-Fi...connect status: joining
Alternative Scenarios
I did try compiling for SMP by changing the FreeRTOSConfiguration.h to be this (to actually compile and also work with the example):
Code:
#if FREE_RTOS_KERNEL_SMP // set by the RP2040 SMP port of FreeRTOS// #if 0/* SMP port only */#define configNUM_CORES 2#define configNUMBER_OF_CORES 2// had to add otherwise error#define configUSE_PASSIVE_IDLE_HOOK 0#define configTICK_CORE 0#define configRUN_MULTIPLE_PRIORITIES 1#define configUSE_CORE_AFFINITY 1#endif
Code:
Starting FreeRTOS on core 0:
Finally
As stated, I want to believe I'm doing something wrong here. Please help if you can find areas for me to investigate.
I've extracted the sdk-example and other than some CMake twiddling to get it to build it's stock code. Happy to be challenged to prove it out more.
I'll lastly state that I've also noticed discrepancies in the operation of the software on this device. Sometimes it runs seemingly successfully, other times not. Sometimes I hear a plainly audible high-frequency noise from the hardware, other times not. Repeated power cycles of the software produce different results.
The non-determinism strikes me as a race somewhere, but it's not clear where that would be or how it affects the outcome.
Thanks for the help, please let me know what I can add to help move this forward.
Thanks.
Doug
Statistics: Posted by scipi — Tue Mar 26, 2024 3:54 am