linuxraspberry-pistm32microcontrollerstm32f4

Flashing STM32f401CCU6 with binary file with Raspberry PI


I have STM32 which is gathering data from different sensors and reporting that data to Raspberry PI over Serial connection. On Raspberry PI is a service which is reporting that data to a server over the internet.

The problem i have is updating the running code on STM32 from Raspberry PI. What i would like to do is a service on Raspberry PI which downloads the latest bin file from remote repository and flashes the STM32 with downloaded bin file.

Is this even possible to do? Can i flash the stm32 over usb without pulling BOOT0 to high? Can i connect the devices (Raspberry and stm32) any other way to flash stm32 without physically pulling BOOT0 to high?

Any suggestions will be helpful :)

I have tried with dfu-util but with that tool for Raspberry PI to recognise attached STM32 over usb i have to physically pull BOOT0 to high which i can't because it would be physically away from me.


Solution

  • You can use Serial Wire Debug/JTAG port. SWD is only 3 pins: SWDIO, SWCLCK and GND. In case it's disabled - you have to enable it by programming the fuse.

    Nice project about Rpi/OpenOCD/GDB/SWD