AnsweredAssumed Answered

STM32F103: some blank pages in flash, not visible in binary

Question asked by tomdeboer on Aug 20, 2015
Latest reply on Aug 21, 2015 by 68516
Hello everyone,

First question on this forum.. Ok, so in short: whenever I upload a binary file, either using st-flash, ST-LINK Utility, or gdb load, the flash memory shows up empty (0xffffffff) on pages 0x8004000-0x80047FF. And it does that every time, even though the binary and hex files that I use to upload don't show these empty spaces. Weirdly enough, the verification (while flashing with st-flash for example) doesn't come up with an error. After flashing has been done however, the compare function in ST-LINK Utility does!
I have been looking at this problem for a while and it is starting to freak me out now.

This would suggest a corrupted chip or damaged flash maybe, but I experience the same problem on a different board (a Nucleo F103RB) using a different USB ST-link v2 and different tools on both windows and OSX. I even tried using a different toolchain to compile the things in a VM, but the problem stays the same. I did notice that if I change the memory mapping in my linker file from:
FLASH (rx)    : ORIGIN = 0x08000000, LENGTH = 128K
FLASH (rx)    : ORIGIN = 0x08008000, LENGTH = 96K
and thereby skip the pages I previously mentioned, there is no "hole" in the flash memory!

Some additional information: I'm compiling a slightly modified firmware (wifi disabled) for the Spark Core from Particle (formerly Spark IO), based on their stock firmware repository. I'm compiling this using the GNU Arm Toolchain version 4.8 on OSX. I use the st-flash utility for uploading and st-util and gdb for debugging.

Now I am quite lost at this point, so I have no particular question I want to ask other than: what can this be?
Thanks for your help!