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

Problem porting BLE-NUS on nRF52832

Hi, Nordic Forum!

We have developed our own logging module backend so we can store logs in an external flash memory. But now we wanted to transmit those logs via BLE to the phone so we can have a "picture" of what happened when it was not connected to our device.

We thought it was a good idea to use the ble_nus service since is already implemented. But when we tried to port it to our application, things stopped working.

Initially, when we called ble_nus_init, we got NRF_ERROR_NO_MEM back. Then we tried to increase the .vs_uuid_count field in the stack initialization, but when we did that, nothing worked. The program flashes, but we don't get any logs, no even of the functions we call before ble_stack_init.

We're using SDK ver 13.0.0 with SoftDevice S32 ver 4.0.2 in a custom board, and we have 1 custom service, the Nordic buttonless DFU service, and the standard battery level service.

Thanks in advance.

Parents
  • And that's perfectly fine because that's how Nordic SoftDevice work by design:

    • It cannot give you some magic formula in advance how to set RAM regions.
    • Instead you set some (high) value, configure all the things which influence that (number of connections, their bandwidth, parameters of LL and ATT layers such as PDU and MTU sizes, number of custom GATT UUID bases, Security Manager parameters etc.) and then you simply call enable functions of SD.
    • Load the FW with SD once to the board and run it in debug mode (with UART or RTT print-outs). The SoftDevice init will fail but it will tell you the right RAM base.
    • You go back to the project, change RAM base to proper value (in LD script or elsewhere - depending on toolchain you use) and run it on the board again to see that it is now OK and optimal.
    • Finally disable debug for production release and you are done.
  • That solved it! Thanks for the help and sorry for the inconvenience.

Reply Children
No Data
Related