keil armcc这编译,elf运行不正常(突然崩溃、停在HardFault_Handler (void)),照着VSM Studio改了改编译选项似乎还是不行
还是用gcc编译出elf正常
--c99 -c --cpu Cortex-M3 -D__EVAL -g -O0 --apcs=interwork --split_sections
-I ......
-D__UVISION_VERSION='518' -D_RTE_ -DUSE_HAL_DRIVER -DSTM32F103x6 -o 'jiaotongdeng*.o' --omf_browse 'jiaotongdeng*.crf' --depend 'jiaotongdeng*.d'
armcc.exe --cpu=cortex-m3 --thumb -I.. -I../../../../../../../../../Keil_v5/ARM/CMSIS/Include -g '../main.c' -c -o 'main.o'
似乎的确跟编译器版本有一定关系
反正就是自带的VSM Studio的编译器和选项,一般还是没问题的,别的IDE(keil什么的)的编译器和选项,就可能有问题
(C:yagarto-20121222 自带的gcc是这个东西,问题是这东西编译起来也有点问题,我把stm32cubeide的tool chain换了个gcc-arm-embedded 2014q2,但是吧,编译出来看着是没问题(仔细看了看,可能是ld文件有点语法不支持),到proteus上运行就会死循环HardFault_Handler()
同样的选项用最新版armgcc就能运行(就是局部变量地址经常有问题。。。))
此外,还有一点比较坑,就是proteus自带的yagarto gcc,编译自带的stm32代码,居然都会报错,我也是醉了。。。改了一下代码里的static inline,才能跑
总而言之,用armgcc,有些bug,但是可以用,不是正版用户,也不能要求太高
还有就是那个官方支持论坛,updates and fixes区域http://support.labcenter.co.uk/forums/viewforum.php?f=12,也是只有正版验证用户才能看
< 1><0x00000a4b> DW_TAG_subprogram
DW_AT_external yes(1)
DW_AT_name main
DW_AT_decl_file 0x00000001 C:/Users//STM32CubeIDE/workspace_1.8.0/proj4/Debug/../Core/Src/main.c
DW_AT_decl_line 0x00000044
DW_AT_decl_column 0x00000005
DW_AT_prototyped yes(1)
DW_AT_type <0x000001be>
DW_AT_low_pc 0x08000250
DW_AT_high_pc 0x08000308
DW_AT_frame_base [ 0]< offset pair low-off : 0x08000250 addr 0x08000250 high-off 0x08000252 addr 0x08000252>DW_OP_breg13+0 [ 1]< offset pair low-off : 0x08000252 addr 0x08000252 high-off 0x08000254 addr 0x08000254>DW_OP_breg13+8 [ 2]< offset pair low-off : 0x08000254 addr 0x08000254 high-off 0x08000256 addr 0x08000256>DW_OP_breg13+32 [ 3]< offset pair low-off : 0x08000256 addr 0x08000256 high-off 0x08000308 addr 0x08000308>DW_OP_breg7+32 DW_AT_frame_base为r7+0d32 r7:2000 27E0 +0d32/0x20 后为2000 2800 < 3><0x00000ab3> DW_TAG_variable DW_AT_name shi1 DW_AT_decl_file 0x00000001 C:/Users//STM32CubeIDE/workspace_1.8.0/proj4/Debug/../Core/Src/main.c DW_AT_decl_line 0x0000006d DW_AT_decl_column 0x00000007 DW_AT_type <0x000001be> DW_AT_location DW_OP_fbreg -20 这里说明shi1这个int变量在内存中的位置为DW_OP_fbreg -0d20,即DW_AT_frame_base -0d20,即2000 2800-0d20=2800 27EC 经验证,2800 27EC这个地址是对的,的确是int shi1这个变量的内容,那么问题就确定,出在proteus对于dwarf的解析上了。。。 8.9/8.12换到8.13版本后,变量地址和反汇编代码出现两段重复 问题修复了,但是源代码断点断不下来了,要反汇编断点 另外一些改进: 可以自动检测.c源文件了,不需要跟.pdsprj同一目录了 可以看函数调用栈了 仿真开启更快了,13以前的版本开启的挺慢 (多个版本不能共存,虽然新版本可以安在另一个文件夹,保留旧版本,但是具体可能有一些覆盖,导致运行中报错) 又发现一个很坑的问题: 如果用外部的elf文件的话,必须得先点Source Code,然后点Project,然后Delete掉proteus自己的Project,它才会自动检测.pdsprj文件附近的.c文件,在调试界面显示出来 双击芯片后 元件属性里这个 Crystal Frequency: 应该是控制HSI,高速内部时钟,72MHz Wire labels may only be assigned via the Property Assignment Tool when it is used in On Click mode. This is because there is no way for ISIS to determine where a wire label should be placed on a tagged wire, unless you mark the position with the mouse. 根据这个说法,比较可惜,没法通过替换,来修改Wire labels的名字,只能一个个click了 而且 action中的RENAME The string should contain both a property assignment of the form: current_keyword=new_keyword The name to the left of the assignment is the existing property name you wish to rename; the name to the right is the new name you wish to rename it to. Only user properties can be renamed.(所以只有user properties可以重命名)(懂了,这个是重命名keyword的,并不能重命名value,value还是得用assign) You can place more than one label on a wire. If you wish them all to have the same name, and for all of them to update automatically whenever any of the names are changed, the click the Auto-Sync checkbox. 多个标签都得手动勾选上,才能同步,但是实际上我并没有看出来这个功能有什么用。。
上一篇:STM32结合ESP8266初始准备
下一篇:STM32学习(三)串口实验
推荐阅读最新更新时间:2026-03-25 11:41
- 用于 7VIN 至 16VIN、1.5V 和 1.2V 输出的 LTM4628EV DC/DC 模块稳压器的典型应用电路
- 使用 Analog Devices 的 LTC3728LIGN 的参考设计
- DER-406 - 适用于 A19 灯的 5.76 W 高 PF 非隔离降压-升压型 TRIAC 调光 LED 驱动器
- ADR5045B 5V 输出精密微功率并联模式电压基准的典型应用
- LT3970EDDB-3.42 2.5V 降压转换器的典型应用
- MC78M08BDTG 8V 电流调节器的典型应用
- LT1021DCN8-5 精密电压基准的典型应用
- DER-282 - 100W, 扁平(11 mm), LLC DC-DC转换器
- REF193 低压差开尔文连接电压基准的典型应用电路
- LT3088EM 线性稳压器用于添加软启动的典型应用

stm32驱动屏IC rm68042
《无线电入门与晶体管收音机》
现代雷达系统的信号设计
BFR340T






京公网安备 11010802033920号