Placing the flash erase/write functions in em_msc.c into Flash

by <a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero Employee</font></font> </a> amenleung on ‎12-28-2016 04:17 PM

Question

How to place the flash erase/write functions in em_msc.c into Flash?

Answer

By default, all flash erase/write functions in em_msc.c are located in RAM. In order to save RAM space, these functions can relocated to flash by defining the EM_MSC_RUN_FROM_FLASH symbol in corresponding the IDE.

 

Note:

  • This method does not apply to EFM32 Gecko (EFM32G) devices.
  • During a write or erase, flash read accesses will be stalled, effectively halting code execution from flash. Code execution continues upon write/erase completion. Code residing in RAM may be executed during a write/erase operation.