cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L0 problem with retaining vector table

Jim Kaz
Associate II
Posted on September 07, 2016 at 19:28

Hi there!  I'm using the STM32L053 Discovery board, and I'm having a very weird problem.  Whenever I remove power from the board, whatever is in the first page of flash disappears.  The first 3 words become random (changes every power cycle) and everything else is erased to 0.  Since this is the vector table spot, my image doesn't run after I remove power and I have to reprogram it.

I was originally using Visual Studios with VisualGDB, but I just got the OpenSTM32 workbench thingie running and did two of the examples from the L0 framework and programmed the resulting images using the ST-LINK Utility.  Exact same result.

What am I missing?  Why does the first page of flash keep getting reset?  Any help would be greatly appreciated.

Thanks!

Edit:  Forgot to mention, this occurs on two separate Discovery boards and I believe it happened out of the box.  I haven't changed any protection levels or anything like that but I did confirm that they are all off.

#flash #stm32l0 #vectortabl
2 REPLIES 2
Posted on September 07, 2016 at 20:46

Not something I've heard described here before, are you sure it's not your debugger doing this?

The ST-LINK mbed firmware? Make sure you have current ST-LINK firmware via the v3.9.0 Utilities.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Jim Kaz
Associate II
Posted on September 07, 2016 at 21:49

I was afraid it was the debugger, which is why I moved to programming it using the St-Link.  Then I was afraid it was the image, so I downloaded the Eclipse based tool and compiled one of the example projects.  Then I went and upgraded ST-Link from version 3.7.0 to 3.9.0.  Nothing.  Nada.  Ziltch.  I'm so confused.  I have an L4 discovery board that works perfectly fine and my company is shipping a product with an L1 in it that I've been working on for over a year and that works fine too.

Fun fact that I just determined.  The first page of flash is only erased when I power the L0 unit via the ST-Link port.  I have an L4 with SPI and power hooked up to an L0 and I use the memory boot mode to program the L0 via the SPI protocol.  Since I can power both just by plugging in at the ST-Link port on the L4, I can power cycle the L0 without touching it's ST-Link port.  If I do that, the flash page does not get erased.

I also checked power the L0 board using it's USB port instead of it's ST-Link port and that seems to be OK too.  Just when I use the ST-Link port... soooo yea.  Kinda of annoying but not as horrible as it seemed a few hours ago.

Edit: With the new version of ST-Link, I noticed a little bit at the top of the status box when I connected to the L0 board.  The ST-Link firmware needed to be updated.  I did that and now it's fine.... *facepalm*

So... solved I guess.   If anyone else has this problem, update the firmware on your L0 boards ST-Link...