pizzle: Hello! New user, System Workbench or Arduino?

Post Reply
pizzle
Posts: 2
Joined: Wed Feb 07, 2018 6:58 pm

pizzle: Hello! New user, System Workbench or Arduino?

Post by pizzle » Fri Feb 09, 2018 12:26 am

Hi all.

I'm migrating here from the AVR Arduinos, for one, to learn ARM, and two, because it seems STM32s are way, way more powerful than AVRs and surprisingly lower power as well. I'm well on my way to converting all my projects to STM32s, and laid out a Blue Pill to Arduino Nano converter board so I can use my existing boards (OSH says 16th for shipping!).

Anyways, my main question is whether or not I should go, I believe the term is, "bare metal" or should I go through the STM32duino bootloader? I have all the hardware (I think) to do both, but I'm wondering what the tradeoffs were other than easier/less external hardware to upload code with the bootloader. I'm thinking there isn't much of a difference, but I'd like to hear from the experts.

Thanks!

User avatar
mrburnette
Posts: 2200
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Hello! New user, System Workbench or Arduino?

Post by mrburnette » Fri Feb 09, 2018 12:36 am

pizzle wrote:
Fri Feb 09, 2018 12:26 am
...
Anyways, my main question is whether or not I should go, I believe the term is, "bare metal" or should I go through the STM32duino bootloader? I have all the hardware (I think) to do both, but I'm wondering what the tradeoffs were other than easier/less external hardware to upload code with the bootloader. I'm thinking there isn't much of a difference, but I'd like to hear from the experts.
...
Hi, pizzle:

Start here: http://wiki.stm32duino.com/index.php?title=Main_Page

Pay special attention to: http://wiki.stm32duino.com/index.php?ti ... g_a_sketch

Everyone has a personal preference, pick you comfort level.

More useful links here http://stm32duino.com/viewtopic.php?f=2&t=3111

Ray

pizzle
Posts: 2
Joined: Wed Feb 07, 2018 6:58 pm

Re: pizzle: Hello! New user, System Workbench or Arduino?

Post by pizzle » Fri Feb 09, 2018 1:37 am

Thanks for the links. The bootloader, programming tool differences and the sort-of-but-close-enough to C of the Arduino language I get.

So, the conclusion is that, functionally, Arduino provides a simpler uploading/programming interface and a set of standard APIs, at the cost of a bit of flash for the bootloader itself, which in some ways is redundant since ST provides a ROM (mask?) bootloader in the chip.

I recall for the AVRs, if I wanted to do something like run the chip at 1 MHz internal oscillator, or at least the non-default external oscillator configuration, I'd have to reflash the bootloader. Does a such a quirk exist here? I'm trying to understand all the little gotchas before I commit to a direction.

Thanks.

User avatar
mrburnette
Posts: 2200
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: pizzle: Hello! New user, System Workbench or Arduino?

Post by mrburnette » Fri Feb 09, 2018 2:21 am

pizzle wrote:
Fri Feb 09, 2018 1:37 am
...
I recall for the AVRs, if I wanted to do something like run the chip at 1 MHz internal oscillator, or at least the non-default external oscillator configuration, I'd have to reflash the bootloader. Does a such a quirk exist here? I'm trying to understand all the little gotchas before I commit to a direction.
I cannot say for the internal serial loader, but I suspect the "default BAUD" changes with physical system clock changes. However, at reset time the BAUD should be correct for downloading firmware.

For the USB issues and runtime frequency are discussed here:
viewtopic.php?t=248

With ST Link, I have no experience. As long as the physical crystal is 8MHz, I would expect no issues.

As I see it, you only have concerns if the physical crystal is changed.

Ray

User avatar
RogerClark
Posts: 7683
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: pizzle: Hello! New user, System Workbench or Arduino?

Post by RogerClark » Fri Feb 09, 2018 9:05 pm

The bootloader won’t every work using a 1MHz external crystal, because the minimum main clock freq that is required for :D USB is 48MHz as defined by the USB spec

The internal PLL in the STM32 does not have a setting which can multiply by 48.

Using the bootloader means you don’t need any external hardware to upload from USB.

The internal bootloader on the F103 only supports upload via hardware serial, so you need a USB to serial adapter to use it.

But if you go down the external programmer route, using a STLink or Blackmagic Probe is a better bet, as it does not require the Boot0 pin to be pulled high prior to uploads.

STLink and BMP provide debugging via GDB command line in addition to the ability to upload

Note, the Arduino IDE does not support debugging

Post Reply