Skip to main content
ABULL
Associate
April 8, 2019
Question

Why is erased flash not reading FF

  • April 8, 2019
  • 3 replies
  • 3117 views

Hi community,

I'm currently working on a project using a STM32L072 controller.

One part ob that is implementing a customer-specific bootloader. No worries so far.

What confuses me is that an empty flash reads zeroes instead of FFs. This is with the ST-Link Tool, as well as with my debugger in Eclipse. I can correctly read out the programmed areas of the flash. What is even more weird is that i can program FFFFFF into the memory??

I already checked if any read protection is active, which isn't the case.

I attached some images to illustrate that behavior.

Can someone get this right for me please, what am I missing?

Thanks all!

Adriano

0690X000008A5bNQAS.png

0690X000008A5bSQAS.png

0690X000008A5bXQAS.png

0690X000008A5bcQAC.png

This topic has been closed for replies.

3 replies

waclawek.jan
Super User
April 8, 2019

That's normal. That FLASH erases to 0xFF is not carved to stone. Erasing to 0x00 is not very common, but also not something unseen.

JW

ABULL
ABULLAuthor
Associate
April 9, 2019

Thanks for your reply....Ok... but an unprogrammed flash cell is logically 1 is it not? That would mean there has to be some kind of inverter in the microchip.

I would expect that kind of behavior also to be documented, but I didn't find anything.

AvaTar
Senior III
April 9, 2019

I could name Infineon XC2200 MCUs, where erased Flash has a 0x00 state. I guess there is an inverter involved, but this is not of real concern for me.

I don't know the L072, and it's memory map. Other STM32 MCUs used to map Flash from higher addresses at address 0, I never tried to Flash at this address.

AvaTar
Senior III
April 9, 2019

Bothered to look at the L072 reference manual, and it is the same as with other STM32 MCUs.

At address 0, you find whatever memory was mapped on, depending on boot bode - either Flash, RAM, or ROM ("system memory").

Flash starts at 0x0800.0000. See the reference manual (RM0376), sect. 2.2.1, page 57.