|
发表于 2013-10-22 12:05:43
|
显示全部楼层
本帖最后由 magicoe 于 2013-10-22 12:07 编辑
ST_ATMEL_NXP 发表于 2013-10-22 11:38
为何有这个效验码?这和LPC1788的有很区别吗?这块不是很明白!还望指点一下! ...
LPC1800 UM里的原话
The reserved Cortex-M3 exception vector location 7 (offset 0x 001C in the vector table)
should contain the 2’s complement of the check-sum of table entries 0 through 6. This
causes the checksum of the first 8 table entries to be 0. The boot loader code checksums
the first 8 locations in sector 0 of the flash. If the result is 0, then execution control is
transferred to the user code.
周立功LPC176x的翻译(1)有效用户代码的判定标准
有效用户代码的判定标准:保留的 Cortex-M3 向量单元(除向量单元 7以外,位于向量表
0x001C)应当包含表入口 0~6 的校验和的 2 的补码,这样就使前 8 个表入口的校验和为 0。Boot
代码首先计算 Flash 扇区 0 中前8个中断向量的校验和。如果结果为 0,执行控制权便转移给用
户代码。
JTAG/SWD仿真的时候其实是会单刀直入Main的,他已经控制了内核,我们内部ROM是不会做校验动作的。实际的上电过程中,ROM里的程序会对Flash中的程序校验,看看是否合法,合法再动作,不合法就不干活了。如果KEIL的版本较老的话,编译后一般都不会把校验和写进烧录文件的。 |
|