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

Nordic UART Relay

Hi,

I'm trying to adapt the HRS/RSCS relay example from the SDK to use the Nordic UART service instead. Currently I can connect to the central just fine, but if I try to connect a peripheral to the central, the central will crash after receiving a descriptor from the peripheral, but I've had a hard time figuring out where or why this crash occurs.

I've tried using both a PCA10040 and a PCA10028, using the 12.2 SDK and softdevices. My current project: ble_app_nus_relay.zip

Thanks, Reuben

EDIT: locals.PNG

  • I just started over from a fresh SDK, and running my project produces the same result I was seeing before.

    I currently got two PCA10028 boards set up, one programmed with the ble_uart peripheral demo, the other programmed with my project.

    I can connect to both boards fine using my mobile phone and the nordic uart app, and they behave exactly as expected.

    However, when the board running my project attempts to connect to the board running the demo, it crashes, stops advertising, and needs to be restarted. If I debug the board, I see the the disassembly that it hits a bkpt instruction. Continuing will take me to the app error handler with garbage data.

  • It seems the reason you end up at that breakpoint (BKPT 0xAB) is that you call printf in your code without correctly retargeting the stdio functions. You need to either change printf into NRF_LOG_INFO or correctly implement printf (add app_uart.c, app_fifo.c, and retarget.c, in addition to enabling the modules in sdk_config.h. You can check out the ble_app_uart example if you need help adding the correct defines to sdk_config.h).

Related