Before you write to Flash or EEPROM | Cypress Semiconductor
Before you write to Flash or EEPROM
One of our customer had a query regarding writing into flash. I thought reply sent to him can be put out in the forum which will be of help.
Whenever you have to make changes into the flash or write into flash following are to be done before you can call CyWriteRowData() function.
You must acquire the die temperature at least once to use Flash and EEPROM write functions.The die temperature is obtained by calling the CySetTemp() function. This function queries SPC for the die temperature and stores it in a global variable, which is used while performing Flash and EEPROM write operations.
If the Enable ECC option is disabled, you also need to allocate the buffer and pass it into the CySetFlashEEBuffer(uint8 *buffer) function. This buffer is used to store intermediate data while communicating with the SPC. buffer should be of length 256 + 32 = 288 where 256 refers to width of flash rom and 32 ECC bytes.
The description is detailed in the Flash and EEPROM section of System Refernce Guide.