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

Using BLE with FreeRTOS

Hello,

I need an application with a Bluetooth stack and FreeRTOS to handle different tasks (like button reading, sensor reading, ADC, etc.). So I try to implement the BLE template from the SDK into my project:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdbool.h>
#include <stdint.h>
#include "nrf.h"
#include "nrf_delay.h"
#include "nrf_drv_spi.h"
#include "nrf_drv_twi.h"
#include "nrf_drv_clock.h"
#include "nrf_sdh.h"
#include "nrf_sdh_soc.h"
#include "nrf_sdh_ble.h"
#include "nrf_ble_gatt.h"
#include "nrf_ble_qwr.h"
#include "nrf_pwr_mgmt.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#include "ble.h"
#include "ble_hci.h"
#include "ble_srv_common.h"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

But I got this error messages:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Building ‘Project’ from solution ‘Trackeffekt’ in configuration ‘Release’
Compiling ‘main.c’
Linking Project.elf
Output/Project Release/Obj/app_timer2.o: in function `get_now':
undefined reference to `drv_rtc_counter_get'
Output/Project Release/Obj/app_timer2.o: in function `app_timer_init':
undefined reference to `drv_rtc_init'
G:\Freelancing\Project\firmware\nordic\components\libraries\timer/app_timer2.c:543: undefined reference to `drv_rtc_overflow_enable'
G:\Freelancing\Project\firmware\nordic\components\libraries\timer/app_timer2.c:544: undefined reference to `drv_rtc_compare_set'
Output/Project Release/Obj/app_timer2.o: in function `app_timer_cnt_get':
undefined reference to `drv_rtc_counter_get'
Output/Project Release/Obj/app_timer2.o: in function `rtc_irq':
undefined reference to `drv_rtc_overflow_pending'
G:\Freelancing\Project\firmware\nordic\components\libraries\timer/app_timer2.c:463: undefined reference to `drv_rtc_compare_pending'
G:\Freelancing\Project\firmware\nordic\components\libraries\timer/app_timer2.c:467: undefined reference to `drv_rtc_compare_pending'
Output/Project Release/Obj/app_timer2.o: in function `rtc_schedule':
undefined reference to `drv_rtc_windowed_compare_set'
Output/Project Release/Obj/app_timer2.o: in function `rtc_update':
undefined reference to `drv_rtc_start'
Output/Project Release/Obj/app_timer2.o: in function `rtc_schedule':
undefined reference to `drv_rtc_compare_disable'
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

What is the problem with this code and how can I fix this?