Bluetooth and threading with Zephyr

Hey,
I'm trying to integrate BT + DFU functionality into my application, i'm following this example:
Add DFU support to your application - Software - nRF Connect SDK guides - Nordic DevZone (nordicsemi.com)

Everything is working fine, I can see device from nordic iOS app and even send strings. Everything fails, when i'm adding to program my own code.
I'm pretty sure that code itself isn't a problem. Please look at below examples in pseudocode:

COMBINATION THAT WORKS:

main() starts
enable BT and mcumgr OTA.
run my thread (only small inits)
my code executed in while loop, placed in main()

COMBINATION THAT DOES NOT WORK:

main() starts
enable BT and mcumgr OTA.
run thread with my code (executed in thread's while loop)

So the problem occures only when i'm executing my code in thread's while loop. When i use while in main loop everything works.
Do you guys have any idea what is going on here? Maybe I should create separate thread only for bluetooth? 

I'm using SDK 1.8.0 and nRF52832 dev board.

Parents Reply Children
No Data
Related