lpc43: FLASH_BANK=B links into flash bank B; hfp runs lpcxpresso43s67 from it
The hfp rig's lpcxpresso43s67 executes corrupted instruction fetches from flash bank A:
one bit of a fetched halfword reads 0 (push {r4-r9,lr} run as push {r4,r5,r7-r9,lr},
mov r0,r6 run as mov r0,r2), giving the random HardFaults and silent stalls behind its
1-4 failed examples per HIL run. A USB-free stress firmware reproduces it at ~1 error/s
from bank A, and finds none in RAM or in bank B over millions of iterations; J-Link also
fails verifying bank A sector 0. CI reflashes that sector for every example, well past
the 10k-cycle endurance.
- hw/bsp/lpc43: FLASH_BANK=A|B (CMake and Make, default A, byte-identical to before).
The board linker scripts place code through REGION_ALIAS("FlashCode") from
linker/flash_bank_<A|B>/lpc43_flash_bank.ld (GNU ld and lld via -L); IAR gets
linker/lpc43xx_iflash_bank_b.icf.
- tools/lpc_vector_checksum.py patches the boot checksum (vector word 7) into bank-B
images: J-Link patches it at bank A only. It refuses an address that holds no vector
table. Run as a CMake POST_BUILD step and the new make POST_LINK hook;
.DELETE_ON_ERROR keeps a failed hook from leaving an unpatched ELF up to date.
- The boot ROM boots bank B only while bank A holds no valid image (UM10503 5.3.1), and
any bank-A load makes it valid again. The jlink flasher takes an opt-in roster
"erase" list of ranges erased before every load, and refuses an image that loads
into one (a stale bank-A build would re-validate the bank).
- test/hil/hfp.json: lpcxpresso43s67 builds with FLASH_BANK=B and erases bank A
sector 0 before each load.
- tools/change_impact.py rule 16c: a tools/ script a family.cmake runs selects that
family's builds and boards.
Verified on the rig: hfp suite 14/14 with usbtest 30/30 on gcc (5 runs) and IAR bank-B
builds, including the run after a bank-A image re-validated bank A; clang/lld bank-B
board_test and usbtest build and boot; all 43 examples build for gcc and IAR with
FLASH_BANK=B; code size for the default build 43/43 unchanged.
17 files changed