The S32K344 flash reads and writes are abnormal

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

The S32K344 flash reads and writes are abnormal

781件の閲覧回数
shunyizhang
Contributor III
    secNum = C40_Ip_GetSectorNumberFromAddress(startAddr);//获取当前地址所在扇区位置
 
   /* Unlock sector if needed */
   if (STATUS_C40_IP_SECTOR_PROTECTED == C40_Ip_GetLock(secNum))
  {
      C40_Ip_ClearLock(secNum, FLS_MASTER_ID);
   }
 
    C40_Ip_MainInterfaceWrite(startAddr, len, pData, FLS_MASTER_ID);//写入数据
    do
    {
         status = C40_Ip_MainInterfaceWriteStatus();
    }
    while (STATUS_C40_IP_BUSY == status);
 
startAddr:0x00600000
Hi,NXP.
           See the read and write code above. The user manual indicates that a maximum of 1024bits(128bytes) can be written in a single time, and the appeal code can achieve 128bytes of read and write in a single time. The memory interface can correctly display the data I write, but when I write 256bytes continuously, an exception will occur. All data is 0xFF, may I ask what is the reason?
 
 

 

0 件の賞賛
6 返答(返信)

740件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@shunyizhang

Please check whether it is consistent with the following problems

https://community.nxp.com/t5/S32K/C40-Ip-Example-S32K344-wrong-behavior/td-p/1609293 

0 件の賞賛

733件の閲覧回数
shunyizhang
Contributor III

Hi,

The RTD version I used was SW32K3_RTD_4.4_R21-11_3.0.0_D2303_DS_updatesite.zip, but I still had this problem.

0 件の賞賛

728件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@shunyizhang

could you share your project so that i can reproduce the problem .

0 件の賞賛

722件の閲覧回数
shunyizhang
Contributor III

I'm sorry that I can't provide the whole project here, because the company's computer has an encryption system, I can only copy the relevant code, please help me to see what the reason is, at present, it is OK to read and write 128bytes alone, but it is not OK to read and write more than 128bytes at the same address, I would like to ask if the method I used is wrong.

This is the code interface for erasing flash:

 secNum = C40_Ip_GetSectorNumberFromAddress(startAddr);//获取当前地址所在扇区位置
/* Unlock sector if needed */
if (STATUS_C40_IP_SECTOR_PROTECTED == C40_Ip_GetLock(secNum))
{
      C40_Ip_ClearLock(secNum, FLS_MASTER_ID);
}
 
/* Erase sector */
C40_Ip_MainInterfaceSectorErase(secNum, FLS_MASTER_ID);//擦除一块扇区要4.8ms,擦除时间太长,等待需要考虑改由任务延时
do
{
     C40Status = C40_Ip_MainInterfaceSectorEraseStatus();
}
while (STATUS_C40_IP_BUSY == C40Status);//等待擦除完成
 

Just written interface code:

    secNum = C40_Ip_GetSectorNumberFromAddress(startAddr);//获取当前地址所在扇区位置
   /* Unlock sector if needed */
   if (STATUS_C40_IP_SECTOR_PROTECTED == C40_Ip_GetLock(secNum))
   {
         C40_Ip_ClearLock(secNum, FLS_MASTER_ID);
    }
 
    C40_Ip_MainInterfaceWrite(startAddr, len, pData, FLS_MASTER_ID);//写入数据
    do
    {
    status = C40_Ip_MainInterfaceWriteStatus();
    }
    while (STATUS_C40_IP_BUSY == status);
0 件の賞賛

718件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@shunyizhang

"but it is not OK to read and write more than 128bytes at the same address"

This is as expected:

The minimum program size is 2 words (64 bits) and data must be 64 bit aligned. A maximum of 4 pages can be programmed at the same time, where 1 page are 8 words (256 bits). This mean that up to 1024(128bytes) bits can be altered in a single program operation.

0 件の賞賛

381件の閲覧回数
shunyizhang
Contributor III

@Senlent Hi,

Because there are other projects to catch up on the progress, this problem has been put on hold. Today, I return to this problem. I also went to study your demo program and found some differences. My flash test program did not initialize the PMC.

0 件の賞賛