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

  • Hello Henry,

    Thank you for your reply.

    I will try it and inform you about that.

    Sama

  • Update:

    I comment out the line (sleep_mode_enter()), but this does not make any difference.

    It is disappointing that it is so hard to find the error.

    Br,

    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

  • Hi,

    Sama said:

    But this does not make any difference as you can see.

    When I select the first line in the active call frame on the top page as below

     Does it reach the breakpoint at log_init()? Earlier you wrote that it calls the error handler from ble_stack_init(). Exactly from where in ble_stack_init() is it called from?

    regards

    Jared

Related