3

Are there any options for programming an STM32 black-pill from the Arduino IDE without first having to manually push buttons to go into DFU mode or having to buy an ST-Link device?

A solution that leverages a second micro-controller board (I have Arduino Nanos, Pi Picos and ESP32 boards available) or requires some (easy) soldering would be fine.

1
  • something like Nucleo F303k8 - it has on board stlink and it also emulates hard drive, so you just drag and drop the binary file (or elf, i don't remember)
    – KIIV
    Commented May 2, 2023 at 18:13

1 Answer 1

-1

Your question is one I was recently interested in as I too have begun using Blue/Black Pills, and I am still learning!

  1. Have you got your Arduino IDE set up, and have you added the plugin for the STM32 boards? If not then you can find a tutorial in many places on the internet, one example being on youtube, if you prefer video tutorials... https://www.youtube.com/watch?v=b1123kz_3MM Some are better than others and I prefer a written instruction, with or without pics! Essentially you have to add:- https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json to your list or boards in the preferences. Many Tutorials will explain in detail.

  2. Programming options include:

    1. STLink-v2.1 etc. The STLink-v2.1 is easy to source, cheap, and after it is eventually replaced by something else you can even repurpose it as if it is a STM32 USB stick!
    2. FTDI USB to TTL breakout adapter, 3.3v only, connected to the SWD pins on the opposite end to the USB socket.
    3. An Arduino board acting as a TTL/SWD adapter but already kind (talking) to Arduino!
    4. Burning an STM32-Arduino boot-loader onto the blue/black pill, and plug it in like an Arduino, using tutorials.
    5. Install STM32CubeProg, on your host computer, which is free and a very good IDE.
    6. NO DOUBT a search engine (of traditional values!) can find other options including JTAG, JLink, Bus-Pirate, etc. (Avoid search engines that send you straight to selling sites!)

    All of these need to be searched, read and understood before a logical choice is made, but all of them are usable choices. Every reader will know that you will get user advice insisting that you do what they have done, or worse, warning you to avoid methods that others have used successfully. Caveat Emptor!

Follow the easiest path to begin with, one of those that are given in the Arduino site perhaps, and investigate others when you have found what you want the process to do, and which process suits your methods and budget. Much depends on memory needs and applications.

1
  • 2
    you don't answer the question. the question is how to program it over UART without manually setting the BOOT pin
    – Juraj
    Commented May 3, 2023 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.