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! ----
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.
BR
Alice
The return, fail Code is 0x65 after erase.
Is it possilble zu erase the flash in kFLASH_PropertyPflashPageSize = 0x80 or kFLASH_PropertyPflashSectorSize = 8192?
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