Forum Discussion
Altera_Forum
Honored Contributor
12 years agoThanks for the replies dsl and ted. I think I do understand the difference now. I missed the fact that alt_write_flash_block could be used to write only part of a block without affecting the rest of the block. So, just to check, does this mean that if you erase and write the whole block (whether you read and modify the data first or not), there is no real difference between the two methods? I will check the source code, but that's my understanding at the moment.
One final question (or couple of questions): The reference section of the manual states that these functions should be used "only when operating in single-threaded mode". Is this really true? I want to use them in a multi-threaded application, although I will make sure that all the writes to the flash are done from a single thread. Is it just that the functions aren't thread-safe, or should they really not be used in an application that uses multiple threads? If it just means that all the uses of these functions should be done from a single thread, can I still read from the flash by reading directly from the address (i.e. not using the alt_flash... functions) from another thread (with an appropriate mutex of course)? Thanks, Giles