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

Issue on writing custom Characteristics

Hi,
I have very STRANG issues. I am adding custom Characteristics to custom Services. I have added 10 custom Characteristics with the same config 8 of them are working perfectly fine but 2 of them are causing issues. 

I am also attaching my project.

I have the following 2 issues.

1-Issue with Custom Characteristics no 4:

I have successfully read/write on others 9 Characteristics but unable to write from device side on Characteristics no 4. (I am writing in on_write function you can check in ble_cus.c)

2-Issue with Custom Characteristics no 5:
When I add this I got following issue.

    err_code = custom_value_char_add_5(p_cus, p_cus_init);
    APP_ERROR_CHECK(err_code);  







5415.Project.zip

  • Muqarrab said:
    I don't know how to debug next. Can you please guide?
    I have also attached my project can you please check for once.

     I have tried your project, and I don't get any of the errors that you get. 

    Go to the definition of nrf_ble_qwr_conn_handle_assign() and set a breakpoint inside it. When the breakpoint hits, check that the p_qwr pointer is not NULL, and check the value of p_qwr->initialized. What is that value?

     

    Muqarrab said:
    I am getting the following issue.

     Are you sure this happens in the project that you sent to me? Can you please try to unzip it in an unmodified SDK? Try to download the SDK again, and unzip it. Don't change anything outside the project folder that you attached here. Does the issues still occur?

  • Are you sure this happens in the project that you sent to me? Can you please try to unzip it in an unmodified SDK? Try to download the SDK again, and unzip it. Don't change anything outside the project folder that you attached here. Does the issues still occur?

    I have followed the steps but still getting the same issue.
    Are you able to read value "0x24" on characteristics no 4 when you write any value on characteristics no 4
    from nRF App?

  • Yes. I used nRF Connect for Desktop and I can see 0x24 on the characteristic no 4:

    The only thing I changed was to add the line:

    uint32_t ble_cus_init(ble_cus_t * p_cus, const ble_cus_init_t * p_cus_init);

    to ble_cus.h, because the compiler was complaining that this function was first declared in main.c. I also removed that line from ble_cus.c.

    That is the proper way to add functions in C programming. Try to do that, and rebuild your project from scratch:

    Best regards,

    Edvin

  • Thanks, problem solved but I don't know-how. Nerd

Related