Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 4 months ago.
STM Nucleo "No space left on device" when copying binary to /media/*/NUCLEO under Linux
Hello, I'm developing on the NUCLEO-F401RE under Linux using 'gcc-arm-none-eabi' for building. When built, I simply copy the .bin file to /media/*/NUCLEO/ for flashing. This usually works, but eventually it has done a full round of overwriting flash and then I get:
Flashing failing:
cp -f *.bin /media/*/NUCLEO/ cp: error writing '/media/xxx/NUCLEO/xxx.bin': No space left on device cp: failed to extend '/media/xxx/NUCLEO/xxx.bin': No space left on device
This is the size of the program:
131588 Aug 12 13:15 xxx.bin 583459 Aug 12 13:15 xxx.elf 370199 Aug 12 13:15 xxx.hex 2782097 Aug 12 13:15 xxx.map
After I unplug, reset the nucleo and plug back in again it works for a while. Any idea on how I can fix this otherwise?
Hi, can I ask if you're using linux in a virtual machine or natively?
posted by Brian Daniels 12 Aug 2015Natively.
To be more precise, I had this problem already during an early stage, where my program was still very small. I noticed that, the bigger the program became, the more frequent this problem occurs. Therefore, I concluded, that by copying the bin file to a freshly mounted Nucleo board, it starts by writing it to the beginning of the flash memory. With each subsequent copy, it seems to delete the old, but starts writing the new where the old had ended. This is good for the lifetime of the flash memory. However, there seems to be a bug when it reaches the flash’s size (the end), which causes it to freeze. Only a cold start seems to fix this (whereupon it starts at the beginning again). Those are my two cents.
posted by L. Volpato 13 Aug 2015I'm avoiding this problem now by using st-flash from https://github.com/texane/stlink
In my case, it works like this:
st-flash example:
As a nice side-effect the tool also gave me information about the flash layout of my NUCLEO-F401RE (I used >500KB of trash for this):
st-flash output for the NUCLEO-F401RE:
Conclusion: The bug still exists, but there's a way around it.
posted by L. Volpato 14 Aug 2015FYI, i just realize that after remount the board, the memory is flushed. so i can flash it using mbed compile -f again. sure... st-flash is amazing with st-utils debug command, but the parameter is too long to type.
posted by Ibn Hidayat 27 Sep 2019