Disable Temperature Measurements over SPC in Emulated EEPROM Component - KBA222088

Version: **



The Em_EEPROM Component uses temperature measurements over SPC when doing write/erase operation to flash on PSoC 3 / PSoC 5LP. Can the buried SPC temperature measurements be turned off for PSoC 3 / PSoC 5LP?



Yes.For PSoC 3 / PSoC 5LP family devices, add the following preprocessor definition for the applicable compiler:



  1. Right-click on your project with the Em_EEPROM Component and select Build Settings.

  2. Select Compiler under the appropriate tool chain:
    • For PSoC 3, it is DP8051 Keil 9.51 (or DP8051 Keil Generic if you are using custom Keil toolchain).
    • For PSoC 5LP, it is ARM GCC 5.4-2016-q2-update, ARM GCC Generic, or ARM MDK Generic.

  3. In the Preprocessor Definitions field, add the CY_EM_EEPROM_SKIP_TEMP_MEASURMENT preprocessor definition:
  4. Close the Build Settings window.

  5. Open the main.c file add the following function inclusion:

                  extern cystatus CyFlashGetSpcAlgorithm(void);

    Call this function after each device program or reset cycle prior making any write or erase operation to the flash in your project. The function will basically load the SROM API code to RAM to prevent the parallel reads and writes from/to the same flash macro (RWW issue).

  6. Then add the following array inclusion:

                         extern uint8 dieTemperature[CY_FLASH_DIE_TEMP_DATA_SIZE];

    The CY_FLASH_DIE_TEMP_DATA_SIZE equals to 2. The upper byte of dieTemperature contains only a sign bit (sign can be ‘1’ for a positive temperature magnitude value, ‘0’ - for a negative temperature magnitude value). The lower byte is the magnitude of the measured temperature. The units of the magnitude should be in degrees Celsius. Periodically measure the die temperature using any other comfortable mechanism other than the measurements over SPC and update the temperature values in dieTemperature[].