ARMmbed / mbed-os-example-ble

BLE demos using mbed OS and mbed cli
Apache License 2.0
134 stars 118 forks source link

BLE_Advertising example stack overflow nRF52 if debugging with MBED_TICKLESS is set #381

Closed pearson closed 3 years ago

pearson commented 3 years ago

Description of defect

The Mbed BLE_Advertising example fails with a stack overflow on an nRF52832 in debug profile if the default MBED_TICKLESS parameter is set in the MCU_NRF52832 section mbed-os\targets\targets.json.

++ MbedOS Error Info ++
Error Status: 0x80020125 Code: 293 Module: 2
Error Message: CMSIS-RTOS error: Stack overflow
Location: 0x4E25
Error Value: 0x1
Current Thread: <unnamed> Id: 0x20000D08 Entry: 0x1CF1C StackSize: 0x20000 StackMem: 0x20002408 SP: 0x2000FECC
For more info, visit: https://mbed.com/s/error?error=0x80020125&tgt=TARGET_NAME
-- MbedOS Error Info --

This problem may be related to the MBED_TICKLESS debugging behavior described in issue #14766 in mbed-os.

Target(s) affected by this defect ?

nRF52832, possibly other nRF devices

Toolchain(s) (name and version) displaying this defect ?

The defect appears with either the command line tools or if built through PlatformIO:

What version of Mbed-os are you using (tag or sha) ?

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

How is this defect reproduced ?

The problem will NOT appear if:

ciarmcom commented 3 years ago

Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers. Internal Jira reference: https://jira.arm.com/browse/IOTOSM-4071

pearson commented 3 years ago

@ciarmcom , you're welcome!

I seem to be having a lot of issues with the nRF52832 and Mbed. I'll be posting another shortly regarding the BLE_PeriodicAdvertising example. (The BLE_PeriodicAdvertising problem was my error! oops.)

paul-szczepanek-arm commented 3 years ago

I don't think you're problems are anything to do with examples. If you're having issues with the stack being too small, try doubling the stack size.

pearson commented 3 years ago

Hi @paul-szczepanek-arm . I'm going to close this issue for now as I can no longer replicate the problem.

It's really odd... I tested my steps to reproduce (and edited them yesterday), and I could reproduce it.

Sorry about that. I'll reopen the problem if I can reproduce it again. That said, issue #14766 in mbed-os with the nRF52832, MBED_TICKLESS, ThisThread::sleep_for(), and debugging is still reproducible on more than one nRF52832.