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

Enabling softdevice with freertos

Hello,

  Currently, I am using NRF52832 and nRF5_SDK_15.2.0. Also, I am using FreeRTOS.

  

   I disabled softdevice by calling nrf_sdh_disable_request() before goes to sleep mode.

   I like to enable softdevice after wake up from sleep mode.

   I tried to configure softdevice again refer to ble_app_gzll example.

   But, Because of FreeRTOS is used, there is issue on timer related code in ble_conn_params_init().

   My problem is All RTCs are already occupied( RTC0-> softdevcie, RTC1-> FreeRTOS, RTC2-> time tracking).

   I can't replace timer for app_timer from FreeRTOS timer to RTC.

   I have no idea how to handle that situation.

  Do you have any example for this? or Could you help me out to resolve this situation?

  Thanks in advance.

Thanks,

  Chongchun Moon

  • Hi Moon,

    you should not use app_timer.c when using freertos. Instead you should use app_timer_freertos.c (the header file is the same for both, app_timer.h)

    app_timer_freertos.c does not use RTC, but instead uses the internal timer features of the RTOS itself. So you have no problem using that.

  • Yes, I use app_timer_freertos.c

    Is there any reference to enable and disable softdevice when FreeRTOS is used?

    Or Could you tell me proper way to enable and disable softdevice with FreeRTOS?

    Thanks,

      Chongchun Moon 

  • Hello,

      I like to change the direction. Because, It looks possible to archive sleep mode without disable softdevice.

      But, I met another issue. So I will start conversation in other thread. 

    Thanks for support.

  • So to use app_timer_freertos.c what should I do? I have already disabled APP_TIMER but getting the following errors:

    "Building ‘ble_app_uart_pca10040_s132’ from solution ‘ble_app_uart_pca10040_s132’ in configuration ‘Release’
    Linking ble_app_uart_pca10040_s132.elf
    "C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 3.52a/gcc/arm-none-eabi/bin/ld" -X --omagic -eReset_Handler --defsym=__vfprintf=__vfprintf_long --defsym=__vfscanf=__vfscanf_long -EL --gc-sections "-TD:/nRF5_SDK_15.3.0_59ac345/examples/ble_peripheral/ble_app_uart/pca10040/s132/ses/Output/ble_app_uart_pca10040_s132 Release/Obj/ble_app_uart_pca10040_s132.ld" -Map Output/Release/Exe/ble_app_uart_pca10040_s132.map -u_vectors -o Output/Release/Exe/ble_app_uart_pca10040_s132.elf --emit-relocs "@D:/nRF5_SDK_15.3.0_59ac345/examples/ble_peripheral/ble_app_uart/pca10040/s132/ses/Output/ble_app_uart_pca10040_s132 Release/Obj/ble_app_uart_pca10040_s132.ind"
    Output/ble_app_uart_pca10040_s132 Release/Obj/app_button.o: In function `gpiote_event_handler':
    undefined reference to `app_timer_stop'
    undefined reference to `app_timer_start'
    Output/ble_app_uart_pca10040_s132 Release/Obj/app_button.o: In function `app_button_init':
    undefined reference to `app_timer_create'
    Output/ble_app_uart_pca10040_s132 Release/Obj/bsp.o: In function `bsp_button_event_handler':
    undefined reference to `app_timer_start'
    undefined reference to `app_timer_stop'
    Output/ble_app_uart_pca10040_s132 Release/Obj/bsp.o: In function `bsp_led_indication':
    undefined reference to `app_timer_stop'
    undefined reference to `app_timer_stop'
    undefined reference to `app_timer_start'
    undefined reference to `app_timer_start'
    Output/ble_app_uart_pca10040_s132 Release/Obj/bsp.o: In function `bsp_init':
    undefined reference to `app_timer_create'
    undefined reference to `app_timer_create'
    undefined reference to `app_timer_create'
    Output/ble_app_uart_pca10040_s132 Release/Obj/main.o: In function `saadc_sampling_event_init':
    undefined reference to `nrfx_timer_init'
    undefined reference to `nrfx_timer_extended_compare'
    undefined reference to `nrfx_timer_enable'
    undefined reference to `nrf_drv_saadc_task_address_get'
    Output/ble_app_uart_pca10040_s132 Release/Obj/main.o: In function `timers_init':
    undefined reference to `app_timer_init'
    Output/ble_app_uart_pca10040_s132 Release/Obj/ble_conn_params.o: In function `conn_params_negotiation':
    undefined reference to `app_timer_start'
    Output/ble_app_uart_pca10040_s132 Release/Obj/ble_conn_params.o: In function `on_write':
    undefined reference to `app_timer_stop'
    Output/ble_app_uart_pca10040_s132 Release/Obj/ble_conn_params.o: In function `on_disconnect':
    undefined reference to `app_timer_stop'
    Output/ble_app_uart_pca10040_s132 Release/Obj/ble_conn_params.o: In function `ble_conn_params_init':
    undefined reference to `app_timer_create'
    Build failed, 

    So please tell me how to use app_timer_freertos.c in this situation. And also how to solve nrfx_timer error.

Related