今天在编译nrf52840的时候出现下面的错误
.\_build\nrf52840_xxaa.axf: Error: L6915E: Library reports error: __use_no_semihosting was requested, but a semihosting fputc was linked in
把printf()的函数去掉编译,就没问题了 ,但printf()是需要的
解决办法:1、如果工程里没有包含retarget.c文件,则添加此文件
2、在SDK_CONFIG.H文件里添加宏
// <q> RETARGET_ENABLED - retarget - Retargeting stdio functions
#ifndef RETARGET_ENABLED
#define RETARGET_ENABLED 1
#endif
再编译就没问题了。