stlink-org / stlink

Open source STM32 MCU programming toolset
BSD 3-Clause "New" or "Revised" License
4.36k stars 1.24k forks source link

ERROR common.c: map_file() == -1 while flashing #878

Closed tdjastrzebski closed 4 years ago

tdjastrzebski commented 4 years ago

Until today everything worked. I was able to flash my STM32F769-DISCO board with no problems.
Today I installed the latest pyOCD and updated mbed utility but I am not sure if this causes the problem: ERROR common.c: map_file() == -1 while flashing. I have tried to erase the flash, update firmware, updated STLink to version 1.6 - all for nothing. After upgrade to STLink 1.6 debugging latest mbed-os version works. The problem is flashing only. OS: Windows10 I am clueless.

st-flash 1.6.0
2020-03-15T22:51:34 INFO common.c: Loading device parameters....
2020-03-15T22:51:34 INFO common.c: Device connected is: F76xxx device, id 0x10016451
2020-03-15T22:51:34 INFO common.c: SRAM size: 0x80000 bytes (512 KiB), Flash: 0x200000 bytes (2048 KiB) in pages of 2048 bytes
open($C:\Test Projects\mbed-os-example-blinky\BUILD\DISCO_F769NI\GCC_ARM-DEBUG\mbed-os-example-blinky.bin) == -1
2020-03-15T22:51:34 ERROR common.c: map_file() == -1
stlink_fwrite_flash() == -1
The terminal process terminated with exit code: 127
tdjastrzebski commented 4 years ago

Update: I was able to flash new board once today and then no success again. The problem seems to be a bit non-deterministic.

tdjastrzebski commented 4 years ago

OK, this was incorrect file name problem.