Arduino Bootloader on STM32F103C8T6 core of custom PCB

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
Post Reply
shashankvh
Posts: 1
Joined: Fri Feb 03, 2023 9:02 am

Arduino Bootloader on STM32F103C8T6 core of custom PCB

Post by shashankvh »

Hi,
I'm a beginner with custom PCB boards, although I have previously worked on Arduino boards. I have recently got a custom PCB designed with the STM32 blue pill core (STM32F103C8T6). I believe the custom PCB will not have any Bootloader pre-installed. I know it's possible to install Arduino IDE with the blue pill board, but how to install it with a custom PCB?
What hardware would I need. Is having a ST link v2 enough? My custom PCB design file is attached for reference, with USB and SWD pins set aside, along with Reset.

Any links also would be appreciated. Have a nice day
Attachments
Screenshot_2023-02-02-21-04-29-56_e2d5b3f32b79de1d45acd1fad96fbb0f.jpg
Screenshot_2023-02-02-21-04-29-56_e2d5b3f32b79de1d45acd1fad96fbb0f.jpg (72.92 KiB) Viewed 3672 times
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: Arduino Bootloader on STM32F103C8T6 core of custom PCB

Post by GonzoG »

You can use ST-Link and SWD pins (you also need Reset pin) or UART1 (PA9, PA10) pins with TTL-USB converter to flash anything to STM32F103.
But with UART you need to manually reset board into bootloader (pins BOOT0 and BOOT1, don't remember which one is needed for UART bootloader).

If you're MCU setup is same as blue pill (same frequency crystal, same clocks) you can use blue pill as a board in Arduino IDE.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Arduino Bootloader on STM32F103C8T6 core of custom PCB

Post by ag123 »

various stm32 mcus e.g. the f4xx series has DFU, so if you use those you can upload over usb.
just that they still need you to set boot0 and toggle reset to get into DFU mode, quite easy to implement using jumpers, toggle buttons etc.

then just about most stm32 can upload firmware over uart, similarily you need to set boot0 and toggle reset.
and normally you'd use a usb-uart dongle to connect the wires.

otherwise, there is st-link which requires just connecting about 4 wires and program away, no need fo boot0 toggle, but you may need to toggle reset.
and normally you'd use a st-link dongle to connect the wires or use a or JTAG/SWD programmer.

with these means, no additional boot loader is needed. and you have all the flash and sram for your app.

there are some (3d printer) boards which simply embed a usb-uart chip to connect to a stm32. used for both comms and programming.
rather often that is a poor choice as many (cheap) usb-uart chips don't work as well as stm32's on chip usb hardware.
there has been complaints of 3d printers which are causing a lot of gcode retransmissions from the host as the stm32 couldn't catch up as it is too busy handling the motors (stepping with lots of complex computations, e.g. floating point accelerations, physics etc), monitor and control temperatures, doing path planning, parsing commands). this is because, those boards use a 'lousy' usb-uart dongle to interface a stm32 instead of the on-chip usb hardware.

they'd have better used the stm32's standard on chip usb hardware, and provide toggle buttons to toggle boot0, reset etc.
Post Reply

Return to “IDE's”