|
First off sorry about the long message. I didn't want to leave anything out in case it was a tip off for someone.
I have a custom board based on the AT91SAM9G20-EK. I have been debugging it and cannot seem to write to the nandflash. I think the source of my troubles is the SDRAM. I have modified the getting started program to work for my board. When I run it from SRAM it runs fine and can run for as long as I would like. When I try to run it from SDRAM it will start sending text on dbgu then die right about the time it starts flashing the LEDs it stops and seems to reset the board(sometimes I see romboot pop up, other times not). I checked the reset register with Jmem and it calls this a power on reset but I dont see any changes to the supply on my scope while watching. I do see the nrst line toggle, which I think the processor is doing, but I don't know why.
If I understand correctly writing to nandflash and dataflash is done by loading a program into SDRAM and then sending it commands. The odd thing to me this would mean some programs are running in SDRAM without this problem. Also I can read and write the SDRAM from SAM-BA, isn't this all the processor is doing when running from SDRAM? Does the sdram run faster when the processor is pulling instructions from it vs just writing/reading via SAM-BA?
The following operations work in SAM-BA.
Initializing SDRAM Reading SDRAM Writing SDRAM Initializing NandFlash EraseAll NandFlash FindBadBlocks NandFlash
These Formerly worked (I had to increase the delay time to write a large file when it was working, I think I nerfed this during later tests.)
Initializing DataFlash Writing DataFlash Erasing Dataflash
Am I wrong about the nandflash applet? Does it run in SRAM or maybe partially from SRAM? I am compiling it with the command found in build.log which ends in SDRAM.
I'm wondering if it is a setup issue with my driver or something since it seems to run sometimes or if the layout for the SDRAM traces is bad. Is there a specific problem that would cause SDRAM operations to reset the board? Does anyone know a good way to check out the SDRAM for problems?
I would greatly appreciate any solutions, thoughts, suggestions or things to check. Thanks for taking a look.
Other notes that may be of interest. I am using the closest SDRAM I could find from micron it has the same spec sheet and as far as I can tell the only difference is the CAS=2 instead of CAS=3 on the eval board. I have modified this to the correct CAS timing. I can't find any notes in the spec sheet about the other settings, at least that I understand. I am programming using a SAM-ICE in sam-ba. When I try to run SAM-BA with USB I can see the SDRAM initialize on the debug port but the graphical interface never comes up, I'm not sure why it gets stuck.
|