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.
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.


helen said: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.
Does it happen if you open the project as-is without any modifications?
Kenneth
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?