Problems with programming AT91RM9200

Started by odi June 8, 2009
I have designed board with AT91RM9200 microcontroller and I've got some
problems with programming it... I wanted to program any bootloader into
connected AT45DB041D dataflash. Right now I can't send data via DBGU - I
thought it is MAX3232's fault but I replaced it and still nothing. However
sending data from ARM to PC works ok.
Instead of programming dataflash with xmodem I tried to do it the other
I load bootloader into internal SRAM and it tries to write itself from
SRAM to dataflash. I downloaded romboot bootloader from ... oting.html and compiled it with
gnuarm-4.0.2 gcc. It is slightly modified so it doesn't try to communicate
through tempo, whatever it is:P Code takes about 11kB in memory. 
When I try to program dataflash I get Data abort exceptions from different
places in code... Maybe something isn't correctly initialized?

I also tried Darrell Harmon's bootloader - few days ago it programmed 8
pages of memory and failed on ninth page - now it sometimes works,
sometimes not, yet I can't tell if something major have been changed by me.
However external SDRAM memory test passed successfully:)

So here are my questions:
What can be the cause of not working DBGU channel?
Is it possible to program dataflash this way (SRAM -> Dataflash)?
Maybe I should use oher bootloader / toolchain or something? 
How do I check if AT91RM9200 is operating correctly? 
Maybe there's some other way to program bootloader into dataflash?
I'm new to programming ARM9's so maybe there's something wrong with linker
script (I don't have any more guesses:/)

I would greatly appreciate any help;)
best regards,

Problem is solved. I tried using hyperterminal in Windows instead of
minicom and data was successfuly sent from PC - dataflash was programmed
correctly (now I use cutecom in Linux).
I was told that the fault was probably due to JTAG and openocd. Processor
must have went to some specific state during debugging and caused data
abort then. Can it be possible?

Right now I have another problem - 1stage bootloader is written and works
great, I did some tests of SDRAM memory - writing and reading different
patterns into 64MB of memory - they all passed successfully:)
However when I load u-boot from the first bootloader it hangs... I wrote a
simple LED test program and when it is executed from internal SRAM it works
OK, but when I put it into external SDRAM and execute from there - it
doesn't work.
Could it be caused by wrong initialization of SDRAM or should I program
EBI different way?