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

BLE lost messages

Hi, as part of my project i have 2 nordic 52dks one as a pheripheral (sending) and on as a client (recieving). where i am sening a buffer of 8, in the order

buffer[0] = 10

buffer[1}= X gyro lsb

buffer[2] = X gyro msb

buffer[3] = y gyro lsb

buffer[4] = y gyro msb

buffer[5] = z gyro lsb

buffer[6] = z gyro msb

buffer[7] = 36   //terminator $

however sometimes i seem to lose a byte over ble such that the next byte received will be less and hence the order is correupted thus making processing rather and unpredictable for a large sample size like 1000000 samples.

how may i ensure that my ble settings are correct such that i ensure to limit this issue.

my code was based of the examples ble_app_uart and ble_app_uart_c for the peripheral and client respectivly.

thank u in advance 

Parents
  • Hello,

    however sometimes i seem to lose a byte over ble such that the next byte received will be less and hence the order is correupted thus making processing rather and unpredictable

    No byte is lost over the BLE link, it is not possible as the protocol uses the CRC field to verify that the contents of the packet is uncorrupted and received as it was sent. If the CRC does not match, the packet is discarded and not acknowledged - leading to a re-transmission of the same packet.
    If you would like to confirm the communication happening on-air between the devices you could use the nRF Sniffer tool to trace the communication and read the individual packet contents.

    How is your handling / processing of the received data? How are you alerted to the seemingly corrupted data? Have you checked whether the corrupted values could be what the peripheral intended to send?

    Looking forward to resolving this issue together!

    Best regards,
    Karl

  • Firstly i would like to thank you for your reply, and for the sniffer, is there any documentation on how to install this please?

    The way im checking that the data is being missed is through the uart terminal of the client (recieving) board and also i have a matllab script that is reading serially aswell. to check this i sent known data meaning sending 8 bytes (hex) 10-16 and a terminator 36.

    and as u can see in the first colomn its fine but then in the second colom the 12 didnt send or be recieved which will therefore mess up my data 

  • Great! Thank you for confirming.

    Karl Ylvisaker said:
    Have you checked your logger output when this happens? - if so, what does it say?

    Are you seeing anything in your logger when the device suddenly resets?
    If so, please tell me what the logger says.

    Best regards,
    Karl 

  • hi , no i dont get anything in the logger, and as mentioned previously my client devboard doesnt connect to the perhiperal with the app error

  • is it possible to have some kind of meeting please? inorder to solve the issue please and also ask some minor questions with relation to this ticket please

  • NikTheNordicUser said:
    hi , no i dont get anything in the logger,

    Which logger backend are you using, and how have you configured it?
    Are you working out of an example from the SDK? If such, the example should have the logger setup already, so that you see output in your logger when starting any unmodified SDK example.
    These logs usually read something like ".... example started".

    If you are working out of the ble_app_uart example, the example uses the RTT logger backend by default. You will then only see the messages either in the SES debug terminal or using an RTT terminal such as Segger's RTT Viewer application. 

    NikTheNordicUser said:
    as mentioned previously my client devboard doesnt connect to the perhiperal with the app error

    This is likely due to a non-NRF_SUCCESS error being passed to an APP_ERROR_CHECK.
    While it may seem like a step in the wrong direction, it is actually a crucial step in the right direction, as this alerts you to the fact that a function call in your application is failing - and must be looked closer at.
    Without checking error codes you are only hiding potential problems in your application, and it will most likely cause major headaches later in your development/deployment to leave these unchecked.

    NikTheNordicUser said:
    is it possible to have some kind of meeting please? inorder to solve the issue please and also ask some minor questions with relation to this ticket please

    I do not think a meeting is necessary at this point. We have specific lead to follow to continue the debugging - seeing the logs in order to understand what part of the application is failing. My suspicion here is that your call to ble_nus_data_send fails with the NRF_ERROR_RESOURCES error code. This is however just my suspicion, and we will need the loggers output to know for sure.
    Please write any minor questions you might have here in the ticket - this will keep the forum tidy, and might help other forum-goers who have the same questions later.

    If these minor questions are sensitive or contain sensitive information, you can just let me know and I can mark the ticket as private. This will make the ticket only viewable to your self and the support staff here at Nordic.

    Looking forward to resolving this issue together.

    Best regards,
    Karl 

Reply
  • NikTheNordicUser said:
    hi , no i dont get anything in the logger,

    Which logger backend are you using, and how have you configured it?
    Are you working out of an example from the SDK? If such, the example should have the logger setup already, so that you see output in your logger when starting any unmodified SDK example.
    These logs usually read something like ".... example started".

    If you are working out of the ble_app_uart example, the example uses the RTT logger backend by default. You will then only see the messages either in the SES debug terminal or using an RTT terminal such as Segger's RTT Viewer application. 

    NikTheNordicUser said:
    as mentioned previously my client devboard doesnt connect to the perhiperal with the app error

    This is likely due to a non-NRF_SUCCESS error being passed to an APP_ERROR_CHECK.
    While it may seem like a step in the wrong direction, it is actually a crucial step in the right direction, as this alerts you to the fact that a function call in your application is failing - and must be looked closer at.
    Without checking error codes you are only hiding potential problems in your application, and it will most likely cause major headaches later in your development/deployment to leave these unchecked.

    NikTheNordicUser said:
    is it possible to have some kind of meeting please? inorder to solve the issue please and also ask some minor questions with relation to this ticket please

    I do not think a meeting is necessary at this point. We have specific lead to follow to continue the debugging - seeing the logs in order to understand what part of the application is failing. My suspicion here is that your call to ble_nus_data_send fails with the NRF_ERROR_RESOURCES error code. This is however just my suspicion, and we will need the loggers output to know for sure.
    Please write any minor questions you might have here in the ticket - this will keep the forum tidy, and might help other forum-goers who have the same questions later.

    If these minor questions are sensitive or contain sensitive information, you can just let me know and I can mark the ticket as private. This will make the ticket only viewable to your self and the support staff here at Nordic.

    Looking forward to resolving this issue together.

    Best regards,
    Karl 

Children
  • Hi, im using a serial terminal inorder to see the error , however as I mentioned previously when i add the app error check the central dev kit is not connecting to the pheripheral 

  • NikTheNordicUser said:
    im using a serial terminal inorder to see the error

    Does this mean that you are seeing the error message? Please tell me what it says.

    NikTheNordicUser said:
    as I mentioned previously when i add the app error check the central dev kit is not connecting to the pheripheral 
    Karl Ylvisaker said:
    This is likely due to a non-NRF_SUCCESS error being passed to an APP_ERROR_CHECK.

    Yes, and as I mention this is likely because you are hitting a non-NRF_SUCCESS return code before initiating the connection.

    Best regards,
    Karl

  • Does this mean that you are seeing the error message? Please tell me what it says.

    Hi , karl , no i dont get or see anything.

    Yes, and as I mention this is likely because you are hitting a non-NRF_SUCCESS return code before initiating the connection.

    how do i fix that so that i can show you if i get an error message

  • NikTheNordicUser said:
    im using a serial terminal inorder to see the error
    NikTheNordicUser said:
    no i dont get or see anything.
    Karl Ylvisaker said:
    Which logger backend are you using, and how have you configured it?
    Are you working out of an example from the SDK? If such, the example should have the logger setup already, so that you see output in your logger when starting any unmodified SDK example.
    These logs usually read something like ".... example started".

    If you are working out of the ble_app_uart example, the example uses the RTT logger backend by default. You will then only see the messages either in the SES debug terminal or using an RTT terminal such as Segger's RTT Viewer application. 

    If you have not changed the logger's backend, the default backend used in the ble_app_uart example is the RTT backend. You will need an RTT terminal to see these logs.
    Please either open the debug terminal in Segger Embedded Studio, or download the Segger RTT Terminal like suggested in my previous comment.

    The example does not use the UART logger backend, because the UART is already in use by the application. Please do this, and let me know if you see any logs at all.

    Best regards,
    Karl

  • hi , i finally understood apologies for taking so long... ok so my problem at the moment is that the mcu is resetting after some time and this is the code i have and the debug terminal (it gets stuck on a NRF_BREAKPOINT_COND)

    hope that the images are clear.

    the scope of that code is to simply send hex 1-240 for 10 times by bluetooth and recieve on a central dk (using the ble_nus_central example with modification).

    however after sometime running the reciveing nrf52Dk (client) seems to reset and im unsure why

Related