I am working on S32K118. I am trying to run aes encryption using csec module.
Followed by manual and this post : https://community.nxp.com/t5/S32-SDK/STATUS-ERROR-on-CSEC-DRV-LoadPlainKey/td-p/1075577 I am trying to run csec_flash part example to run flash for csec.
But I got ACCERR(access error) from FLASH_DRV_EraseAllBlock.
Here is my flash config and code snippet. :
static const flash_user_config_t flash1_InitConfig0= {
.PFlashBase = 0x00000000U,
.PFlashSize = 0x00180000U,
.DFlashBase = 0x10000000U,
.EERAMBase = 0x14000000U,
.CallBack = NULL_CALLBACK
};
flash_ssd_config_t flashSSDConfig;
FLASH_DRV_Init(&flash1_InitConfig0, &flashSSDConfig);
FLASH_DRV_EraseAllBlock(&flashSSDConfig); // <-- ACCERR
Because of this problem I am unable to run csec module means calling :
FLASH_DRV_Program and FLASH_DRV_DEFlashPartition functions.
Any thoughts where the problem is? The flash config is wrong? What is the purpose of block erasing?
And the second question:
From manual :
"After clearing CCIF to launch the Erase All Blocks command, the FTFC erases all
program flash memory, data flash memory, data flash IFR space, emulated EEPROM
backup memory, and FlexRAM, then verifies that all are erased."
How I should understand erasing all program and data flash memory in runtime of my application?
Thanks in advance,
Piotr