环境搭建:
开发软件:keil for ARM V5.29
SDK:Nordic nRF5_SDK_16.0.0_98a08e2
Keil安装完成之后会提示缺少必要的设备依赖包主要有以下几个:
1:CMSIS.4.5.0
http://www.keil.com/pack/ARM.CMSIS.4.5.0.pack
2:NordicSemiconductor::nRF_DeviceFamilyPack.8.27.1
http://developer.nordicsemi.com/nRF5_SDK/pieces/nRF_DeviceFamilyPack/NordicSemiconductor.nRF_DeviceFamilyPack.8.27.1.pack
3:NordicSemiconductor::nRF_DeviceFamilyPack_NordicLicense.8.27.0
http://developer.nordicsemi.com/nRF5_SDK/pieces/nRF_DeviceFamilyPack/NordicSemiconductor.nRF_DeviceFamilyPack_NordicLicense.8.27.0.pack
4:NordicSemiconductor::nRF_DeviceFamilyPack.8.17.0
http://developer.nordicsemi.com/nRF5_SDK/pieces/nRF_DeviceFamilyPack/NordicSemiconductor.nRF_DeviceFamilyPack.8.17.0.pack
注意:
SDK16.0.0版本不要安装NordicSemiconductor::nRF_DeviceFamilyPack.8.29.0否则编译会报如下错误:
compiling system_nrf52840.c...
RTE\Device\nRF52840_xxAA\system_nrf52840.c(29): error: #5: cannot open source input file "nrf_erratas.h": No such file or directory
#include "nrf_erratas.h"
RTE\Device\nRF52840_xxAA\system_nrf52840.c: 0 warnings, 1 error
".\_build\nrf52840_xxaa.axf" - 1 Error(s), 0 Warning(s).
Target not created.
如果不小心安装了NordicSemiconductor::nRF_DeviceFamilyPack.8.29.0,解决以上错误的方法为替换工程目录下的system_nrf52840.c文件。例如使modules / nrfx / mdk / system_nrf52840.c替换
examples/ble_peripheral/ble_app_uart/pca10056/s140/arm5_no_packs/RTE/Device/nRF52840_xxAA/system_nrf52840.c