vscode rt-thread插件编译结果如下
其生成的.bin .elf文件均下载到板子后均无法正常运行
rt-thread studio IDE 编译结果如下
下载到板子后,能正常运行调试
想知道为什么,该怎么解决。。。。。。
问题解决:
需修改rtconfig.py编译参数
旧参数:
DEVICE = ‘ -mcpu=cortex-m4 -mthumb -ffunction-sections -fdata-sections’
CFLAGS = DEVICE + ‘ -Dgcc’
CFLAGS += ‘ -O0 -gdwarf-2 -g’
CXXFLAGS = CFLAGS
AFLAGS = ‘ -c’ + DEVICE + ‘ -x assembler-with-cpp -Wa,-mimplicit-it=thumb ‘
AFLAGS += ‘ -gdwarf-2’
POST_ACTION = OBJCPY + ‘ -O binary $TARGET rtthread.bin\n’ + SIZE + ‘ $TARGET \n’
新参数:需增加 LFLAGS = DEVICE + ‘ -Wl,—gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T linkscripts//STM32F407VG//link.lds’
DEVICE = ‘ -mcpu=cortex-m4 -mthumb -ffunction-sections -fdata-sections’
CFLAGS = DEVICE + ‘ -Dgcc’
CFLAGS += ‘ -O0 -gdwarf-2 -g’
CXXFLAGS = CFLAGS
AFLAGS = ‘ -c’ + DEVICE + ‘ -x assembler-with-cpp -Wa,-mimplicit-it=thumb ‘
LFLAGS = DEVICE + ‘ -Wl,—gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T linkscripts//STM32F407VG//link.lds’
AFLAGS += ‘ -gdwarf-2’
POST_ACTION = OBJCPY + ‘ -O binary $TARGET rtthread.bin\n’ + SIZE + ‘ —format=berkeley’ + ‘ $TARGET \n’
—format=berkeley
我在VSCODE插件增加了—format=berkeley依然不行。。。