Forum Discussion
Altera_Forum
Honored Contributor
21 years agoMTD do_write_oneword fails
Hi I'm having some trouble with writing to a flash partition on our board running Microtronix 1.4 uclinux 2.6 We have 5 partitions on our flash: static struct mtd_partition microtr...
Altera_Forum
Honored Contributor
21 years agoYour flash is write only.
Writting to flash is not just a matter of writing to flash. In order to write to a flash, you must firt erase the "sector," then write to it. Your data is contiguous on the flash. So, to insert a new bit of information, you need to "push" the rest of the information towards the end of the flash. With that in mind. Look at the paragraph above. Replace "Writting to flash is not just........." with "Writting to your flash is not just............" In order to insert the "your," you must copy the entire section of code from flash, store it in some place like RAM, erase some number of "sectors" depending on the code size, insert "your", then write it all back to flash. Take a look at your flash data sheet, it will give you a better idea of what is done during a flash write. Doug