cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 flash and reset from GPIO of Raspberry PI

TClar.1
Associate

Hello, I have managed to use stm32flash to flash custom binary to the STM32 through the raspberry pi.

This involves moving BOOT0 to 0V, pressing reset and running the command.

I can also include -R to software reset the STM32 after this is finished.

I then decided to try using a GPIO from the PI to change BOOT0 from 3.3v to 0V and this also works but I still have to manually press the reset button on the bluepill

I have read the following but finding it a little hard to understand

GPIO sequence:

- entry sequence: GPIO_3=low, GPIO_2=low, GPIO_2=high

- exit sequence: GPIO_3=high, GPIO_2=low, GPIO_2=high

stm32flash -R -i -3,-2,2:3,-2,2 /dev/ttyS0

Are these GPIO pins from the Pi or from the STM32?

How do I connect this?

I thought about applying 0V to the reset pin on the STM32 but I see a capacitor is used and this is further confusing.

The reason I need this is for firmware updates to the STM32 and flashing new sketches through the Pi without the need for user input or manual pressing of the reset button

Any help would be greatly appreciated

1 REPLY 1
TClar.1
Associate

It's ok, I have worked out the problem.

Used PI GPIO but needed to be SU for it to work.

now works perfectly

Unsure if I need resistors or not