Linux: flashing own STM32F103C8T6 generic USB bootloader not much luck

Hypercube
Fri Apr 28, 2017 11:36 pm
Hi,

I built my own STM32F103C8T6 board and used Linux tools under Ubuntu 14.04 to flash the board
~/Arduino/hardware/Arduino_STM32/tools/linux/stlink$ ./st-flash write generic_boot20_pc13.bin 0x08000000
Seems to flash OK, I tried a few more binaries from here:
https://github.com/rogerclarkmelbourne/ … 1/binaries

But after flashing, the USB does not register as ttyACM0 when it is plugged in.
I know the USB works because I have some C software I built using ST’s AC6 compiler
and when I flash it with that, then it does register as ttyACM0, and I can see regular serial data coming
out of it in the Arduino IDE serial monitor.

(As an aside, I can also program Arduino blink project to the board using STLink upload method
and it works! Amazing! So many moving parts come together to make it happen! :shock: )

So where can I start / what I can do to make STM32duino-bootloader work?

Is it possible I misunderstood something – i.e. that I need to do something to the board to activate
the USB loader software by setting boot pins?


victor_pv
Sat Apr 29, 2017 12:56 am
The bootloader will not enumerate as a serial port, only as a DFU device.
When you load a sketch and the sketch starts, the sketch code will emulate a serial device.

Pito
Sat Apr 29, 2017 5:50 am
Do you have got the d+ usb switch (via 1k5 to Vcc) on your board?

ag123
Sat Apr 29, 2017 6:23 am
compile and install a sketch from roger’s f1 core https://github.com/rogerclarkmelbourne/Arduino_STM32
usb is initialized and enumerated by the sketch itself
make sure that the define SERIAL_USB is there in platforms.txt specified as a compile flag

run lsusb

with a sketch in a normal boot you would see 1eaf:0004 – serial usb device
if you connect into the dfu or ‘perpetual boot loader mode’ you would see 1eaf:0003 dfu boot loader
in the dfu mode you can install a sketch using dfu-util
http://www.stm32duino.com/viewtopic.php?f=22&t=1958
http://www.stm32duino.com/viewtopic.php … 0&start=10


Hypercube
Sat Apr 29, 2017 8:16 am
Pito wrote:Do you have got the d+ usb switch (via 1k5 to Vcc) on your board?

Hypercube
Sat Apr 29, 2017 8:51 am
victor_pv wrote:The bootloader will not enumerate as a serial port, only as a DFU device.
When you load a sketch and the sketch starts, the sketch code will emulate a serial device.

Pito
Sat Apr 29, 2017 9:32 am
Where in the stm32duino environment did you a change to reflect the 12MHz Xtal?

Hypercube
Sat Apr 29, 2017 11:04 am
Pito wrote:Where in the stm32duino environment did you a change to reflect the 12MHz Xtal?

victor_pv
Sat Apr 29, 2017 7:56 pm
Hypercube wrote:Pito wrote:Where in the stm32duino environment did you a change to reflect the 12MHz Xtal?

Hypercube
Sun Apr 30, 2017 12:07 am
victor_pv wrote:
If you select STLink as upload method then the Serial device is the USART1, not the USB.
Try loading the bootloader to the board, then upload using bootloader method, otherwise try SerialUSB.begin, SerialUSB.print etc.

Pito
Sun Apr 30, 2017 12:26 am
There is a binary for bootloader with 12MHz Xtal – try it
#elif defined TARGET_STBEE
https://github.com/rogerclarkmelbourne/ … 1/binaries

victor_pv
Sun Apr 30, 2017 3:49 am
Hypercube wrote:victor_pv wrote:
If you select STLink as upload method then the Serial device is the USART1, not the USB.
Try loading the bootloader to the board, then upload using bootloader method, otherwise try SerialUSB.begin, SerialUSB.print etc.

Hypercube
Sun Apr 30, 2017 4:40 pm
Pito wrote:There is a binary for bootloader with 12MHz Xtal – try it
#elif defined TARGET_STBEE
https://github.com/rogerclarkmelbourne/ … 1/binaries

Leave a Reply

Your email address will not be published. Required fields are marked *