上次谈到由于stm32官方库和iar ew arm 的不断升级, 多出配置都发生了 变化,
1在使用 ewarm 6.30 升级stm32 stdlib 3.5 出现了这个错误
Error(Pe47) declaration is incompatible with "__interwork__softfp unsigned long __get_PSP(void)",
”declaration “ 说明有文件中定义冲突。
查了一下,IAR自己带了CMSIS的库文件,而我们本地工程下也有CMSIS,
因此我们选择IAR自带的就没有问题了。
步骤如下:
Please follow the following steps:
under project options: 1- on the "General Options" option in the "Library Configuration" tab check the checkbox “Use CMSIS” 2- on the "C/C++ Compiler" option in the "Preprocessor" tab remove the include directory of CM3 "$PROJ_DIR$\..\..\Libraries\CMSIS\CM3\CoreSupport" |
具体操作可以参考这份文档,
http://pan.baidu.com/share/link?shareid=1418960730&uk=120859721
2 stm32 库里的 printf 报错
错误 : FILE is undefined
FILE 是stdio.h 里的,所以查看这个文件
#if _DLIB_FILE_DESCRIPTOR
typedef _Filet FILE;
#endif /* _DLIB_FILE_DESCRIPTOR */
要用FILE先要开 _DLIB_FILE_DESCRIPTOR
查了一下
stdio.h中
/* Module consistency. */
#pragma rtmodel="__dlib_file_descriptor",_STRINGIFY(_DLIB_FILE_DESCRIPTOR)
再查到DLib_Defaults.h
#ifndef _DLIB_FILE_DESCRIPTOR
#define _DLIB_FILE_DESCRIPTOR 0
#endif
把0 改为1 就可以了,先去除只读属性。