Forum Discussion
Altera_Forum
Honored Contributor
15 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?