cancel
Showing results for 
Search instead for 
Did you mean: 

How to begin with STM32L Discovery-NEWBIE alert!

jamesjoll
Associate II
Posted on November 18, 2013 at 19:18

Hello community,

I just got my beautiful STM32L board. I am moving from arduino to something more complex. However, the new info has been really overwhelming. Since morning I have been trying to figure out how to upload a simple blinking program into the board, with no luck. It seem that everything is much more complicated than what I am used to (arduino). Anyway, I got Keil IDE,and have been trying to prog the board but it seems that I need ST Linker for that, is that right? Cannot I just connect the board to USB port? Also how would I load a blinking instruction into uC? Any tutorial or suggestion? I just want to know if I am in right track?

#stm32l #st-linker #how-to-start
5 REPLIES 5
florianaugustin9
Associate II
Posted on November 18, 2013 at 19:52

Hello!

This board has a ST-link v2 programmer/debugger on board. With that you can programm this board or in the future if you want you can programm another board. So you don't need any external tool for that. Thats great because if you buy a st link v2 standalone it think this is more expensive than your whole board!

I don't own that board but normally in the ''STM32L1 Discovery firmware package (RN0079)'' file there should be ready to run applications for KEIL and other IDEs. I'm not familar with KEIL but try to go to debugging menu and then choose 'go'.

Best regards,

Florian

Posted on November 18, 2013 at 23:10

Yes, just connects via USB

Drivers and current firmware for the on-board ST-LINK (SWD Debugger) should be in C:\Keil\ARM\ST-LINK

If you have Windows 8, you might need to seek out the most current driver from ST's site, as Win8 needs the driver to be signed, or you have to jump through a few hoops.

I believe the demo firmware is designed for IAR rather than Keil, but there should be Keil examples in the STM32L firmware library, along with a project template.

With current firmware the ST-LINK adapter should be selected as the ''ST-Link Debugger'' not ''ST-LINK (deprecated)'' under the Debug/Utilities tab, and the appropriate STM32L flash algorithm under the Flash options.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jamesjoll
Associate II
Posted on November 20, 2013 at 11:13

Thanks for replies,

I found this demo example:

https://docs.google.com/file/d/0B7OY5pub_GfIWU4xVHRoa1NuRWs/edit?pli=1

then I built it then I tried to load it, it gave me following error: ''flash download failed Cortex M3'', do you know why? it is on ST_Link debugger SW port.

thanks

jamesjoll
Associate II
Posted on November 20, 2013 at 11:14

I have attached the demo example

________________

Attachments :

STM32L_Discovery_Demo_Keil.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I19u&d=%2Fa%2F0X0000000bjB%2FJ9ZcONNNp267NNREK7He9RIPQtO6wfcBRyoZfrcKjzA&asPdf=false
Posted on November 20, 2013 at 13:56

Yes, so that's the example I ported to Keil and posted.

So, you need to look at the settings in the Debug pane, confirm you can see the chip, and that you can erase it.

If you can't erase it, then you might have an issue with the current code on the board, and low power modes, getting in the way of the debugger. You can reset the board with BOOT0 pin high (3V), this will run the system loader instead, and should allow the board to be programmed.

If it's something else you'll need to reflect on your specific set up, versions of OS, drivers, firmware, Keil, etc.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..