Menu

#126 Raspberry UART and STM32F4xx MCU

none
Invalid
nobody
None
Medium
Other
2021-09-03
2020-12-12
No

Hi everyone,

After follow the installation procedure available in:
https://siliconjunction.wordpress.com/2017/03/21/flashing-the-stm32f-board-using-a-raspberry-pi-3/
Erase the line in the config and etc.

I tried to flash my STM32F4xx MCU using UART (pins PC11 and PC10).

Connections:
(checked with multimeter)
BOOT0: 3.3V
BOOT1: 0V
STM32 with 3.3V(external source)
Raspberry Pi GND (pin 6) to STM32 GND
Raspberry Pi TX (pin 8) to STM32 RX (pin PC11)
Raspberry Pi RX (pin 10) to STM32 TX (pin PC10)

Procedure:
Set BOOT0 to 1;
Do a pulse in the reset pin.
Try to communicate.

Command used( to get the mcu information):
$stm32flash /dev/ttyS0

and nothing happens!

I tried to use
stm32flash -v -w myProgram.bin /dev/serial0

The prompt says:
Error probing interface "serial_posix"

If i try to use "sudo"
The prompt says:
Interface serial_posix 57600 8E1

Failed to init device.

In the other hand, i used a USB/TTL device, with flash GUI demonstrator, using the same pins, and it works fine.

Anyone have some suggestion for me?

Thank you for attention !

Discussion

  • Tormod Volden

    Tormod Volden - 2021-01-19
    • summary: stm32flash for STM32F4xx MCU --> Raspberry UART and STM32F4xx MCU
     
  • Tormod Volden

    Tormod Volden - 2021-01-19

    What is "flash GUI demonstrator"? Can you please try stm32flash with your USB-UART adapter?

    I guess the problem you have is setting up the Raspberry UART so that it can be used reliably as a serial port.

     
  • Tormod Volden

    Tormod Volden - 2021-01-23
    • Milestone: 0.5 --> none
     
  • Allan Oliveira Lopes

    Hi ! Thank you for the answer.

    The flash GUI demonstrator is the free software provided by STM to flash the microcontrollers.
    https://www.st.com/en/development-tools/flasher-stm32.html

    I tried to use USB-UART adapter, and it worked.

    I would like have another way to do the flash programming.
    Raspberry pi is a nice tool to do this things !

    Do you have any ideia? :(

    Best regards.

     

    Last edit: Allan Oliveira Lopes 2021-01-27
  • Tormod Volden

    Tormod Volden - 2021-09-03

    If your chip has a I2C bootloader you can try that instead of a serial port. Pinout on RPi: https://pinout.xyz/pinout/i2c#

    You can also use the USB bootloader on F4 devices, with for instance dfu-util.

    Note that the "mini UART" on the RPI doesn't support parity, so it cannot be used with the STM32 bootloaders. On the RPi3 you will need to use /dev/ttyAMA0 which is normally connected to the Bluetooth module. See e.g. https://www.circuits.dk/setup-raspberry-pi-3-gpio-uart/

     
  • Tormod Volden

    Tormod Volden - 2021-09-03
    • status: New --> Invalid
    • Type: Defect --> Other
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB