打算在CYPD3196上把printf重定向到SW_TX_UART进行调试。
#include<stdio.h>以后调用printf()会出现以下错误:
d:/program files (x86)/cypress/psoc creator/4.2/psoc creator/import/gnu/arm/5.4.1/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv6-m\libg_nano.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'
collect2.exe: error: ld returned 1 exit status
The command 'arm-none-eabi-gcc.exe' failed with exit code '1'.
网上有说是底层库某些库函数没有实现导致,网上也看到有人可以正常使用printf():
这位仁兄设置可以用printf
此问题该如何解决?
|