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?
-
\$\begingroup\$ 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. \$\endgroup\$sas– sas2017年02月09日 14:36:46 +00:00Commented Feb 9, 2017 at 14:36
-
\$\begingroup\$ The size is not an issue when I'm flashing from Windows. \$\endgroup\$sas– sas2017年02月09日 14:39:28 +00:00Commented Feb 9, 2017 at 14:39
-
\$\begingroup\$ You should describe the flashing method, implemented on the RPi. \$\endgroup\$Bence Kaulics– Bence Kaulics2017年02月09日 14:43:57 +00:00Commented Feb 9, 2017 at 14:43
-
1\$\begingroup\$ 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. \$\endgroup\$sas– sas2017年02月09日 14:52:24 +00:00Commented Feb 9, 2017 at 14:52
1 Answer 1
Linux thinks it's just some external storage, and holds back (caches) writes while it's mounted. You can try to
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.
If none of the above works reliably, then install openocd or texane st-link on the pi, and use that for flashing.
-
\$\begingroup\$ @sas Do not forget to accept this answer then by clicking on the tick mark. :) \$\endgroup\$Bence Kaulics– Bence Kaulics2017年02月10日 07:58:53 +00:00Commented Feb 10, 2017 at 7:58