cancel
Showing results for 
Search instead for 
Did you mean: 

Why is erased flash not reading FF

ABULL
Associate

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

4 REPLIES 4

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

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
Lead

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
Lead

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.