cancel
Showing results for 
Search instead for 
Did you mean: 

I can't use function HAL_FLASH_Program to program same memory address twice

JimEno
Associate III

When I call function HAL_FLASH_Program twice with the same Flash address, the second call is ignored. See test code below.

int8_t buffer1[16] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};

int8_t buffer2[16] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F};

EraseIntFlash( 0x08200000, 0x08300000 );

HAL_FLASH_Program(FLASH_TYPEPROGRAM_QUADWORD, 0X0820000, buffer1);

HAL_FLASH_Program(FLASH_TYPEPROGRAM_QUADWORD, 0X0820000, buffer2);

 

In Memory Browser, I expect:

0x08200000   03020100 07060504 0B0A0908 0F0E0D0C

But I get:

0x08200000   03020100 07060504 FFFFFFFF FFFFFFFF

What is going on? I really need this to work. Can anyone provide insight or solution or workaround?

Jim Eno

10 REPLIES 10

Tesla DeLorean,

A professional and technical response. Thank you.

I'll proceed with fixing issue on the IHex record decoding end (with a buffered receiver, etc.). Will look into improved solution as time and budget permit.

Thanks.

Jim Eno