Newbie stuck at first flash attempt (STM32F103)

Post here all questions related to STM32 core if you can't find a relevant section!
Miq19
Posts: 15
Joined: Tue Jul 14, 2020 2:59 pm

Newbie stuck at first flash attempt (STM32F103)

Post by Miq19 »

Hi guys,

I have been programming several different Arduino and ESP MCUs in the past and only recently discovered the ST devices. I got a few STM32F103C8s and am struggling to get them to work with either Arduino IDE or PlatformIO.

I am stuck already with the STM32 Cube Programmer, that cannot make any connection to the boards. I tried with different USB/Serial adapters with no success. When trying to connect, the Cube Programmer is stating

Code: Select all

17:05:00 : Serial Port COM7 is successfully opened.
17:05:00 : Port configuration: parity = even, baudrate = 115200, data-bit = 8, stop-bit = 1.0, flow-control = off
17:05:01 : Timeout error occured while waiting for acknowledgement.
17:05:01 : Timeout error occured while waiting for acknowledgement.
17:05:01 : Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again...
The connections are

Code: Select all

Serial adapter <---> STM32F103C8
Tx <---> A10
Rx <---> A9
Vcc (3.3V) <---> 3V3
GND <---> G
The Boot0 jumper is set to 1, the Boot1 jumper left at 0. The PWR LED is steadily on, the PC13 LED is blinking at about 3-4/s rate. I can see the Serial adapter's Rx and Tx LEDs flashing briefly, but nothing else is happening.

What am I missing here? Any help is highly appreciated! ;)
User avatar
Juraj
Posts: 47
Joined: Fri Jan 03, 2020 7:47 pm
Answers: 1
Location: Slovakia
Contact:

Re: Newbie stuck at first flash attempt (STM32F103)

Post by Juraj »

power the Blue Pill with 5 V from Serial Adapter.
did you reset after setting boot0?
Miq19
Posts: 15
Joined: Tue Jul 14, 2020 2:59 pm

Re: Newbie stuck at first flash attempt (STM32F103)

Post by Miq19 »

Yes, I pressed Reset every time I powered the board.

For power issues I also tried to connect the USB port to a USB power plug, but it did not make a difference. Will it be different to use the 5V pin instead? I id not want to fry the A9/A10 pins with a 5V signal. My Serial adapter is switchable between 3.3 and 5, though.
ag123
Posts: 1797
Joined: Thu Dec 19, 2019 5:30 am
Answers: 28

Re: Newbie stuck at first flash attempt (STM32F103)

Post by ag123 »

just in case you are suspecting that you may have a fake blue pill
order from a different vendor e.g.
a nucleo from st
https://www.st.com/en/evaluation-tools/ ... 103rb.html
robotdyn (get the real stm32)
https://robotdyn.com/catalog/developmen ... ields.html
olimex
https://www.olimex.com/Products/Duino/S ... e-hardware
https://www.olimex.com/Products/ARM/ST/STM32-H103/
etc
in addition get a st-link v2
https://www.st.com/en/development-tools/st-link-v2.html
https://www.adafruit.com/product/2548
that would be handy especially when you want to debug on the mcu, in addition to simply uploading firmware
st-link v2 is a swd/jtag programmer
Last edited by ag123 on Tue Jul 14, 2020 6:00 pm, edited 2 times in total.
Miq19
Posts: 15
Joined: Tue Jul 14, 2020 2:59 pm

Re: Newbie stuck at first flash attempt (STM32F103)

Post by Miq19 »

The vendor seems to be trustworthy, they are in business for a while already.

I in fact have ordered a ST Link V2, it is supposed to arrive in the next few days.
ag123
Posts: 1797
Joined: Thu Dec 19, 2019 5:30 am
Answers: 28

Re: Newbie stuck at first flash attempt (STM32F103)

Post by ag123 »

there have been stories about batches of fake blue pills, even if some vendors who used to ship the real ones.
for some reason, these may be drop shipped i.e. some one else is literally shipping the blue pills other then the vendor themselves
getting at least a real device would help as you would be able to confirm if after all it has nothing to do with the serial (usb-uart) dongle
i.e. the usb-uart is working correctly
User avatar
Juraj
Posts: 47
Joined: Fri Jan 03, 2020 7:47 pm
Answers: 1
Location: Slovakia
Contact:

Re: Newbie stuck at first flash attempt (STM32F103)

Post by Juraj »

I get this message if I try to upload but there is some other board? Is the port right?

PA9 and PA10 are 5 V tolerant
fpiSTM
Posts: 1836
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 102
Location: Le Mans
Contact:

Re: Newbie stuck at first flash attempt (STM32F103)

Post by fpiSTM »

If you have the STM32CubeProgrammer then simply try to connect over uart as a first step.
Miq19
Posts: 15
Joined: Tue Jul 14, 2020 2:59 pm

Re: Newbie stuck at first flash attempt (STM32F103)

Post by Miq19 »

fpiSTM wrote: Tue Jul 14, 2020 7:04 pm If you have the STM32CubeProgrammer then simply try to connect over uart as a first step.
That is what I did and where the error shows up.
Miq19
Posts: 15
Joined: Tue Jul 14, 2020 2:59 pm

Re: Newbie stuck at first flash attempt (STM32F103)

Post by Miq19 »

I now soldered all three boards with pin headers and tried all three with 4 different UART adapters - all are showing the same behaviour.

So either I really got three fake modules or I am still missing something. Just to recapitulate:
  • Connect GND between Serial adapter and blue pill
  • Connect Rx of Serial to A9 of blue pill
  • Connect Tx of Serial to A10
  • Connect 5V of Serial to 5V of blue pill
  • Move jumper on the far side of the Reset button to the "1" position
  • Plug the Serial adapter into USB
  • Press Reset on the blue pill
  • In Cube Programmer, connect by "UART" and the proper COM port, 115200 8E1 settings
Any fault in this list?

On another track, if I will get the ST-Link V2 adapter and do have fake boards: will that ST-Link help in any way?
Post Reply

Return to “General discussion”