This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Strange behaviour migrating from SDK 15.0.0 to SDK 15.2.0

Hi,

we've developed and produced a nRF52832-based custom PCB with custom firmware that is using advertising, scan, connection, custom Bluetooth service and characteristics, TWI, UART, PWM and more (SDK 15.0.0 and S132 v6.0.0).

I'm now trying to migrate to SDK 15.2.0 and S132 v6.1.1 with a "fast" approach, that is:

  • opening ble_app_rscs_c example in SDK 15.2.0
  • overwriting its main.c with our main.c
  • adding all the necessary files
  • aligning its sdk_config.h with our sdk_config.h

At a first attempt, the firmware just kept resetting. After some debugging, I found out that the problem was due to the advertising part:

  1. advertising_init() does its job
  2. a timer that periodically calls advertising_start() is started
  3. when such timer expires, the advertising should start

It did not start though, and caused the system to crash. Why? Because it saw m_advertising.initialized=false even if the initialization was fine. The problem indeed was the timer: after it was started, the m_advertising.initialized turned from true to false.

Curious, but the most curious thing is that the problem was resolved by simply changing the name of such timer from m_adv_start_timer_id to m_refresh_timer_id.

At this point I was able to see regular advertising packets, but not able to perform a connection (when trying to connect, the system crashes because of SoftDevice assert). Strange thing: it happened a couple of times that the connection was established for a few seconds (I could even see all of my custom characteristics!) before crashing again. I could not solve this issue.

Another strange fact: by enabling the scan (and a timer that periodically restarts it), two LEDs are blinking instead of just one (which is what it should do in normal conditions). Even more strange: changing the timer's name, no LED is blinking.

I guess there are more strange things out there that I just couldn't see. I am aware that this is not a simple question to answer, but maybe you have an idea of what could cause all of these strange problems.

If not, what could be the right approach to accomplish such migration? Start again adding one functionality at a time and move on only if it is working fine? It's gonna be a long work and I'd really like to avoid it, also because I think I'm close to have things working with the "fast" approach.

Any help/suggestion is appreciated.

Thanks and best regards

Related