cancel
Showing results for 
Search instead for 
Did you mean: 

I am converting a project built on an STM32F072 to an STM32L071. I use a small area of flash memory to store some tables, etc. < 100 bytes. The program using the STM32IDE works fine for the F072, but I get a Hard fault with the L071.

LBarn.2
Associate II

I am using page erase and HAL flash program functions

6 REPLIES 6

Not really much detail to bite on there.

Does the L0 have width and alignment expectations?

Have a Hard Fault Handler that outputs some actionable data, look at the code faulting, look at the registers, and the address that's causing the issue.

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

Maybe you use flash as eeprom code in F072, but addressing and size for L071 is other. Too L071 have internal EEPROM then better is use it instead flash writes.

Andrew Neil
Evangelist III
LBarn.2
Associate II

Thanks to MM..1, I used Data eeprom and it worked perfectly, Thanks!

Uwe Bonnes
Principal III

While on STM32F, erased flash is 0xff. it is 0 on STM32L0. That could be a pitfall too.

0693W000008y9fZQAQ.png