cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F767 flash programming problem

gsaru.1
Associate II

Hi everyone,

We are trying to program the MCU flash memory to write and save some data on it.

After successfully writing to a single sector, we can't delete the sector content anymore.

We are using HAL_FLASHEx_Erase to delete the sector.

In particular, we use the ideas in this article https://controllerstech.com/flash-programming-in-stm32/

Thanks in advance.

5 REPLIES 5

Are you asking a Question, or making a statement?

Well the HAL FLASH functions do work properly on the F767's, so perhaps review the Reference Manual, or looks at the examples provided in CubeF7 for the board..

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
gsaru.1
Associate II

Asking a question...

Correction to the original post - after a single write(that might have failed) to a sector, when we try to write/overwrite the same sector we fail. Already read the Reference Manual (and I'm sure the HAL FLASH functions work properly), hence looking for advice on how to proceed from here/ things to think about that we might have missed.

Javier1
Principal

Recomended reading RM0410

I have never used an F7, what about the single/dual bank bits?

we dont need to firmware by ourselves, lets talk

every time you want to write FLASH, the entire flash page needs to be erased.

https://community.st.com/s/question/0D53W00001hkN4aSAE/hardfault-when-i-try-to-program-in-the-flash-memory

What i usually end up doing is:

  1. copy entire flash page to ram buffer
  2. modify the part of the ram buffer i want
  3. erase flash page
  4. copy back RAM buffer into erased flash page
we dont need to firmware by ourselves, lets talk
jbake_uni
Associate II

For dual bank information you can use this resource:

STM32F7 Series Flash memory dual bank mode, software expansion for STM32Cube (AN4826)