Open hathach opened 2 years ago
Could this be due to an incorrect address in the IVT? Seems like it should be patched when written to flash. The addresses used in RAM won't work when loaded from flash. In particular, the reset handler will run from flash because it loads everything into ram.
There is a recent pr fixed by other users to tinyusb that fixes the 1024 issue. I will pull out and check this later next week when I get back from vacation.
TinyUF2 only writes itself to flash under certain conditions (from board_flash.c):
// TinyUF2 will copy its image to flash if one of conditions meets:
// - Boot Mode is '01' i.e Serial Download Mode (BootRom)
// - Flash FCFB is invalid e.g blank flash
// - Flash contents does not match running tinyuf2 in SRAM (depending on COMPARE_AND_WRITE_TINYUF2)
Here are four ways to force it to load:
I think I got TinyUF2 writing to flash ok.
What I don't understand is that the RAM version is linked to run from the address range of RAM. How does that work when loading/running from flash?
One of the entries in the IVT is for the boot data structure. The boot data includes the start address and image length. The ROM reads the boot header, and if the start address is in RAM, it copies the image to RAM.
The IVT and boot data structures are in flash_config.c The definition for BOARD_BOOT_START is in boards.h
@gsteiert Any pointers to where this is documented? How does the RAM address need to relate to the flash address? Does the start of the image start with the boot data?
See the program image section of the reference manual (9.7 in RT1010) The i.MX RT Flashloader Use Case app note also has some additional information: https://www.nxp.com/docs/en/nxp/application-notes/AN12238.pdf
Operating System
Linux
INFO_UF2.TXT
TinyUF2 Bootloader 0.10.2-21-g71a89e4-dirty - nxp/mcux-sdk (MCUX_2.10.0-25-ga242602a) tinyusb (0.12.0-203-ga4cfd1c6) Model: NXP RT1024 EVK Board-ID: MIMXRT1024-EVK-revA Date: Jul 15 2022
What happened ?
flash-sdp
work, bootloader seems to run well on SRAM, and seems to write to flash10
This seems to indicate there is some misconfigured in the fcfb that cause bootROM to run instead of loading tinuf2. I have tried to alter several flash_config but does not seem to work.
NOTE: rt1020 evt work well with an 8MB external flash, the rt1024 with built-in qspi flash probably need a bit more testing.
How to reproduce ?
10
make BOARD=imxrt1024_evk LOG=1 flash-sdp
Debug Log
n/a
Screenshots
No response