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

Reset/Crash after first transfer of ble_nus_c_string_send

I made a code based on ble_app_uart_c which connects to a peripheral and once connected it can write or read data.

The code is supporting BLE4 (1M) and BLE5 (Long Range) with a software switch.

The functions that work are:

1) The central scans and find BLE4 or BLE5 (long range) peripherals (depends on my selection)

2) The central can connect to anyone that I want (BLE4 or BLE5)

3) Once connected, the peripheral can write data and it is seen at the central UART side (BLE4 and BLE5 long range)

4) Only in BLE4 (1M), the central can write data to the peripheral and it is seen on the peripheral UART 

The problem is once the central in BLE5 long range writes data to the connected peripheral, the first data string is accepted and seen on the Uart side, but then it gets internal reset and stop working.

The error code from ble_nus_c_string_send is 0. I cannot find any other error message before this crash

What could be the reason?

Parents
  • Hello,

     

    The error code from ble_nus_c_string_send is 0. I cannot find any other error message before this crash

     Does the log (RTT backend, I assume) say anything? Do you see anything from the log at all that is printed in your application using NRF_LOG_INFO()?

    If you see the line "Fatal error." Can you please try to define DEBUG in your preprocessor defines? If you are not sure how to add preprocessor defines, please let me know what IDE you are using.

    Best regards,

    Edvin

  • Unfortunately, I am using a Keil environment and reached the size limit, so I had to shut down the log.

    I tried to bring up the SES environment but I couldn't set the correct libraries and include files to get it to work.

    I would appreciate your help to set it up - and then I could learn more from the log file generated.

    Can I send you the zip file of the entire project? 

  • I recommend that you use the SES environment if you don't have a licence for Keil. It is hard to develop without logging (or in general with the size limitation). You can try to set breakpoints, but you may not be able to disable compiler optimization either then? In that case it is hard to debug (step), because it will jump back and forth, and you can't always see the values of variables. What issues did you run into when you tried to run the SES project?

    You can upload it here, but I don't need your Keil project if you don't have a licence. Even though we find this problem, you may run into another at a later point in time. You need to be able to debug your project to develop properly. 

    BR,

    Edvin

Reply
  • I recommend that you use the SES environment if you don't have a licence for Keil. It is hard to develop without logging (or in general with the size limitation). You can try to set breakpoints, but you may not be able to disable compiler optimization either then? In that case it is hard to debug (step), because it will jump back and forth, and you can't always see the values of variables. What issues did you run into when you tried to run the SES project?

    You can upload it here, but I don't need your Keil project if you don't have a licence. Even though we find this problem, you may run into another at a later point in time. You need to be able to debug your project to develop properly. 

    BR,

    Edvin

Children
Related