This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can we have multiply services in the program for BLE applicaiton?

Hi everyone, I have one question shown in the title. I try to add a second service in "ble_app_uart" project (the project is in the SDK for nRF51, SD130 v2), I did not change any code in the original project but only add a new service I learnt in this blog: devzone.nordicsemi.com/.../ . Then the program seems just stop and fail to add even one service. It works very well before I add the second service. For a little bit more detail, I put the second service init code in the original services_init() function. And it works with my own service when I bypass the original service. My board is PCA10028 Any idea?

  • If you add things to the stack you might hit RAM allocation limits and you need to recompile the project with different settings in linker scripts. This is one of typical problems, not saying the only one. It's actually hard to say from your poor description. So the answer to your questions is "Surely it is possible to add new GATT objects to nRF5x project which uses GATT Server, we all are doing it every day for years."

    Run the project with RTT or UART debug print outs and see where is the error. 99% of them are already asked and answered on this forum so the rest of debugging and ficing should be quick.

  • If you use one or more vendor specific UUIDs you have to inform the Softdevice about it in ble_stack_init(). Have you added:

    ble_enable_params.common_enable_params.vs_uuid_count = 'number_of_vs_uuids'
    

    When you add UUIDs like this you will most likely have to change the RAM base and start address as well, like shown in the comment section here. Use RTT Viewer or a UART serial terminal to see the debug messages from the Softdevice. If none of this helps, please try to debug like this to pinpoint where and why things go wrong.

  • Thank you very much. It was the problem of memory. RTT NRF log can print the new memory and address. It works after I update the new address.

  • Many thanks. The NRF log is very useful, I solve the problem with that.

Related