I am working with a Sandpoint development system with a PPC8245 chip. I know
that when the system goes into reset the reset vector is 0xFFF00100. The
flash chip (AMD AM29F040) is mapped at 0xFFF00000. What I would like to do
is write a routine that would allow me to reprogram the flash chip in my
circuit. That way I don’t have to remove it, put it in a burner and then put
it back into the circuit every time I have to reprogram.
Being that I am rather new to embedded development I am having difficulties
achieving this. I know the command sequences that are needed to talk to the
flash chip I just can’t seem to address the chip. I think the real question
is how do you address the chip?
I have tried something to the effect of:
volatile unsigned int *PCIFlash;
volatile unsigned int *PCIFlash_001;
volatile unsigned int *PCIFlash_2AA;
volatile unsigned int *PCIFlash_555;
unsigned char manu;
//the following addresses are needed for communications with the flash chip:
PCIFlash = (unsigned char *) 0xFFF00000;
PCIFlash_001 = PCIFlash + 0x001;
PCIFlash_2AA = PCIFlash + 0x2AA;
PCIFlash_555 = PCIFlash + 0x555;
//get the manufacturers id from the chip
//set the following addresses = to:
*PCIFlash_555 = 0xAA;
*PCIFlash_2AA = 0x55;
*PCIFlash_555 = 0x90;
//read the id
manu = *PCIFlash;
However on the *PCIFlash_555 command my program crashes hard with a SIGSEGV.
I seem to be stuck here, not know where to go on the next step.
It has also been suggested to me that the OS once loaded may unmap the flash
device from memory. Is this true? How can I find out?
If anyone has any ideas to kick me in the right direction I would be very
grateful!
Thanks in advance,
Mike