最近将一个IAR下的M4的程序移植到M7上,移植之前M4的程序因为没有硬件没有验证过,当修改为所有的参数,编译都正确后仿真时,在下载过程中报了好多的警告——地址数据校验错误,错误如下:
Thu Jan 24, 2019 07:33:44: Verify error at address 0x000080D1, target byte: 0x40, byte in file: 0x30
Thu Jan 24, 2019 07:33:44: Warning:
Thu Jan 24, 2019 07:33:44: Verify error at address 0x000080D2, target byte: 0x00, byte in file: 0xDF
Thu Jan 24, 2019 07:33:44: Warning:
Thu Jan 24, 2019 07:33:44: Verify error at address 0x000080D3, target byte: 0x80, byte in file: 0xF8
Thu Jan 24, 2019 07:33:44: Warning: Too many verify errors, only the first 200 are displayed
Thu Jan 24, 2019 07:34:13: Warning: There were warnings during download, see Log Window
Thu Jan 24, 2019 07:34:13: Loaded debugee: D:\Test\pri\iar\STM32746G-EVAL2\Exe\OS3.out
Thu Jan 24, 2019 07:34:13: Hardware reset with strategy 0 was performed
Thu Jan 24, 2019 07:34:13: Target reset
Thu Jan 24, 2019 07:34:14: Failed to enable illegal breakpoint definition '{D:\Test\pri\app_main.c}.211.5'
Thu Jan 24, 2019 07:34:14: Failed to enable illegal breakpoint definition '{D:\Test\pri\app_main.c}.180.5'
Thu Jan 24, 2019 07:34:14: Failed to enable illegal breakpoint definition '{D:\Test\pri\IAR\os_cpu_a.asm}.188.1'
Thu Jan 24, 2019 07:34:14: One or more breakpoints could not be set and have been disabled.
Thu Jan 24, 2019 07:34:43: There were 2 warnings during the initialization of the debugging session.
Thu Jan 24, 2019 07:36:00: HardFault exception.
Thu Jan 24, 2019 07:36:00: The processor has escalated a configurable-priority exception to HardFault.
Thu Jan 24, 2019 07:36:00: A bus fault has occurred on an instruction prefetch.
Thu Jan 24, 2019 07:36:00:
Thu Jan 24, 2019 07:36:00: Exception occured at: 0x0
Thu Jan 24, 2019 07:36:00:
Thu Jan 24, 2019 07:36:00: See the call stack for more information.
然后IAR就报错:
一开始还以为没问题,点击OK继续执行,结果是程序直接跑飞了:
卡在了某个位置。然后问度娘,大概的意思是工程的配置不对,但是试了几个方法都没有凑效。于是自己使用STM32CubeMx新建了一个可以运行的工程,然后比较工程配置,最终发现是因为options->linker->config下的linker configuration file没设置flash的icf文件导致的,见下图:
选择正确的flash的icf后程序运行正常。
|
就喜欢楼主这样有始有终说的明明白白的