1
\$\begingroup\$

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?

asked Feb 9, 2017 at 14:27
\$\endgroup\$
4
  • \$\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\$ Commented Feb 9, 2017 at 14:36
  • \$\begingroup\$ The size is not an issue when I'm flashing from Windows. \$\endgroup\$ Commented Feb 9, 2017 at 14:39
  • \$\begingroup\$ You should describe the flashing method, implemented on the RPi. \$\endgroup\$ Commented 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\$ Commented Feb 9, 2017 at 14:52

1 Answer 1

3
\$\begingroup\$

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.

answered Feb 9, 2017 at 15:28
\$\endgroup\$
1
  • \$\begingroup\$ @sas Do not forget to accept this answer then by clicking on the tick mark. :) \$\endgroup\$ Commented Feb 10, 2017 at 7:58

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.