cancel
Showing results for 
Search instead for 
Did you mean: 

Firmware uploading via USB

Tad_E
Associate II

Hi there,

I'm migrating to STM32F103VC or similar from embedded Arduino/Teensy MCU's (Atmega328P and MK20DX256). My IDE (PlatformIO Atom) supports several ST Micro's out of the box, but I have a few questions around implementation that I haven't been able to answer from the documentation so far.

Here are my questions:

  1. I understand these MCU's can be firmware uploaded via USB (without an intermediate bootloader chip/interface). Do they ship ready for this, or do they need to be configured for this using a JTAG programmer first (If so, please explain how this is done or point me in the direction of the relevant application note).
  2. Is there a document with the recommended connection schematic for a direct USB connection to a STM32 MCU ?
  3. Perhaps I'm behind the times, but I used a bit of EEPROM on my Atmega/MK20DX256 embedded projects and most of these STM32 micro's don't appear to have that. Is there a new, non-volatile program writable memory with a different name I'm unaware of?

I'm attracted to these STM32 products because I understand they come with a bootloader onboard and can be programmed via USB directly, which jumps a few of the hurdles with other brand MCU's.

Many thanks in advance !

7 REPLIES 7
Pavel A.
Evangelist III
  1. Per AN2606 [page 54], F103 does not have a built-in USB bootloader. Only UART is supported.

https://www.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD00167594.pdf/files/CD00167594.pdf/jcr:content/translations/en.CD00167594.pdf

Bootloader in F105, 107 has the USB option.

2. Yes there's an appnote for h/w designs with USB. Hope someone can find it (I've lost the bookmark after the forum re-haul).

3. No new names, just flash and eeprom. Older chips have only flash, some newer STM32L have eeprom as well.

-- pa

Tad_E
Associate II

DFU is not to be confused with USB host/peripheral functionality, I see. I'll do some reading up on the code required to read/write flash - I'm very accustomed to the ease with which the Arduino framework reads/writes the onboard EEPROM.

Thanks, that's helpful.

A further question, if I may..

The models that support the DFU have a lot of other features I don't need, and are a lot more expensive (thinking production quantity here). Is there a simple USB programmer chip I could install (that you could recommend) to make it field programmable with only a USB lead but still able to talk to most IDE's ? Perhaps ironically, the chip ST Micro use for their ST-Link is the F103.. Do they publish the bootloader installed on that?

Thanks again !

Pavel A.
Evangelist III

(2) The document is AN4879 "USB hardware and PCB guidelines using STM32 MCUs"

-- pa

Pavel A.
Evangelist III

> Is there a simple USB programmer chip I could install (that you could recommend) to make it field programmable with only a USB lead

Why do you insist on programming only with USB? ST-LINK or compatible debugger devices are cheap and reliable, great for field servicing (unless you have security concerns).

-- pa

Tad_E
Associate II

Hi Pavel,

The reason I'm so keen on USB is that the end user will need to be able to update it too. I'm happy to use JTAG or any other programmer in the workshop, but that doesn't help my clients.

Many thanks..

Pavel A.
Evangelist III

Then the only option for F103 is custom USB updater, with DFU or virtual serial (CDC) interface.

-- pa