27,508
社区成员




Criterion for valid user code
The reserved Cortex-M 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.
If the signature is not valid, the auto-baud routine synchronizes with the host via serial port 0
or boots from the USB port (PIO0_3 is sampled high).
Due to the CPU requirements winIDEA extracts the necessary interrupt vectors from the
download file before programming a 32-bit value to the 0x1C address, makes the 2’s
complement of the check-sum of these vectors and programs the calculated value to the
0x1C address. This yields the CPU starting from the user code after the reset.
Consequentially when ‘Verify download’ is configured it’s executed after the debug download
and the user would normally get error at address 0x1C since the programmed value doesn’t
match with the one in the download file. The user can ignore this error or adjust his download
file in a way that a 32-bit value at the address 0x1C contains proper value, which results in
the CPU start executing the user code after the reset. The alternative is also to skip verifying
4 bytes at address 0x1C. Below picture shows the necessary setting in the Download dialog.