S32K312 I2C Slave Failure During Flash Operation(RTD 5.0.0)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32K312 I2C Slave Failure During Flash Operation(RTD 5.0.0)

1,448 次查看
acnhyxgxl1
Contributor II

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.

acnhyxgxl1_0-1755688037984.png

 

Below image is the LA measurement, I think it is an OK waveform so it probably not a circuit issue.

acnhyxgxl1_0-1755685730847.png

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

标签 (1)
标记 (4)
0 项奖励
回复
4 回复数

1,339 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @acnhyxgxl1,

It looks like this function is called only if AsyncMode == FALSE.

danielmartynek_0-1755846251043.png

How did you configure the INFLS driver?

danielmartynek_1-1755846312547.png

 

Regards,

Daniel

0 项奖励
回复

1,199 次查看
acnhyxgxl1
Contributor II

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.

0 项奖励
回复

1,173 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @acnhyxgxl1,

Refer to RTD_MEM_43_INFLS_UM.pdf that is located in the installation directory of the RTD.

danielmartynek_0-1756189418778.png

In SYNC mode, the driver blocks the I2C bus while waiting for the flash operation to complete.

 

BR, Daniel

 

0 项奖励
回复

1,350 次查看
acnhyxgxl1
Contributor II

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?

acnhyxgxl1_0-1755828201782.png

acnhyxgxl1_1-1755828451905.png

 

 

0 项奖励
回复