cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L010 PCB layout for SWD and programming with bootloader

Claus_CE
Associate II

Hello together,

I'm about to design a pcb for my bachelor thesis with a STM32L010 microprocessor.

My goal is to connect my pcb via USB-C connector to my host system to program the microcontroller. The programming should happen via the bootloader and it would be great if there is a possibility to debug/program my microcontroller without any additional devices just like a ESP32 or Arduino board.

I researched a lot about it and it seems like programming via the bootloader is enabled "out of the box". But I am not sure about that because I saw a lot of projects with the "blue pill" board and in every project the user had to enable the bootloader with a programming adapter like ST-Link V2. Is there a way or a circuit diagram about the parts I have to use to archive programming and debugging via USB-C?

I would appreciate every help or link to a documentation about my questions. The specific stm32l010 documents I looked at are AN4467 and AN2606.

Best regards,

Claus 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Program with SWD, not USB-DFU. USB-DFU has no debug capability.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

5 REPLIES 5

App Note AN2606 should identify the pins and modes available.

The System Loader doesn't permit debugging, just programming. The SWD pins PA13/PA14 permit debugging via a debug pod like an ST-LINK or J-LINK.

The Blue Pill allows for an Arduino type loader which runs from the forward portion of FLASH.

Reset with BOOT0 HIGH, typically via a button allows for USB DFU programming, is used by Black/Blue Pill type boards, and assorted Flight Controller boards. STM32 Cube Programmer allows for a USB mode using DFU when the device populates as a "STM32 BOOT DEVICE"

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you for your quick reply. 

Do you know if there is an official documentation how to create an own "nucleo" board because I have one and it offers the things I need for my own pcb design. Debugging and flashing via one mini-usb connector and that's what I want.

When I understood your explanation correctly then I have to use a usb connector with a usb-dfu compatible microprocessor for uploading new software + a swd interface for debugging which needs an adapter ST-Link or J-Link. And that's not the optimal solution I would prefer the self made "nucleo" version.

TDK
Guru

Use a 14-pin SWD connector that you can use with STLINK-V3MINIE or similar. This will be the most efficient way to program, develop and debug code on the chip.

https://www.st.com/en/development-tools/stlink-v3minie.html

If you want the programmer on the same chip, you can solder a STLINK-V3MODS on the board and use it like a nucleo board.

https://www.st.com/en/development-tools/stlink-v3mods.html

 

I'd recommend avoiding the blue pill and related resources like the IDE. Their bootloader is created to make the developing environment similar to Arduino. Easy to use, yes, but with significant drawbacks, primarily for debugging. Up to you, of course.

If you feel a post has answered your question, please click "Accept as Solution".

Alright thank you. Then I would probably go with programming via USB-DFU + the 14 Pin-header for the programming and debugging as well. Should't be an issue or am I missing something out?

 

TDK
Guru

Program with SWD, not USB-DFU. USB-DFU has no debug capability.

If you feel a post has answered your question, please click "Accept as Solution".