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

sprintf() only works while debugging

I'm aware of the limitations on using "printf" in a non-debug environment, but apparently there must be something similar with sprintf. I'm using it to load a value into a brief string for transmission over BLE. This works perfectly while debugging - the value is sent using ble_nus_string_send() and is received by the Central as expected. However, when I disconnect the debugger and run in production mode, the notification works but the characteristic value comes through as a null string.

This does not appear to be causing any sort of error or fault - the connection is maintained, the other functions of the board work as expected.

Using SDK v12.3 on an nRF51822 custom board. Building with SES.

Anyone know how to fix this?

Parents Reply Children
No Data
Related