Hello all,
I have built a board that contains (besides a lot of other stuff) a AT91RM9200 and an AT45DB642 dataflash chip. Now I'm trying to code a homebrew boot loader. For a number of reasons, cannot use U-boot. The boot loader works fine when loaded using a JTAG debugger (J-link), bu it won't work when I try to load it using the boot ROM code that's buil into the MCU. The MCU actually loads something from the SPI (I can see that using 'scope) that's a lot longer than just the 32 bytes that it wants t inspect in order to boot from flash. When I interrupt execution, I fin that it puts something in IRAM that looks like what I've put into th flash, but the IRAM image is corrupt:
- The first 0x0400 bytes are OK.
- The following 0x400 bytes contain garbage (mostly 0xff).
- At 0x0800, I find 0x0400 bytes of code that *should* be at 0x0400!
- At 0x1000, 0x0400 bytes of garbage (again) and so on. It looks like the MCU wants to load 2048-byte pages from flash (where thi beast only supports 1024-byte pages). I use the following code at vector 6:
0x10 | (0x0d