Hi NXP experts:
I use S32K312 as an I2C slave in my project, connecting to an I2C master (FT4222).
In this project, only Mem43_Infls(Flash W/R) and I2c slave are used and some of the I2C message from master will trigger flash erase & write sub-processes.
During my test, it has a high possibility that the I2C slave will keep low after receive message from the master. Only reinit the I2C slave can recover.
Below image is the LA measurement, I think it is an OK waveform so it probably not a circuit issue.
I conducted two experinments, here's some clues
Exp1. I commented all the `OsIf_SuspendAllInterrupts` and `OsIf_ResumeAllInterrupts` in `SchM_Mem_43_INFLS.c`.
The failure rate dramatically decreased, about 1/500 possibility causing I2C slave malfunction. Moreover, it turns out flash can work normally without interrupt suspension.
Exp2. I stubbed the Flash API, making it always returns E_OK instead of manipulating the flash driver.
In this way, I2C slave never fail(of course Flash has no function).
So my question is: Is there any setting or tweak I should use to solve this I2C slave fail issue? And can Flash be operated safely without interrupt protection?
Part of the code and the LA record are in the attachment. I'm not allowed to upload the code about I2C slave.
Hardware setup:
S32K312EVB-Q172
FT4222 (I2C master), baudrate: 900KHZ-1000KHZ
Software setup:
RTD: 5.0.0 HF01
Hi @acnhyxgxl1,
It looks like this function is called only if AsyncMode == FALSE.
How did you configure the INFLS driver?
Regards,
Daniel
My original setting was using async mode, but sync mode can also do my task.
I've tried both sync / async mode in Mem43_Infls, however it seems like only Async mode can write the data to flash correctly.
In Sync mode, although `Mem_43_INFLS_Write` returns `E_OK`, the content of Flash wasn't change(monitor via S32DS memory interface).
The sync mode also couldn't solve this I2C issue. The I2C slave will held low whenever the I2C command triggered Flash erase.
The attachment is my mex file and my flash HAL source code. Maybe you can provide me some clues.
Hi @acnhyxgxl1,
Refer to RTD_MEM_43_INFLS_UM.pdf that is located in the installation directory of the RTD.
In SYNC mode, the driver blocks the I2C bus while waiting for the flash operation to complete.
BR, Daniel
I found that when the Flash is processing `C40_Ip_AccessCode(Mem_43_INFLS_pConfigPtr->MemAcCallBackPtr);` in `Mem_43_INFLS_IPW_Erase` and the I2C Slave is waiting for the read frame will cause I2C slave failure.
Is ther any countermeasure to solve this issue?