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

Porting code from SDK v15.0 to 17 - problem with ble_nus_data_send

I have a working code which implements a UART peripheral written originally with SDK15.0

I would like to port it to the latest SDK 17.02 

I can get advertisement and I can connect with a smartphone. 

I can write data from the smartphone to the UART, but the opposite direction doesn't work

I get error and reset

I found that the problem is in ble_nus_data_send

What could be the reason (difference between SDK15 to SDK17)?

Parents Reply Children
  • You said previously that you had found the problem to be in the ble_nus_data_send function.
    I would appreciate it if you could show me the full error message.

    What is your NRF_SDH_BLE_TOTAL_LINK_COUNT defined to in your project, and how many concurrent connections do you intend to hold?

    Best regards,
    Karl

  • I meant that during debugging of why I don't get response, starting from the ble_nus_data_send, I found that I get ERROR which I described later.

    The value is:

    #define NRF_SDH_BLE_TOTAL_LINK_COUNT 1 

  • Avi said:
    I meant that during debugging of why I don't get response, starting from the ble_nus_data_send, I found that I get ERROR which I described later.

    Yes, I have understood this.
    The reason I would appreciate seeing the full error message is to make sure this in fact is where and why your application resets.
    It is also a great feature to use when developing your application further.

    Avi said:

    The value is:

    #define NRF_SDH_BLE_TOTAL_LINK_COUNT 1 

    Thanks for clarifying.

    Karl Ylvisaker said:
    how many concurrent connections do you intend to hold?


    Looking forward to resolving this issue together!
     
    Best regards,
    Karl

  • In my previous code it was set to 2.

    But if I put this number in SDK17, the code doesn't start. Maybe there are some other changes in the config file?

  • My previous code combined both peripheral and central - each started upon selection during init. So, values were:

    // <o> NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links.
    #ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
    #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1
    #endif

    // <o> NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links.
    #ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
    #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 1
    #endif

    // <o> NRF_SDH_BLE_TOTAL_LINK_COUNT - Total link count.
    // <i> Maximum number of total concurrent connections using the default configuration.

    #ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT
    #define NRF_SDH_BLE_TOTAL_LINK_COUNT 2
    #endif

    But in my new SDK17 version, when I use  NRF_SDH_BLE_TOTAL_LINK_COUNT 2

    I cannot start the peripheral 

Related