Skip to main content
Visitor II
October 18, 2021
Question

How to upload custom firmware from CubeIDE to STM32F401CCU6 board?

  • October 18, 2021
  • 1 reply
  • 1127 views

I have a STM32F401CCU6 board with me. It has a UART bootloader option and USB_OTG_FS is in 'Device_Only' mode. The USB_DEVICE is set to 'Communication Device Class'. USART2 is enabled in Asynchronous mode.

  1. I want to flash the firmware using UART. I don't want to use SWDIO mode.
  2. The data transmission should happen through virtual com-port using USB.

I was checking AN2606 but still no success.

I have one TTL to USB converter.

Any tutorial or pointer to a forum solution would help in resolving the issue.

Best,

    This topic has been closed for replies.

    1 reply

    Super User
    October 18, 2021
    1. Hook up the USB to UART converter to pins supported by the UART bootloader per AN2606.
    2. Put the chip into bootloader mode.
    3. Program the chip using the UART bootloader commands over the relevant serial port. (Stm32CubeProgrammer can also do this.)

    If USB is connected directly to the chip, you'll need to disconnect it first to avoid the chip going into the USB DFU bootloader.