Problem programming Blue Pill using an Arduino Mega

User avatar
RogerClark
Posts: 7460
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Blue Pill - Error trying to program

Post by RogerClark » Thu Sep 07, 2017 1:04 am

Can you explain how you are using your Arduino Mega as a USB to Serial converter ?

Are you taking the pins (I think D0 and D1) to the STM32 PA9 and PA10
(I'm not sure if D0 goes to PA9 or PA10 as I can't recall which is which on the Mega etc)

csnol
Posts: 15
Joined: Thu Aug 24, 2017 12:57 pm

Re: Blue Pill - Error trying to program

Post by csnol » Thu Sep 07, 2017 8:31 am

I think you should use ST Flash Loader Demonstrator to upload the STM32F103-PC13.bin bootloader first.
Image

csnol
Posts: 15
Joined: Thu Aug 24, 2017 12:57 pm

Re: Blue Pill - Error trying to program

Post by csnol » Thu Sep 07, 2017 8:39 am

If still error, maybe some wrong on PA9/PA10 of your BP. or use USB-TTL or STLINK try again.

FreD
Posts: 6
Joined: Mon Sep 04, 2017 7:20 pm

Re: Blue Pill - Error trying to program

Post by FreD » Sat Sep 09, 2017 12:46 am

Arduino mega2560 has an 8u2 micro running as usb2serial converter.
I kept the mega2560 IC on reset. and use pins 0 and 1 of arduino as TX and RX, it is marked the other way around on the pcb, because it says what is this pin for the mega and not the 8u2. It works fine to flash the arduino pro mini, also works as loop back.

I am not sure if the 5v on the serial makes any difference for the stm but I found on the datasheet it is 5v tolerant.

I am really curious to understand what my mistake is.

User avatar
RogerClark
Posts: 7460
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Blue Pill - Error trying to program

Post by RogerClark » Sat Sep 09, 2017 1:17 am

Which PC software are you using.

STM's own "Flash Loader Demonstrator" is the most reliable

I think I managed to get it to upload to using a UNO as a USB to Serial converter by running the Multi software serial example sketch

However it would only work at one baud rate (which I think was the fairly slow, e.g. somewhere in the 30k - 60k range)

I think parity can be a problem with the Arduino Uno etc,- it was definitely a problem when I tried using the Multi software serial , but it could be software serial which was the issue in that case

Post Reply