Closed JaapBosheuvel closed 4 years ago
This is a stack overflow, which is natural given that the stack sizes are going to increase with no optimizations enabled.
There's also a small bug to fix, which is that the RX priority thread in the HCI driver had a non-configurable stack size. This is fixed in #28467.
To find it, I did the following:
echo "CONFIG_NO_OPTIMIZATIONS=y" >> samples/bluetooth/peripheral_ht/prj.conf
echo "CONFIG_HW_STACK_PROTECTION=y" >> samples/bluetooth/peripheral_ht/prj.conf
and then played around with stack sizes.
This now runs fine with this configuration:
west build samples/bluetooth/peripheral_ht -- -DCONFIG_LOG_PROCESS_THREAD_STACK_SIZE=4096 -DCONFIG_BT_RX_STACK_SIZE=4096 -DCONFIG_BT_CTLR_RX_PRIO_STACK_SIZE=4096
Describe the bug I get an error message on the terminal when running the sample: _$ZEPHYR_BASE/zephyr/samples/bluetooth/peripherht with the CONFIG_NO_OPTIMIZATIONS=y flag. This error message comes up immediately:
When I run the binary in my debugger it will not crash immediately and advertises. But when I try to connect with nRF Connect app on android the terminal shows the following error message:
NOTE that the same kind of behavior also happened with sample peripheral_hr
To Reproduce Tested on commit: c64e0ce923cde54415d203e447a1dc62894ed2b0
I check the terminal with putty, and debug with SEGGER Ozone using the zephyr.elf at _$ZEPHYRBASE/zephyr/build/zephyr/zephyr.elf with the recommended settings (SWD and 4MHz).
Expected behavior Same execution as without the optimization flag
Impact The ability to debug without optimizations
Logs and console output see above
Environment (please complete the following information):
Additional context Might have similarities with: https://github.com/zephyrproject-rtos/zephyr/issues/12820 ? Could not resolve the issue after reading it.
Kind regards, John Hendriks