1 year, 10 months ago.

Uploading code to bare STM32 MCU series without st link v2

Hi,

I was wondering whether it is possible to flash an STM32 MCU without using st link v2.

For instance, I would like to program a bare STM32L031K6 soldered to a generic 32 pin breadboard. Can I do it using a Nucleo-L031K6 through RX and TX pins? This is usually done with Arduino to program stand alone MCUs such as ATmega328 and many others.

Is it possible to do the same or something similar with STM32 MCUs?

Thanks!

Comment on this question

1 Answer

1 year, 10 months ago.

You can use a serialbootloader on the ST devices by setting Boot1 and Boot0 to the correct levels and resetting the device. See here for the software tool that is needed. Instructions are here.

The alternative to the serial port is to use the SWD port with an external flash device. The STLINK uses the SWD to flash the target processor on a nucleo or discovery board and you can use the STLINK of any nucleo to flash a bare metal processor.

Instead of developing your own ST32L031 board it is probably better and cheaper to get one of the ST32F103 boards (< $2) which is basically just a breakout board with xtal. See https://os.mbed.com/users/hudakz/code/STM32F103C8T6_Hello/wiki/Homepage

Many thanks for your detailed explanation. I will try some of your suggestions. I already have one of those boards but I want to reduce the consumption as much as possible and it has at least one LED.

posted by Guillermo Robles 06 Dec 2017