Page 1 of 1

BluePill programming via serial port (BOOT0)

Posted: Mon Aug 08, 2022 1:55 pm
by ogogon
Colleagues, tell me, please, how can I set up an IDE on the Ubuntu platform for BluePill programming via a serial port?

In the days of the old stm32duino.com forum, I did this, but then the IDE settings were different, and I used the Mac platform.
I used a usb-serial module purchased from AliExpress and connected according to this scheme.
Image
In this case, "Upload method" was set as "Serial".

Now the list of programmers for stm32 is empty and I don't really understand what settings need to be set.
And there is no upload method serial.

In addition, as far as I remember, the download was carried out using the stm32flash utility.
I installed it using the apt system, but now it needs to be described somehow in the IDE.

I would be grateful for help and hints.
Ogogon.

Re: BluePill programming via serial port (BOOT0)

Posted: Mon Aug 08, 2022 2:21 pm
by ag123
I'm not too sure about mac
but if you can get python to work properly
there is this utility
https://pypi.org/project/stm32loader/
https://github.com/florisla/stm32loader
https://github.com/jsnyder/stm32loader
that i used from the command line to flash/program the bin file over serial.
But i'm using Linux, in mac I'm not sure what other challengers there may be.

more often it is necessary to set boot0 and press reset
(note that it is possible to wire the DTR RTS signals lines and 'abuse' them to toggle boot0 and reset, for that you would need to review the python codes and figure out which is the DTR and RTS lines. if they aren't there, you would need to set boot0 and press reset manually)

for the "official" stm core it is mostly based on stm32cube programmer
https://www.st.com/en/development-tools ... eprog.html
there are various manual/docs available for it
https://www.st.com/en/development-tools ... umentation

off topic:
in the old 'roger's core' (libmaple), there is this example sketch, which turns a STM32F103 pill board into a usb-uart dongle, along with the DTR, RTS signals. you would need to review the codes and select your own pins for that. this is quite 'useless' till you are able to program your first board.
https://github.com/rogerclarkmelbourne/ ... -w-signals

get an st-link v2 as well
https://www.adafruit.com/product/2548
https://www.st.com/en/development-tools/st-link-v2.html
that would let you debug in addition. and it does away with boot0, but you may still need to press reset.

Re: BluePill programming via serial port (BOOT0)

Posted: Tue Aug 09, 2022 4:07 am
by ogogon
ag123 wrote: Mon Aug 08, 2022 2:21 pm I'm not too sure about mac
but if you can get python to work properly
there is this utility
https://pypi.org/project/stm32loader/
https://github.com/florisla/stm32loader
https://github.com/jsnyder/stm32loader
that i used from the command line to flash/program the bin file over serial.
But i'm using Linux, in mac I'm not sure what other challengers there may be.
Thank you for your reply, but obviously you didn't read my question very carefully. In it, I write that I want to set up an IDE for Ubuntu. Mac mentioned in historical terms, as the platform on which I worked before.
ag123 wrote: Mon Aug 08, 2022 2:21 pm more often it is necessary to set boot0 and press reset
(note that it is possible to wire the DTR RTS signals lines and 'abuse' them to toggle boot0 and reset, for that you would need to review the python codes and figure out which is the DTR and RTS lines. if they aren't there, you would need to set boot0 and press reset manually)

for the "official" stm core it is mostly based on stm32cube programmer
https://www.st.com/en/development-tools ... eprog.html
there are various manual/docs available for it
https://www.st.com/en/development-tools ... umentation
I have device of my own development, but it is also controlled by DTR and RTS signals. So I need the utility whitch able to switch these signals.
Unfortunately, I did not find the stm32cube program in the Ubuntu resources. Can stm32flash be used?

Re: BluePill programming via serial port (BOOT0)

Posted: Wed Aug 10, 2022 1:18 pm
by ag123
for stm32cube programmer, you would need to download that from ST's web site.
https://www.st.com/en/development-tools ... eprog.html

In linux, I tend to use those python scripts mentioned prior, you would need to review that python code yourself.
i think it is able to toggle those DTR/RTS signals, but the usb-serial dongle need to support it.

I've not used stm32flash
https://sourceforge.net/projects/stm32flash/
https://github.com/stm32duino/stm32flash
hence, I'd not be able to help you with that. you could try to review relevant documentation and codes from the repository.