测试ble_app_uart例程可以正常使用
..\nRF5SDK160098a08e2\examples\ble_peripheral\ble_app_uart\pca10040\s132\arm5_no_packs
参考usbd_ble_uart_freertos例程
..\nRF5SDK160098a08e2\examples\peripheral\usbd_ble_uart_freertos\pca10056\s140\arm5_no_packs
头文件路径
..\..\..\..\..\..\external\freertos\config
..\..\..\..\..\..\external\freertos\portable\ARM\nrf52
..\..\..\..\..\..\external\freertos\portable\CMSIS\nrf52
..\..\..\..\..\..\external\freertos\source\include
..\..\..\config
添加文件
..\..\..\..\..\..\external\freertos\source\croutine.c
..\..\..\..\..\..\external\freertos\source\event_groups.c
..\..\..\..\..\..\external\freertos\source\portable\MemMang\heap_1.c
..\..\..\..\..\..\external\freertos\source\list.c
..\..\..\..\..\..\external\freertos\portable\ARM\nrf52\port.c
..\..\..\..\..\..\external\freertos\portable\CMSIS\nrf52\port_cmsis.c
..\..\..\..\..\..\external\freertos\portable\CMSIS\nrf52\port_cmsis_systick.c
..\..\..\..\..\..\external\freertos\source\queue.c
..\..\..\..\..\..\external\freertos\source\stream_buffer.c
..\..\..\..\..\..\external\freertos\source\tasks.c
..\..\..\..\..\..\external\freertos\source\timers.c
nRF_SoftDevice里面添加
..\..\..\..\..\..\components\softdevice\common\nrf_sdh_freertos.c
nRF_Libraries里面去掉
app_scheduler.c
app_timer2.c
drv_rtc.c
nrf_sortlist.c
nRF_Libraries里面添加
..\..\..\..\..\..\components\libraries\timer\app_timer_freertos.c
添加配置头文件
..\nRF5SDK160098a08e2\examples\ble_peripheral\ble_app_uart\config\ FreeRTOSConfig.h
工程配置里面添加宏
FREERTOS
在main.c添加头文件
#include "nrf_drv_clock.h"
#include "FreeRTOS.h"
#include "task.h"
#include "nrf_sdh_freertos.h"
#include "semphr.h"
添加SystemView
拷贝C:\Program Files\SEGGER\SystemView\Src下面的文件到systemview文件夹,然后放在.. \examples\ble_peripheral\ble_app_uart下面
..\..\..\systemview\SEGGER\SEGGER_SYSVIEW.c
..\..\..\systemview\Sample\FreeRTOSV10\SEGGER_SYSVIEW_FreeRTOS.c
..\..\..\systemview\Sample\FreeRTOSV10\Config\Cortex-M\SEGGER_SYSVIEW_Config_FreeRTOS.c
包含头文件路径
..\..\..\systemview\Config
..\..\..\systemview\Sample\FreeRTOSV10
..\..\..\systemview\SEGGER
错误
.\_build\nrf52832_xxaa.axf: Error: L6200E: Symbol SWI2_EGU2_IRQHandler multiply defined (by nrf_sdh_freertos.o and nrf_sdh.o).
修改sdk_config.h
从NRF_SDH_DISPATCH_MODEL_INTERRUPT改为NRF_SDH_DISPATCH_MODEL_POLLING
错误
.\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol vApplicationIdleHook (referred from tasks.o).
搜索关键字john_rtos对应修改main.c
可以正常广播和闪烁LED2,LED1是广播灯,打包ble_app_uart_freertos.7z
EventRecorder使用
#include "eventrecorder.h"
/* 初始化 EventRecorder 并开启 */
EventRecorderInitialize(EventRecordAll, 1U);
EventRecorderStart();