Question about programming the STM32 "Blue pill" controller

256 views
Skip to first unread message

petet...@gmail.com

unread,
Jun 7, 2018, 3:41:05 PM6/7/18
to Leeds Hack Space
Hello
I am just trying the "PlatformIO" development environment within VSCode editor.

I am also starting to play with the STM32 controller, and i have the ultra cheap "Blue pill" version from Banggood.

I managed to set up an Arduino framework project (basic blink), upload it to the controller using another cheap-o FTDI232 device from Banggood

so far so good.

However, i head good things about "MBED" programming platform, so i created another blink project based on MBED, and i can't upload it to the chip. 
I am obviously missing something. I spent the evening failing to find anything obvious on the internet. 
Has anyone got any experience with this?


In platformio, there is a platformio.ini file which specifies the target board, framework, port, and upload method for the project.
For the arduino blink project the file contents looks like this:


[env:genericSTM32F103C8]
platform = ststm32
board = genericSTM32F103C8
framework = arduino
upload_port = /dev/ttyUSB0
upload_protocol = serial

and this works.

for the MBED project the file looks as follows:

[env:genericSTM32F103C8]
platform = ststm32
board = genericSTM32F103C8
framework = mbed
upload_protocol = serial
upload_port = /dev/ttyUSB0

and this does not work. Computer says NO. More specifically, it says:
Warning! Unknown upload protocol serial

why would one platform/framework allow serial upload, while other did not?
Anyway, i am obviously missing something.

Can anyone shed any light on this?

Regards
Pete



Mark C

unread,
Jun 7, 2018, 6:17:46 PM6/7/18
to leeds-ha...@googlegroups.com
Aha! Well, you've done some good work to get it working so far! I never did get it working on an FT2232/FT232 chip, but I didn't try all that hard as I had an ST-Link v2 to hand :P

So, the problem is that you need to use the USB for MBED iirc. I forget which it is, but either you need a different bootloader that supports DFU (for writing flash over USB) or to work out how to enable the 'special' STM32 flash management over UART. My guess is to try the latter first...

Does this make sense? I can send you the relevant ST-Link documentation if it would help :)

Cheers! M.

--
You received this message because you are subscribed to the Google Groups "Leeds Hack Space" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leeds-hack-space+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

petet...@gmail.com

unread,
Jun 8, 2018, 12:16:44 PM6/8/18
to Leeds Hack Space
Yes, I do have something called STLink, also from Banggood, i have briefly tried that, but i did not know what i was doing.
I am also aware of df-util, and i know that i do need a different bootloader for that.
I only have one STM32 controller at the moment, so i shall persevere with trying the FT232 chip and the stlink for now.
I have ordered 3 more, so when they arrive, will also try to upload the bootloader and the df-util

if i don't get anywhere tonight, i might bring my toys to hackspace tomorrow, and maybe someone can at least show me how to use the stlink.

ttfn
Reply all
Reply to author
Forward
0 new messages