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

Nordic didn't update custom characteristic after porting from Keil to SES

Hi,

I am trying to migrate my project file from Keil 5 to Segger Embedded Studio (SES).

After porting all my source code and configuration files, SES is able to compile and download code to my custom NRF52840 board without error. But I cannot update any data on my custom BLE characteristics - It is successfully initialised but didn't receive any notification data.

But with the same code compiled with Keil, I can update my custom BLE characteristic without any errors.

Here is my code when adding custom service and characteristics:

Here is the code when trying to initialise together with default BLE NUS.

Here is the code to update data on specific characteristic.

And the I use the default ble_evt_handler with added BLE_GATTS_EVT_HVN_TX_COMPLETE to manage the activities on custom characteristics:

.

Here is my UUID definitions:

Any advice are much appreciated. Thanks!

Parents Reply
  • Thanks Joakim,

    I am using nRF SDK 16.0.0.

    I had read the guide that you provided, and thought that it would be easier by copying and pasting my custom source code directly to the provided SES template file. (I used ble_app_uart example as template). Have also added required paths and updated memory size and location in the project settings.

    Perhaps I can try to do the migration and see the result again. Will update soon.

Children
  • You are correct. If you are not using an older nRF SDK without native support for SES I wouldn't recommend following the guide I linked to.

    I would recommend using a template SES project instead of actually migrating the example.
    Do you see any errors or abnormal behavior if you debug the application with SES?

    Br,
    Joakim

  • Hi Joakim,

    Strange things happen when I am using the SES IDE:

    Case 1:

    Sometimes the system is able to trigger the flag (used to indicate BLE transmission activity) but sometime doesn't.

    In which that ble_flag is declared as global variable:

    Case 2:

    In the case when ble_flag is triggered in "Release" project configuration, the system will return err_code = 0x05.

    Also, it won't return any error in "Debug" project configuration, which means that the system can send data to my phone without any problem.

    All of these problem didn't exist when I am using Keil.

    Looks like there are several misconfigurations here. I will need to check again with my code and update soon.

    Thanks.

  • Looks like I solved the problem by changing the Optimization Level from Level 2 to Level 0.

    But still curious on why this would change the performance behavior of the device. Any information on this will be much appreciated! =)