Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

adding ble app uart into a peripheral example

Hi,

I am trying to add the ble-app-uart example into the saadc example. I added all needed files.c which there were not in the saadc project and also all paths in the user include path in the project option. I also added all #include needed for the uart example in the main.c file of the saadc project.

I faced a lot of errors such as:

error: 'NRF_SDH_BLE_TOTAL_LINK_COUNT' undeclared here (not in a function); did you mean 'NRF_BLE_GATT_LINK_COUNT

and

error: 'BLE_NUS_BLE_OBSERVER_PRIO' undeclared here (not in a function); did you mean 'APP_BLE_OBSERVER_PRIO'?

and so on...

I tried to add codes into the sdk_config.c to eliminate the errors. But it seems that this is not the correct way.

Could you please help me?

Thank you,

Sama

Parents
  • Hi Sama,

    There are two possible issue while merging two sample projects.

    1. sdk_config.h flags are not present or enable

    - Try to compare the sdk_config.h files of both the projects and add the missing flags. Once compared and updated all the configurations from ble-app-uart example into the saadc example check if errors are reduced.

    2. Library path is not added into build configuration

    - Fir that compare library paths and add if absent

     In my experience it is always easy to add code from peripheral examples into ble examples. If nothing is working try to add code from saadc example into ble-app-uart example, very less configuration is required in project to add peripherals.

    Regards

  • Yes, I highly agree. Merging the peripheral examples into the BLE examples is the recommended approach. Also if you're looking for an example that includes ble_app_uart and SAADC then you can find it here.

Reply Children
  • Hi,

    Thank you for your reply.

    I have to do this on my own and I want to learn how to modify different examples.

    Thanks,

    Sama

  • Hi,

    I have compared the example you suggested with my codes.

    I found out that this example uses app_timer instead on app_timer2 (used in the ble_app_uart from sdk17.2). After editing the ble_app_uart from sdk17.2 based on the example, it works. Actually it seems that the problem is with app_timer2, drv_rtc and sortlist.c files. It is also necessary to remove app_timer2 from preprocessor definition and to do some modifications in the sdk_config as well.

    Anyway, I would like to know the difference between app_timer and app_timer2?

    In addition, I want to use a timer in my codes, along with ble_app_uart and saadc example.

    Which timer can I use?

    I am facing with problems in using timers. I used timer 2 and 4 (as timer0 is used by SoftDevice and timer3 is used by adc) in my code, but every time I run the program, it gets stuck.

    any idea?

    Br,

    Sama

Related