cancel
Showing results for 
Search instead for 
Did you mean: 

FLASH DATA WRITE PROBLEM IN STM32H743IIK6

RShar.9
Senior

Hello

i want to write some variable data on internal flash using HAL library but it not writing.

I am using blow code to write data to flash.

can you please tell what am i doing wrong.

#define FLASH_ADDRS   0x081E002A

#define FLASH_DATA_W 0x093

void FLASH_WRITE_DATA()

{

HAL_FLASH_Unlock();

FLASH_Erase_Sector(FLASH_SECTOR_7, FLASH_BANK_2, FLASH_VOLTAGE_RANGE_3);

HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD,FLASH_ADDRS,FLASH_DATA_W);

HAL_FLASH_Lock();

}

3 REPLIES 3

Instrument the code, report status/errors

Write to a WORD aligned address.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
PMath.4
Senior III

For the H7 write have to be 32 byte aligned and you write in chunks of 32 bytes, from my code:

int64_t initoptions[4] __attribute__ ((aligned (32)))
int64_t* volatile test;
test=(int64_t* volatile)initoptions;
HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, (uint32_t)test, (uint64_t)((uint32_t)i64))

RShar.9
Senior

thanks for reply.

i will try it