2003-07-08 07:46 AM
2011-05-17 02:54 AM
I am using the PSD4235G2 with an AN87C196CB20 Micro. I currently have a RS232 IAP for the Main flash that works great. I now want to do the same with the Boot Flash. So I copied my code from the Boot Flash into the Main Flash, made the appropriate changes and tried it out. I am unable to erase or write to the Boot Flash but it does read it correctly. It doesn't give an error when checking the status bits during the erase and write. But when I do a read back of the byte that is supposed to be changed, it fails. If I don't modify the Boot code at all, it will fly through the entire Boot section and say it passes. If I modify one bit in the Boot code it will get to that point and fail. The security and protection bits are all cleared, so I am at a loss as to why I can't erase or write. I am using the same code that I use to Write to the Main Flash. Please help. :cry:
2011-05-17 02:54 AM
Hello,
To write and to erase a Boot Flash sectior, you need to send the command sequence to unlock the Boot Flash sector that you are trying to access. The addresses to send these Unlock command sequence is different from the addresses you used to send the Unlock sequence to the Main Flash Sector. Depends on how you mapped your Boot Flash sector, you need to setup you address correctly in order to unlock the Boot Flash Sector. When you send an 0xAA to 0xX555, the X is not really a don't care, it needs to be in the address range of sector you mapped to, for example, if your Boot Flash Sector is mapped to 0-0x1FFF, the X needs to be set to either a ''0'' or a ''1''. The reason you can do a Flash ''Read'', is because reading does not require to ''Unlock'' the Flash first.2011-05-17 02:54 AM
Thanks, after taking a look at what you said I noticed that I was loading a byte value of the sector address with an invalid value. For the main flash it was OK but for the Boot flash it was always an invalid address. Thanks again.