Arduino for programming STM32f103c8t6 board

Generic boards that are not Maple or Maple mini clones, and don't contain the additional USB reset hardware
moc
Posts: 5
Joined: Tue Dec 29, 2015 6:25 pm

Re: Arduino for programming STM32f103c8t6 board

Post by moc » Tue Dec 29, 2015 8:47 pm

Hey Ray,
Thanks for that quick reply!
I use a bidirectional logic converter like this one here: http://www.aliexpress.com/item/1PCS-IIC ... 13805.html - is that okay? The "bidirectional" makes me think it is but I am a electronic newbie...

I just tried to flash the .bin file "by hand" via cmd.exe and the stm32flash.exe but I got the same result: "Failed to init device..."
For me it seems like there is something wrong with the CH340G driver...
Or do I block the CH340 somehow with pulling RESET LOW on the Arduino?

fredbox
Posts: 95
Joined: Tue Jul 07, 2015 4:44 pm

Re: Arduino for programming STM32f103c8t6 board

Post by fredbox » Wed Dec 30, 2015 12:04 am

Do a loopback test with PuTTY to make sure that your USB/Serial adapter is working. Try various baud rates up to 230400.

Make sure that the boot jumpers are set correctly. For serial upload, set BOOT0=1 and BOOT1=0. Your code should run automatically once the upload completes. You will need to press reset before each upload attempt. For normal operation (your program runs at reset) set both boot jumpers to 0.

You can also try the STM Flashloader Demonstrator GUI and see if it recognizes the device. I believe this is the right one.

User avatar
mrburnette
Posts: 1877
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Arduino for programming STM32f103c8t6 board

Post by mrburnette » Wed Dec 30, 2015 12:32 am

moc wrote: <...>The "bidirectional" makes me think it is but I am a electronic newbie...
<...>

Cart before the horse...
1) Do a loopback test

2) Read:
https://learn.sparkfun.com/tutorials/logic-levels
And
https://learn.sparkfun.com/tutorials/voltage-dividers

As stated previously, you do not need level-conversion from 3.3V out (send) to 5.0V in (receive)

You do not need bi-directional level-conversion from 5V out (send) to 3.3V in (receive)

For reasonable BAUD rates, 9600-19.2KB, a resistor divider generally works.

You will findmany uses for bi-directional level conversion with I2C devices, etc. Your investment was well spent, just a bit premature.

Now on a personal note: we are NOT the Arduino.cc forum and you will not be hand-held, which is to say you are in an advanced forum BUT newbies are welcome- but you are going up a very steep hill. Start reading and educating yourself on basic electronics; many good tutorials are just a Google away. Lots of great folks are here and it is a pleasure to ++1.

Ray

My Junk

fredbox
Posts: 95
Joined: Tue Jul 07, 2015 4:44 pm

Re: Arduino for programming STM32f103c8t6 board

Post by fredbox » Wed Dec 30, 2015 12:59 am

From the STM32F103C8 datasheet, PA9 and PA10 are both listed as 5V tolerant, so a level converter should not be needed.

User avatar
mrburnette
Posts: 1877
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Arduino for programming STM32f103c8t6 board

Post by mrburnette » Wed Dec 30, 2015 1:01 am

fredbox wrote:From the STM32F103C8 datasheet, PA9 and PA10 are both listed as 5V tolerant, so a level converter should not be needed.
Agreed...
But for a newbie, it is good practice.

Ray

fredbox
Posts: 95
Joined: Tue Jul 07, 2015 4:44 pm

Re: Arduino for programming STM32f103c8t6 board

Post by fredbox » Thu Dec 31, 2015 12:58 am

My nano clone with a ch340 does not appear to work in loopback mode.
The RX and TX leds blink, but nothing appears on the display.
This may not be a viable option for uploading to a blue pill.

Serial works as expected on the nano with a sketch loaded.

User avatar
mrburnette
Posts: 1877
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Arduino for programming STM32f103c8t6 board

Post by mrburnette » Thu Dec 31, 2015 1:34 pm

fredbox wrote:My nano clone with a ch340 does not appear to work in loopback mode.
The RX and TX leds blink, but nothing appears on the display.
This may not be a viable option for uploading to a blue pill.

Serial works as expected on the nano with a sketch loaded.
Thanks for performing a test. I have a box of Nano clones and I was going to give it a try, but I've been sidetracked on my cheap Android playing.

The issue with using a UNO as a USB-serial interface has always troubled me... USB-serial adapters are very inexpensive and should be a stable on every electronic workbench. And, while the UNO has been documented as being able to do the USB-serial in many articles, I have not seen the same for the Nano... but it may work.

Ray

Fabricio
Posts: 1
Joined: Fri Jan 29, 2016 10:37 pm

Re: Arduino for programming STM32f103c8t6 board

Post by Fabricio » Fri Jan 29, 2016 10:53 pm

hello,I recently I began with stmf103c8t6 module, but when testing the most basic code deblink me the following error appeared:
Arduino:1.6.7 (Windows 7), Placa:"Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), Serial"

WARNING: Category '' in library OneWireSTM is not valid. Setting to 'Uncategorized'
WARNING: Category '' in library RTClock is not valid. Setting to 'Uncategorized'
WARNING: Category '' in library SPI is not valid. Setting to 'Uncategorized'
WARNING: Category '' in library Serasidis_EtherCard_STM is not valid. Setting to 'Uncategorized'
WARNING: Category '' in library Serasidis_VS1003B_STM is not valid. Setting to 'Uncategorized'
WARNING: Category '' in library Serasidis_XPT2046_touch is not valid. Setting to 'Uncategorized'
Atención: platform.txt del núcleo 'STM32 Boards (STM32duino.com)' contiene recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}" desfasada, automáticamente convertida a recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}". Considera el actualizar este núcleo.
In file included from C:\Users\xxxx\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\cores\maple/Arduino.h:30:0,

from sketch\Blink.ino.cpp:1:

C:\Users\xxxx\Documents\Arduino\hardware\Arduino_STM32-master\STM32F1\cores\maple/wirish.h:51:28: fatal error: libmaple/stm32.h: No such file or directory

#include <libmaple/stm32.h>

^

compilation terminated.

exit status 1
Error de compilación

Este informe podría tener más información con
"Mostrar salida detallada durante la compilación"
activala desde Archivo > Preferencias


please your help for this error.

User avatar
Rintin
Posts: 16
Joined: Sat Jan 23, 2016 11:20 am

Re: Arduino for programming STM32f103c8t6 board

Post by Rintin » Fri Jan 29, 2016 11:00 pm

Please try Arduino 1.6.5
#legalizeawoo

alfstm32
Posts: 7
Joined: Sun Jan 31, 2016 3:01 am

Re: Arduino for programming STM32f103c8t6 board

Post by alfstm32 » Sun Jan 31, 2016 9:22 pm

Hi all !

Many thanks for all work done. Working with stm32 with arduino is very very cool stuff.

But I want to try it. So I buy the aliexpress minimal board same as :

http://www.rogerclark.net/wp-content/up ... 32Mini.jpg

So it's a STM32F103C8T6.
I work under linux debian testing. I have install the last github stm32duino on arduino 2:1.5.6.2+sdfsg2d-3.
And programming with it doesn't work. and give :

*******************************************************************
Failed to init device.
stm32flash Arduino_STM32_0.9

http://github.com/rogerclarkmelbourne/arduino_stm32

Using Parser : Raw BINARY
Interface serial_posix: 230400 8E1
******************************************************************

Or :
******************************************************************
Failed to read ACK byte
Unexpected reply from device on command 0x01
stm32flash Arduino_STM32_0.9

http://github.com/rogerclarkmelbourne/arduino_stm32

Using Parser : Raw BINARY
Interface serial_posix: 230400 8E1

******************************************************************

I have done some test in command line with stm32flash from src give by Roger clark melbourne or by stm32flash 0.4 on source forge.
Same problem... I have try with several baud rate.. very slow to avoid high transmission problem... same result ???
I have test my usb serial adapter ch340 which one work very good for all my arduino atmega328 cards...so i'm ok with usbserial ! It's absolutely working.

So after some search some say's "" Ok, the ST loader Tool never fails and is all I use to flash firmware. ""
Hi all !

Many thanks for all work done. Working with stm32 with arduino is very very cool stuff.

But I want to try it. So I buy the aliexpress minimal board same as :

http://www.rogerclark.net/wp-content/up ... 32Mini.jpg

So it's a STM32F103C8T6.
I work under linux debian testing. I have install the last github stm32duino on arduino 2:1.5.6.2+sdfsg2d-3.
And programming with it doesn't work. and give :

*******************************************************************
Failed to init device.
stm32flash Arduino_STM32_0.9

http://github.com/rogerclarkmelbourne/arduino_stm32

Using Parser : Raw BINARY
Interface serial_posix: 230400 8E1
******************************************************************

Or :
******************************************************************
Failed to read ACK byte
Unexpected reply from device on command 0x01
stm32flash Arduino_STM32_0.9

http://github.com/rogerclarkmelbourne/arduino_stm32

Using Parser : Raw BINARY
Interface serial_posix: 230400 8E1

******************************************************************

I have done some test in command line with stm32flash from src give by Roger clark melbourne or by stm32flash 0.4 on source forge.
Same problem... I have try with several baud rate.. very slow to avoid high transmission problem... same result ???
I have test my usb serial adapter ch340 which one work very good for all my arduino atmega328 cards...
So i'm ok with it ! It's absolutely working.

So after some search some say's "" Ok, the ST loader Tool never fails and is all I use to flash firmware. ""
from forum :
http://www.rcgroups.com/forums/showthread.php?t=2454682

So i try STLOADER TOOL with Virtualbox
... so Start a VM on virtualbox with Win10... install ST loader tool... attach the Usb serial adapter and at First Time
the Chip is detect.....
I send the blink.bin just compile in tmp directory by arduino ide to ST loader tool from my linux host to the VM Win machine.
Send program to the chip and the LED start to Blink....

So it seems thats problems really come from STM32FLASH .
Because i program the IC on the same computer with the same usb port than the VM is sending on with ST TOOL... So all hardware is good...and my hardware setting are good...(boot0 boot1 setting... wire connection...and so and so).

My linux setting udev rules etc must be good because I can send to arduino uno or others...

Did Someone have found good result with this chip on LInux arduino ide and stm32duino install ?
Because it's very painfull to have to load the binary to a virtual machine with ST TOOLS....

Many thanks ! have a nice day.

Post Reply