# Flashing STM32 Nucleo from Raspberry Pi

I’m using an STM32 Nucleo board connected to a Raspberry Pi. To flash the MCU I drop a binary file to a mounted drive. The problem is that it takes a random, and sometimes long time, from the moment I drop the file to the actual moment the MCU is flashed. As a contrast, I have an instantaneous result when flashing from Windows. Is there a way to expedite the process?

• The Nucleo and RPi are parts of a robot. When its loaded, I don't have access to the USB input. When I'm flashing through the RPi, I'm able to flash wirelessly. – sas Feb 9 '17 at 14:36
• The size is not an issue when I'm flashing from Windows. – sas Feb 9 '17 at 14:39
• You should describe the flashing method, implemented on the RPi. – Bence Kaulics Feb 9 '17 at 14:43
• To elaborate on the flashing process: the Nucleo is mounted on the RPi as a flash drive to a specific folder. To actually flash it, I copy the binary file to the above mentioned folder using WinSCP. I tried copying the file from within the RPi itself with the same result. – sas Feb 9 '17 at 14:52

• umount the Nucleo interface after copying, forcing everything to be written back
• issue a sync command after copying
• mount it with -o sync to disable write caching.
The first two methods are preferred over -o sync (as long as they work), because writes are still cached until the system is told to write everything, using up fewer flash write cycles.