在stm32cubeide上编译rt-thread

rt-thread用scons可以直接用arm-none-eabi-编译,调试用gdb命令行界面,还是有点像苦行僧,虽然有gdbgui这样的工具,但没有用过,不太清楚。于是乎在stm32cubeide上尝试将其编译。

1. 用stm32cubeide生成了一个stm32f407vg(stm32f407g-disc1板子),主要是要使用其中的编译参数,而不用自己去摸索。

2. 在stm32cubeide工程中删除生成的代码,将rt-thread的文件复制到对应工程中,将bsp下不需要的文件都删除,只保留对应板子的文件,避免后面编译时一大堆出错

3. rt-thread自带有keil的工程,按keil的工程配置include目录

4. 编译,在项目设置的"MCU GCC Compiler" preprocessor 中增加"RTLIBC_H__"预定义,避免重复定义

在"MCU GCC Assembler" Miscellaneous 中增加Option "-Wa,-mimplicit-it=thumb" 否则在编译context_gcc.S时会报如下错误

../libcpu/arm/cortex-m4/context_gcc.S: Assembler messages:
../libcpu/arm/cortex-m4/context_gcc.S:110: Error: thumb conditional instruction should be in IT block -- `vstmdbeq r1!,{d8-d15}'
../libcpu/arm/cortex-m4/context_gcc.S:119: Error: thumb conditional instruction should be in IT block -- `mov

你可能感兴趣的:(在stm32cubeide上编译rt-thread)