[ECOS] RE:FLASH driver problems on eCos 1.3.1 for edb7312

Chris Sekula chriss@turnpikeglobal.com
Wed Sep 26 10:04:00 GMT 2001


Thanks for your response yesterday Dan. You raised some interesting
issues regarding programming FLASH.
 
I mentioned previously that the FLASH driver that we had written worked
on our 7212 board (with eCos 2.0), but not on our 7312 board (with
eCos1.3.1). One of your comments about programming the FLASH was that
the code to do the programming had to copied into RAM and had to be
executed from RAM. I didn't understand this at first, since I assumed
that all of the eCos kernel (including drivers and application code) is
copied from FLASH into RAM for execution.
 
I recalled that when I was successfully testing the code for our FLASH
driver on the 7212, I had been using the gdb stub and eCos had been
built with the RAM startup option. I decided to create a binary image of
eCos with ROM startup selected for the 7212. This time, our FLASH driver
didn't work. I checked the voltages at the Chip Enable pin of our FLASH
and noticed that the Chip Enable was being clocked. Our experiences with
the 7312 had also been with a binary image programmed into the FLASH.
 
1. Based upon the above observations, it appears to me that our driver
code only worked since it had been executing from RAM with the gdb stub.
I'm a bit confused however, since even though we built a binary image
for ROM startup, isn't the application code (including my code for
programming the FLASH) copied into RAM upon initialization and then
executed from RAM? If this isn't the case, is it possible to build a
binary image of eCos which resides on FLASH and is then copied into RAM
upon power up so that the kernel and application executes only from RAM?
 
2. I've been looking over the code for the FLASH driver included with
eCos 2.0 since using this driver may be the easiest way to solve our
problems. The code for programming and erasing is fairly straight
forward and similar to the code which I had written. The source code for
copying something into RAM and disabling the cache appears to be in the
flash_hwr_init(void) function in the bootblock_flash.c file. However,
the 'something' that is copied into RAM appears to be the flash_query
function only. Perhaps I am not using the latest edition of the flash
driver files? How do these functions work together? eg. to erase a
sector do you first call the hwr_init function followed by the
flash_erase_block function or do you have to provide your own setup code
before calling the flash_erase_block function?
 
Thanks for any assistance,
 
CHRIS.


More information about the Ecos-discuss mailing list