Hi VaneB.
I want to write hse enable flag to 0x1b000000.
below is code for this.
and the attached file is hex and elf file for this.
I download the hex file to mcu and Power off and Power on.
The below code runs after power on. But hard fault happens while Fls_Write runs.
I provided same hex file to two customer. The customer use s32k314.
but one customer use this hex file without issue. Hard fault happens to the other customer
Fls_AddressType TargetAddress = LOGICAL_START_ADDR + (INTERNAL_SECTOR_SIZE * 4) ;
Std_ReturnType RetVal = E_NOT_OK;
uint32 offset = 0x00u;
/* Write to internal FLS */
RetVal = Fls_Write(TargetAddress + offset, (const uint8 * )&HseFWEnableFlagValue[0], 8);
/* Check return status */
CDDAssert(E_OK == RetVal);
if(E_OK != RetVal){
goto exit;
}else{
}
/* Perform the job */
while (MEMIF_IDLE != Fls_GetStatus())
{
Fls_MainFunction();
}
/* Check job result */
CDDAssert(MEMIF_JOB_OK == Fls_GetJobResult());
if(MEMIF_JOB_OK == Fls_GetJobResult()){
RetVal = E_OK;
}else{
RetVal = E_NOT_OK;
}