Skip to main content
LBarn.2
Associate
March 29, 2021
Question

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.

  • March 29, 2021
  • 5 replies
  • 1295 views

I am using page erase and HAL flash program functions

This topic has been closed for replies.

5 replies

Tesla DeLorean
Guru
March 29, 2021

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 VenmoUp vote any posts that you find helpful, it shows what's working..
MM..1
Chief III
March 30, 2021

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
Super User
March 30, 2021
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
LBarn.2
LBarn.2Author
Associate
March 30, 2021

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

Andrew Neil
Super User
March 31, 2021

0693W000008y9fZQAQ.png

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Uwe Bonnes
Chief
March 30, 2021

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