由于RT-Thread自动切换芯片版本,会导致部分配置丢失,所以现决定手动切换芯片版本,步骤如下(以32RE修改为32RC为例):
./settings/projcfg.ini
修改芯片名称
-chip_name=STM32F103RE
+chip_name=STM32F103RC
./drivers/board.h
修改芯片名称及RAM、ROM大小
- #define CHIP_NAME_STM32F103RE
+ #define CHIP_NAME_STM32F103RC
/*-------------------------- CHIP CONFIG END --------------------------*/
/*-------------------------- ROM/RAM CONFIG BEGIN --------------------------*/
#define ROM_START ((uint32_t)0x08000000)
-#define ROM_SIZE (512 * 1024)
+#define ROM_SIZE (256 * 1024)
#define ROM_END ((uint32_t)(ROM_START + ROM_SIZE))
#define RAM_START (0x20000000)
-#define RAM_SIZE (64 * 1024)
+#define RAM_SIZE (48 * 1024)
#define RAM_END (RAM_START + RAM_SIZE)
./rtconfig.py
修改链接脚本
- LFLAGS = '-T linkscripts//STM32F103RE//link.lds'
+ LFLAGS = '-T linkscripts//STM32F103RC//link.lds'
打开构建配置
修改链接脚本