Forum Discussion
Altera_Forum
Honored Contributor
16 years agoalt_write_flash - single threaded
I'm currently experimenting with uC/OS-II with NicheStack on Nios II. Things are going well except for situations where I am writing 128K of data to flash using alt_write_flash(). I noticed in the...
Altera_Forum
Honored Contributor
16 years agoI avoided the use of the alt_write_flash() function which seemed to be problematic with uCosII from my experience and instead I use the alt_write_flash_block() and alt_erase_flash_block() with an implementation that will yield to the uCosII scheduler. This seems to be working just fine for me.
From the investigation I have been doing, it looks like you should be able to wrap the flash API with OSSchedLock() and OSSchedUnlock(). This will guarantee that the flash function execution will never get preempted by the uCosII scheduler. Have you actually run into problems using uCosII and the NiosII flash API?