Flash verify section issue !

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

Flash verify section issue !

跳至解决方案
1,432 次查看
Saitej
Contributor IV

Hello NXP

Here we are with S32K148 and using flash drivers from SDK. we are performing flash operations from bootloader code on application memory 

boot- memory block: 0x00000000 to 0x0003FFFF

app- memory block: 0x00040000 to 0x0017FFFF

Here we are intended to do erase of whole application memory block (0x40000 to 0x17FFFF) and verify it for this we are using "FLASH_DRV_EraseSector" function followed by "FLASH_DRV_VerifySection" in a loop until we reach the last sector of application memory block.

But here continuously we are seeing "FLASH_DRV_VerifySection" got failed at 0x70000 address, arguments we given to "FLASH_DRV_VerifySection" are :

FLASH_DRV_VerifySection(&FlashSSDConfig, Flash_PrgmEraseConfig_s.NextStartAdrs_u32, C_FLASH_SECTOR_SIZE, C_FLASH_ERASE_MARGINLEVEL)

Flash_PrgmEraseConfig_s.NextStartAdrs_u32: address will get updated in the loop

C_FLASH_SECTOR_SIZE: sector size 4kb

C_FLASH_ERASE_MARGINLEVEL:  user margin level 1

FLASH_DRV_VerifySection(const flash_ssd_config_t * pSSDConfig, uint32_t dest, uint16_t number, uint8_t marginLevel)

  • Here we suspect in the function arguments we see third argument as number instead of size & we are passing the size is that correct ?.
  • from reference manual we understand we need to give double phrase number which is "128". are we correct on this ?
  • Saitej_0-1624337911710.png

     

  • But on other side in SDK doxygen document says size. which one is correct ?
  • Saitej_1-1624338011689.png

Please do the needful !

0 项奖励
回复
1 解答
1,411 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Saitej,

I guess this is because it crosses a PFlash block boundary.

danielmartynek_0-1624447190277.png

There are 3 blocks (read partitions) from 0x0000_0000 to 0x0017_FFFF.

Once block 0x0008_0000.

danielmartynek_1-1624447270223.png

One sector is 4096 bytes.

One double phrase is 128bits = 16bytes.

256 double phrases in one sector.

If you pass 256 as the third argument it should work.

 

Regards,

Daniel

 

 

 

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,412 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Saitej,

I guess this is because it crosses a PFlash block boundary.

danielmartynek_0-1624447190277.png

There are 3 blocks (read partitions) from 0x0000_0000 to 0x0017_FFFF.

Once block 0x0008_0000.

danielmartynek_1-1624447270223.png

One sector is 4096 bytes.

One double phrase is 128bits = 16bytes.

256 double phrases in one sector.

If you pass 256 as the third argument it should work.

 

Regards,

Daniel

 

 

 

0 项奖励
回复