Why is erased flash not reading FF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-08 8:57 AM
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
- Labels:
-
Flash
-
STM32L0 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-08 12:34 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-08 11:13 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-08 11:26 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-04-09 1:34 AM
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.
