Arduino for programming STM32f103c8t6 board

Generic boards that are not Maple or Maple mini clones, and don't contain the additional USB reset hardware
User avatar
mrburnette
Posts: 1774
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Arduino for programming STM32f103c8t6 board

Postby mrburnette » Sun Jan 31, 2016 9:54 pm

@alfstm32:

I swapped my Windows 8.1 OS for Mint Cinnamon 17.3 and I am using the ArduinoIDE 1.7.8 and the ARM c++ tools installation from ArduinoIDE 1.6.7 after Due support is installed (I just hardcode the compiler path in the STM32 platform.txt file.) I need 1.6.7 for the ESP8266.

All of my STM32 boards are [urlhttp://www.aliexpress.com/item/leaflabs-Leaf-maple-mini-ARM-STM32-compatibility/32214664071.html]Maple Mini clones.[/url]

I've gone through maybe 15 sketches today to validate my STM32 environment, USB ports, and permissions and everything is compiling and downloading correctly.

I do remember having to chmod 0755 a couple of scripts and there was one other executable, dfu-util, I think, that needed to be set to execute.

Other than the above changes, I think everything else was non-Arduino related. One of the installation scripts for Arduino (1.0.5 I think) set the serial port permissions. I use 1.0.5 for Attiny85 stuff.

Just rereading your post and I do not notice anything obvious that you missed. Double check permissions on those 2 scripts and the dfu utility.

Ray

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

Re: Arduino for programming STM32f103c8t6 board

Postby alfstm32 » Sun Jan 31, 2016 10:10 pm

From ST LOADER ToOl ! I use the
Flash Loader Demonstrator....with 256000 baud rate...

01_setting_stdem.png
01_setting_stdem.png (25.15 KiB) Viewed 479 times


02_stm32_ok.png
02_stm32_ok.png (18.37 KiB) Viewed 479 times


03_stm32_mem_status_.png
03_stm32_mem_status_.png (28.69 KiB) Viewed 479 times

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

Re: Arduino for programming STM32f103c8t6 board

Postby alfstm32 » Sun Jan 31, 2016 10:12 pm

And for send to device :

04_stm32_send_to_device.png
04_stm32_send_to_device.png (21.53 KiB) Viewed 478 times


The result :

05_stm32_send_and_verify_ok.png
05_stm32_send_and_verify_ok.png (16.14 KiB) Viewed 478 times

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

Re: Arduino for programming STM32f103c8t6 board

Postby alfstm32 » Sun Jan 31, 2016 10:38 pm

Hi MrBurnette !

I have hardcode the compiler path in the STM32 platform.txt file like you... so after that's build work fine with all example.
I have ever verify chmod 0755... so i redo... but nothing change... I have rebuild the stm32flash in Arduino_STM32-master/tools/src/stm32flash_serial/src
And this give nothing...
Please could you say me if the stm32flash command with just your serial port set command work for you ? :

me i do for just testing stm32flash :
stm32flash /dev/ttyUSB0

from the Arduino hardware path... with rebuild version or the others one directly from git build by Melbourne...
Arduino/hardware/Arduino_STM32-master/tools/src/stm32flash_serial/src$ ./stm32flash /dev/ttyUSB0

Give me results...
**********************************************************
stm32flash Arduino_STM32_0.9

http://github.com/rogerclarkmelbourne/arduino_stm32

Interface serial_posix: 57600 8E1
Failed to read ACK byte
Unexpected reply from device on command 0x01

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

So perhaps a port access error but why because all others program can use my usbserial on /dev/ttyUSB0

And if y have well understand the
"AN2606 Application note STM32TM microcontroller system memory boot mode"

for the STM32F103XXX just the serial port bootloaders work for native.... for DFU you must have STM32F105XX....
Last edited by alfstm32 on Sun Jan 31, 2016 10:57 pm, edited 1 time in total.

zmemw16
Posts: 1082
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Arduino for programming STM32f103c8t6 board

Postby zmemw16 » Sun Jan 31, 2016 10:51 pm

@alfstm32:
your couple of posts suggest you're windows based or are you switching between?
is your linux installed in virtualbox or similar?

that arduino package is from experimental, what is the version in the splash screen or via Help/About Arduino please?

your link is a blue pill, red pills exist as well.
with lsusb, all my red and blue pills return 1eaf:000[3|4]? 1eaf i suspect is from leaf labs not Arduino
you really need to check your udev rules andmost likely run the install.sh as root after reading it.

debian testing is usually 32 bit? do a file sketchbook/hardware/Arduino_STM32/tool/linux/dfu-util/* and confirm them
as suitable for your system.
version as of 310116-1345 has 64 bit, wrong for me.

your experience with serial duplicates mine, i don't think i've ever managed to upload via serial except to one of the Arduino family, uno, nano mainly. hence if you have a st-link, it is the method i use most and the easiest. 3 wires to any variant of stm32f103 board i have.

@Ray
I swapped my Windows 8.1 OS for Mint Cinnamon 17.3 and I am using the ArduinoIDE 1.7.8 and the ARM c++ tools installation from ArduinoIDE 1.6.7 after Due support is installed (I just hardcode the compiler path in the STM32 platform.txt file.) I need 1.6.7 for the ESP8266.

I just hardcode the compiler path a wake up moment for me.
i suspect you've got the 64 bit one, so would you please also do the file ~/sketchbook/hardware/Arduino_STM32/tools/linux/dfu-utils/* ?

stephen

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

Re: Arduino for programming STM32f103c8t6 board

Postby alfstm32 » Sun Jan 31, 2016 11:10 pm

I 'm bare metal Linux.
And run the WinXXX on Virtual box...
Yes my arduino package is from experimental... on the Debian i can have package for Arduino 2 ver just with experimental...
I have ever read and execute the install.sh but i don't use a chip with a mapple firmware... so don't use this... the DFU can't run
on my chip until i burn the mapple firmware... but normally the chip must directly burn by USART1 with stm32flash with serial port.
And Debian TEsting is the XXbit you want have installed.....
My install is 64BIT.

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

Re: Arduino for programming STM32f103c8t6 board

Postby mrburnette » Sun Jan 31, 2016 11:25 pm

zmemw16 wrote:<...>

I just hardcode the compiler path a wake up moment for me.
i suspect you've got the 64 bit one, so would you please also do the file ~/sketchbook/hardware/Arduino_STM32/tools/linux/dfu-utils/* ?

stephen


Stephen:
My virgin installation of Mint did not have dfu-util installed via packages; thetefore no need to hardcode that path, IMO. I have not and the scripts are working "relative path" just fine.

Yes, I'm running 64-bit.

When I used Package Manager to install 1.0.5, the installation created ~/sketchbook but the Arduino 1.6.7 installation sketch created ~/Arduino so that is also where 1.7.8 defaults.

Ray

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

Re: Arduino for programming STM32f103c8t6 board

Postby mrburnette » Sun Jan 31, 2016 11:37 pm

alfstm32 wrote:<...>
Please could you say me if the stm32flash command with just your serial port set command work for you ? :

me i do for just testing stm32flash :
stm32flash /dev/ttyUSB0

from the Arduino hardware path... with rebuild version or the others one directly from git build by Melbourne...
Arduino/hardware/Arduino_STM32-master/tools/src/stm32flash_serial/src$ ./stm32flash /dev/ttyUSB0

Give me results...
**********************************************************
stm32flash Arduino_STM32_0.9

http://github.com/rogerclarkmelbourne/arduino_stm32

Interface serial_posix: 57600 8E1
Failed to read ACK byte
Unexpected reply from device on command 0x01

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

So perhaps a port access error but why because all others program can use my usbserial on /dev/ttyUSB0

And if y have well understand the
"AN2606 Application note STM32TM microcontroller system memory boot mode"

for the STM32F103XXX just the serial port bootloaders work for native.... for DFU you must have STM32F105XX....


alfstm32,

I am away from lab and it will likely be tomorrow before I can perform this test.

Ray

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

Re: Arduino for programming STM32f103c8t6 board

Postby alfstm32 » Sun Jan 31, 2016 11:47 pm

Many Thanks MrBurnette !
I'm trying to verify what do exactly stm32flash ...

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

Re: Arduino for programming STM32f103c8t6 board

Postby mrburnette » Mon Feb 01, 2016 2:24 pm

Hardware: dual-core Intel 2G 4G RAM
OS: Linux Mint 17.3 Cinnamon


Navigating to ~/Arduino/hardware/STM32/tools/linux/stm32flash and looking at the file permissions:

Code: Select all

-rw-r--r-- 1 ray ray 88981 Dec 10 14:57 stm32flash


I can see that the permissions have not been set to execute. Correcting that,

Code: Select all

-rwxr-xr-x 1 ray ray 88981 Dec 10 14:57 stm32flash


./stm32flash
stm32flash Arduino_STM32_0.9


My enumerated serial port is /dev/ttyACM0, therefore:

Code: Select all

./stm32flash /dev/ttyACM0
stm32flash Arduino_STM32_0.9

http://github.com/rogerclarkmelbourne/arduino_stm32

Interface serial_posix: 57600 8E1
Failed to init device.


Which is all perfectly normal, IMO, since the Maple Mini does not have the jumpers to do a serial download. Hopefully, this is helpful?

Ray


Return to “Generic STM32F103”

Who is online

Users browsing this forum: No registered users and 1 guest