Author Topic: STM32F103 – STlink vs Serial programmer  (Read 3318 times)

0 Members and 1 Guest are viewing this topic.

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
STM32F103 – STlink vs Serial programmer
« on: November 07, 2019, 06:57:24 pm »
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.
 

Offline GromBeestje

  • Frequent Contributor
  • **
  • Posts: 280
  • Country: nl
Re: STM32F103 – STlink vs Serial programmer
« Reply #1 on: November 07, 2019, 07:27:42 pm »
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.
 
The following users thanked this post: 3dgeo

Offline lucazader

  • Regular Contributor
  • *
  • Posts: 221
  • Country: au
Re: STM32F103 – STlink vs Serial programmer
« Reply #2 on: November 07, 2019, 07:28:59 pm »
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!
 

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: STM32F103 – STlink vs Serial programmer
« Reply #3 on: November 07, 2019, 07:39:54 pm »
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.

Oh, 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?
« Last Edit: November 07, 2019, 07:43:25 pm by 3dgeo »
 

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 6378
  • Country: ca
  • Non-expert
Re: STM32F103 – STlink vs Serial programmer
« Reply #4 on: November 07, 2019, 10:41:46 pm »
But it's uncharted territory,  can I use only SWDIO, SWCLK, GND for ST link and provide 3.3V via product USB pot?

Yes. 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.
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 
The following users thanked this post: 3dgeo

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: STM32F103 – STlink vs Serial programmer
« Reply #5 on: November 08, 2019, 06:49:11 am »
SWDIO, SWCLK has to be pulled up/down on the PCB?
 

Offline jhpadjustable

  • Frequent Contributor
  • **
  • Posts: 295
  • Country: us
  • Salt 'n' pepper beard
Re: STM32F103 – STlink vs Serial programmer
« Reply #6 on: November 08, 2019, 07:17:40 am »
SWDIO, SWCLK has to be pulled up/down on the PCB?
Of 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.
"There are more things in heaven and earth, Arduino, than are dreamt of in your philosophy."
 

Offline GromBeestje

  • Frequent Contributor
  • **
  • Posts: 280
  • Country: nl
Re: STM32F103 – STlink vs Serial programmer
« Reply #7 on: November 08, 2019, 07:48:10 am »
SWDIO, SWCLK has to be pulled up/down on the PCB?
Of 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.

Nope, the STM32F103 has internal pullups/downs.  TRM RM0008  paragraph 31.4.3 page 1081
Quote
To avoid any uncontrolled IO levels, the device embeds internal pull-ups and pull-downs on
the JTAG input pins:
• NJTRST: Internal pull-up
• JTDI: Internal pull-up
• JTMS/SWDIO: Internal pull-up
• TCK/SWCLK: Internal pull-down
 
The following users thanked this post: thm_w, 3dgeo, jhpadjustable

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: STM32F103 – STlink vs Serial programmer
« Reply #8 on: November 08, 2019, 08:28:54 am »
Thank you!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf