Hello community,
I have a problem when with my S32K144 device when want to do quick sequence of reading out OTP section.
I use NXP SDK Flash Driver function ("FLASH_DRV_ReadOnce") for that, which I call 8 times to readout the whole OTP section (8 records with 8 bytes of data). Sometimes when I do this I get reset of the device. And it's hard to tell what is the root-cause of this reset. Debugger goes crazy when I want to do step-by-step debug. Last thing I catch is that I get en error state in in this call:
START_FUNCTION_DEFINITION_RAMSECTION
static status_t FLASH_DRV_CommandSequence(const flash_ssd_config_t * pSSDConfig)
{
status_t ret = STATUS_SUCCESS;
FTFx_FSTAT |= FTFx_FSTAT_CCIF_MASK;
while (0U == (FTFx_FSTAT & FTFx_FSTAT_CCIF_MASK))
{
if (NULL_CALLBACK != pSSDConfig->CallBack)
{
DISABLE_CHECK_RAMSECTION_FUNCTION_CALL
(pSSDConfig->CallBack)();
ENABLE_CHECK_RAMSECTION_FUNCTION_CALL
}
}
if ((FTFx_FSTAT & (FTFx_FSTAT_MGSTAT0_MASK | FTFx_FSTAT_FPVIOL_MASK | FTFx_FSTAT_ACCERR_MASK | FTFx_FSTAT_RDCOLERR_MASK)) != 0U)
{
ret = STATUS_ERROR;
}
return ret;
}
END_FUNCTION_DEFINITION_RAMSECTION
The place when I can catch something is in "ret = STATUS_ERROR" line.
But I don't know if that is a false positive, because when I look into the FTFxFSTAT it contains no error. When doing step-by-step debugging, I cannot exit this function call, and it goes back to error checking few times and then I got the reset.
Issue can be also reproduced when using only 1 record and do cycle readout.
Does anyone know what could possibly be a problem here?
Or maybe someone know how to trace the issue right?
Environment:
MCU: S32K144_64
IDE: S32DS 2018.R1 with ProcessorExpert
Debugger: J-Link
SDK: RTM 2.0.0
Project build config: FLASH
Kind regards,
Piotr K.