SEGGER编译Nordic nRF示例问题

环境: SEGGER Embedded Studio for ARM v7.10nRF5 SDK 17.1.0

使用SEGGER编译示例ble_app_uart,出现一下问题及相应的解决思路:

问题1: retarget.c:101:23: error: unknown type name ‘__printf_tag_ptr’

修改retarget.c:99

#if defined(__SES_VERSION) && (__SES_VERSION >= 34000)

#if defined(__SES_VERSION) && (__SES_VERSION >= 34000) && !defined(__SEGGER_RTL_VERSION)

 

问题2:  “.text is larger than specified size” and “.rodata is larger than specified size”

在项目目录下找到flash_placement.xml” 找到两行
<ProgramSection alignment=”4″ load=”Yes” name=”.text” sizeof=”0x4″/>    <ProgramSection alignment=”4″ load=”Yes” name=”.rodata” sizeof=”0x4″ />

将上面的sizeof=”0x4″ 删除

 

问题3: libc_v7em_fpv4_sp_d16_hard_t_le_eabi_balanced.a(fileops.o): in function `putchar’:”

修改”Library I/O” (under Project options >> Code >> Library) from “None” to “RTT”