STM32F103 – STlink vs Serial programmer - Page 1
Forum section: electronics / general

author: 3dgeo
author_rank: Frequent Contributor
timestamp: November 07, 2019, 06:57:24 pm
content: Howdy,what is the better way to upload and debug STM32F103? I'm using cheap"FTDI" serial programmer and it seems to work just fine, I've never used STlink (V2), what advantages STlink has over serial uploader? Should I change debugging and uploading interface for my product from serial to STlink? It mainly be used to upload HID bootloader.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: November 07, 2019, 07:27:42 pm
content: I assume with serial uploader, you mean using the BOOT0/BOOT1 pins to enter "programming mode" and then use the serial connection to flash the firmware.If you use it only to upload a bootloader, and use the bootloader to flash the firmware, I don't see the advantage.The advantage of STlink (or any other debugger) is the ability to actually debug the firmware, as in, step through the code, look at register content, etc.

author: lucazader
author_rank: Regular Contributor
timestamp: November 07, 2019, 07:28:59 pm
content: I would go with the if it ain't broke don't fix it approach here probably.In saying that in general the st-link will be slightly easier if your general dev environment supports loading code using the st-link.It doesn't require control over the BOOT pin to boot into the uart bootloader to download the flash.It also allows you to properly debug the code with breakpoints etc if and when you need.But yea if you already have a process that works for your product, and you are mainly talking about the production process (eg loading the HID bootloader into bare chips and then the final update happens later in the production process) then i think your current method is just as good as any other!

author: 3dgeo
author_rank: Frequent Contributor
timestamp: November 07, 2019, 07:39:54 pm
content: Quote from: GromBeestje on November 07, 2019, 07:27:42 pmOh, You brought a point that slipped out of my mind – BOOT0/BOOT1 pins. Currently PCB design is with BOOT0/BOOT1 pulled down by 10K resistors. And I break out SWDIO and SWCLK for programming bootloader, I don't want to play with pulling up/down pins to enter programming mode, that's why I would like to migrate to ST link instead, plus extra debugging features would be nice.But it's uncharted territory, can I use only SWDIO, SWCLK, GND for ST link and provide 3.3V via product USB pot?

author: thm_w
author_rank: Super Contributor
timestamp: November 07, 2019, 10:41:46 pm
content: Quote from: 3dgeo on November 07, 2019, 07:39:54 pmYes. With the clone STLink + nucleo, it doesn't care if 3.3V connection is present as long as the chip is powered. But I always put 3.3V to allow external power of the device (at least for initial testing). You should have a spot to access RST as well, but generally its not needed.My standard debug header is 3.3V/IO/CLK/Gnd.

author: 3dgeo
author_rank: Frequent Contributor
timestamp: November 08, 2019, 06:49:11 am
content: SWDIO, SWCLK has to be pulled up/down on the PCB?

author: jhpadjustable
author_rank: Frequent Contributor
timestamp: November 08, 2019, 07:17:40 am
content: Quote from: 3dgeo on November 08, 2019, 06:49:11 amOf course, just the same as any other input. The usual recommendation is SWCLK 100k to ground, SWDIO 100k to +V, which is easily tucked next to the debug connector.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: November 08, 2019, 07:48:10 am
content: Quote from: jhpadjustable on November 08, 2019, 07:17:40 amNope, the STM32F103 has internal pullups/downs. TRM RM0008 paragraph 31.4.3 page 1081Quote

author: 3dgeo
author_rank: Frequent Contributor
timestamp: November 08, 2019, 08:28:54 am
content: Thank you!