flashiap MCX A in small blocks

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

flashiap MCX A in small blocks

2,584 Views
berndgrossmann
Contributor II

I try to run flashiap several times but failed second time.

I need to program some small blocks of flash memory.

 

Here is the output of the modified demo application and source code.

<\n> Flash driver API tree demo application. <\r>
<\n><\r>
<\n> Initializing flash driver.<\r>
<\n> Flash init successfull! <\r>
<\n><\r>
<\n> Config flash memory access time. <\r>
<\n><\r>
<\n> PFlash Information:<\r>
<\n> kFLASH_PropertyPflashBlockBaseAddr = 0x0<\r>
<\n> kFLASH_PropertyPflashSectorSize = 8192<\r>
<\n> kFLASH_PropertyPflashTotalSize = 131072<\r>
<\n> kFLASH_PropertyPflashPageSize = 0x80<\r>
<\n> destAdrss = 0x1C000<\r>
<\n> Erase a sector of flash<\r>
<\n> Calling flash_verify_erase_sector() API.<\r>
<\n> Successfully erased sector: 0x1c000 -> 0x1e000<\r>
<\n><\r>
<\n> Calling FLASH_Program() API.<\r>
<\n> Calling FLASH_VerifyProgram() API.<\r>
<\n> Successfully programmed and verified location: 0x1c000 -> 0x1c040 <\r>
<\n><\r>
<\n> Flash driver API tree demo application. <\r>
<\n><\r>
<\n> Initializing flash driver.<\r>
<\n> Flash init successfull! <\r>
<\n><\r>
<\n> Config flash memory access time. <\r>
<\n><\r>
<\n> PFlash Information:<\r>
<\n> kFLASH_PropertyPflashBlockBaseAddr = 0x0<\r>
<\n> kFLASH_PropertyPflashSectorSize = 8192<\r>
<\n> kFLASH_PropertyPflashTotalSize = 131072<\r>
<\n> kFLASH_PropertyPflashPageSize = 0x80<\r>
<\n> destAdrss = 0x1C010<\r>
<\n> Erase a sector of flash<\r>
<\n><\r>
<\n><\r>
<\n><9>---- HALTED DUE TO FLASH ERROR! ----

 
Tags (2)
0 Kudos
Reply
4 Replies

1,990 Views
berndgrossmann
Contributor II

berndgrossmann_0-1733756883210.png

 

0 Kudos
Reply

1,935 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @berndgrossmann 

The minimum erase size is one sector, which is 8 KB. You can also read the sector size  using the following function:

FLASH_API->flash_get_property(&s_flashDriver, kFLASH_PropertyPflashSectorSize, &pflashSectorSize);

Ensure that the erase size is aligned to the sector size. Based on the returned error code 0x65, it appears that the issue is due to the flash erase size not being aligned.

Alice_Yang_0-1733810596274.png

 

BR

Alice

0 Kudos
Reply

2,001 Views
berndgrossmann
Contributor II

The return, fail Code is 0x65 after erase.

Is it possilble zu erase the flash in  kFLASH_PropertyPflashPageSize = 0x80 or kFLASH_PropertyPflashSectorSize = 8192?

 

0 Kudos
Reply

2,006 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @berndgrossmann 

Please debug step by step to check when it failed? Run to which code? And take a screenshot show the failed information.  

 

BR

Alice

 

0 Kudos
Reply