Forums

AT91RM9200 - Vector 6 for dataflash boot woes

Started by Haroldp September 8, 2007
Hello all,

I have built a board that contains (besides a lot of other stuff) an
AT91RM9200 and an AT45DB642 dataflash chip.
Now I'm trying to code a homebrew boot loader. For a number of reasons, I
cannot use U-boot.
The boot loader works fine when loaded using a JTAG debugger (J-link), but
it won't work when I try to load it using the boot ROM code that's built
into the MCU.
The MCU actually loads something from the SPI (I can see that using a
'scope) that's a lot longer than just the 32 bytes that it wants to
inspect in order to boot from flash. When I interrupt execution, I find
that it puts something in IRAM that looks like what I've put into the
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 this
beast only supports 1024-byte pages).
I use the following code at vector 6:
0x10 | (0x0d << 13) | (0x400 << 17)
Meaning: 8 k of code, inside an AT45DB642 configured for "binary" page
size (i.e., 1024 bytes vs. the 1056-byte default page size).

Anyone seen this before? Suggestions for corrections to Vector 6?

Any ideas welcomed.

Rgds, 
Harold.




"Haroldp" <hplooijer@hotmail.com> skrev i meddelandet 
news:zcednbdjtL2xBn_bnZ2dnUVZ_vamnZ2d@giganews.com...
> Hello all, > > I have built a board that contains (besides a lot of other stuff) an > AT91RM9200 and an AT45DB642 dataflash chip. > Now I'm trying to code a homebrew boot loader. For a number of reasons, I > cannot use U-boot. > The boot loader works fine when loaded using a JTAG debugger (J-link), but > it won't work when I try to load it using the boot ROM code that's built > into the MCU. > The MCU actually loads something from the SPI (I can see that using a > 'scope) that's a lot longer than just the 32 bytes that it wants to > inspect in order to boot from flash. When I interrupt execution, I find > that it puts something in IRAM that looks like what I've put into the > 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 this > beast only supports 1024-byte pages). > I use the following code at vector 6: > 0x10 | (0x0d << 13) | (0x400 << 17) > Meaning: 8 k of code, inside an AT45DB642 configured for "binary" page > size (i.e., 1024 bytes vs. the 1056-byte default page size). > > Anyone seen this before? Suggestions for corrections to Vector 6? > > Any ideas welcomed. > > Rgds, > Harold. > >
You want to load dataflashboot.bin at address zero in the dataflash. This will handle vector 6, and will allow you to download your app to the rest of the dataflash -- Best Regards, Ulf Samuelsson This is intended to be my personal opinion which may, or may not be shared by my employer Atmel Nordic AB