Hi
I modify the ble_app_uart_c example to support connecting multiple nus peripherals.Calling the new_cccd_configure(p_ble_nus_c, true) return error after nus_c discovers nus completed as figure below.I can not find the reason.Attachment is my code.

Hi
I modify the ble_app_uart_c example to support connecting multiple nus peripherals.Calling the new_cccd_configure(p_ble_nus_c, true) return error after nus_c discovers nus completed as figure below.I can not find the reason.Attachment is my code.

Did you change the code in ble_nus_c.c?
It looks to me like the err_code variable is uninitialized, thus you read a random value off the stack memory.
1、
The reason is as what you say,thank you.
2、There is no code for breakpoint in the project and ble_nus_c_string_send() isn‘t called by project.And It is not invalid to set the optimization level to 0.


Hi

Yes,I open the project as-is without any modifications in options.
You can either compile with debug configuration and/or change the optimization on specific files like this:
Hi

I've tried this way before, but the no code for breakpoint is still in the project.Do you have any other suggestion?
For the release notes of each nRF5 SDK you should find which versions of tools were used, I suggest to check if you can download those in specific. Also I suggest to try another example for comparison.
Kenneth
There will be no code generated for those marked lines if NRF_SDH_BLE_PERIPHERAL_LINK_COUNT is set to zero. Which it is in your 7z file in your first post.
If the compiler refuses to generate code, there will usually be a good reason.
There will be no code generated for those marked lines if NRF_SDH_BLE_PERIPHERAL_LINK_COUNT is set to zero. Which it is in your 7z file in your first post.
If the compiler refuses to generate code, there will usually be a good reason.