1

I am trying to make a base project for blue pill STM32F103 which I can use for multiple projects. I would like to be able to both flash the device and send commands using serial COM port using the mirco-USB port

so far I have:

  • successfully created a "hello world" flashing LED makefile based project downloaded to device using STLINK tool
  • created UART command interface to command through serial FTDI device
  • flashed a DFU bootloader onto the chip and successfully used it to flash my own (makefile compiled) bin onto the device

when using the DFU I find that once I have flashed my .bin onto the device it no longer appears as a USB device. following the article linked below I shouldn't need to modify the ROM address of my projects code, I have shortened file size to 55k in my makefile projects linker with still no success

https://os.mbed.com/users/devanlai/code/STM32F103C8T6_USBDFU/graph/ https://github.com/devanlai/dapboot/releases/tag/v0.1

my questions:

  • when using the DFU bootloader, once my code is running how is it supposed to become visible as a USB device if the usb stack is not written in in my application code?
  • Do i need to move the jumpers on the bluepill? I have tried various combinations already with no success
  • what is the best way for me to get a serial comms AND bootloader through USB in my project without writing and debugging my own unique bootloader?
Jono Moran
  • 11
  • 1
  • 4

2 Answers2

1

So if I understand your question correctly then you want to flash your MCU board with DFU over USB and to connect to an USB serial port while it is running.

This can be done as the DFU function is part of the bootloader and the USB serial port is part of your application.

The easiest way to create a virtual com port is using the STM32 CubeMX USB CDC. An video example is found here. The source code generated by CubeMX can be pulled out and added into your own project.

Tarick Welling
  • 3,119
  • 3
  • 19
  • 44
0

I afraid it will not appear anymore as the USB device, unless you implement the USB stack in your code.

what is the best way for me to get a serial comms AND bootloader through USB in my project without writing and debugging my own unique bootloader?

There is only one way - you need to have USB stack in your application.

0___________
  • 60,014
  • 4
  • 34
  • 74