In trying to develop a ble peripheral app with verbose logging, I observed the device ceasing to advertise somewhat repeatably. I think I have an easy bug jar; it reproduces for me 100%
The failure appears to be excersized simply by logging repeatedly under the default sdk config / build.
- download/unpack sdk: http://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v14.x.x/nRF5_SDK_14.2.0_17b948a.zip
- leave logging config at default:
- 115200, 8 data bits, 1 stop bit, parity=none, flow control=none
- connect to the /dev/ttyACM0 via putty with the above
- modify the sdk code in examples/ble_peripheral/ble_app_hts/main.c
- change advertised name (just to ensure uniqueness in a busy lab)
- add trivial logging to main loop, as such:
// Enter main loop. unsigned long count = 0; for (;;) { if(++count %10 == 0) { NRF_LOG_INFO("count=%lu", count); } if (NRF_LOG_PROCESS() == false) { power_manage(); } } }
- build and run via segger embedded studio
- Observe the device up and working:
- The device resets (LED's flash)
- output begins on the serial port
<info> app: Health Thermometer example started. <info> app: Fast advertising. <info> app: count=10 <info> app: count=20 ...
- I can see the name set in main.c being broadcast via a separate scanner
- with 100% repeatability, the failure occurs:
- serial stops repeatable after this many statements:
... <info> app: count=290 <info> app: count=300
- observe that the device has ceased advertising
- serial stops repeatable after this many statements:
This is 100% repeatable for me, and it doesn't seem there is anything that could be unique about my system (due to the fact the bluetooth advertisement stops as well).