Reputation: 1
I want to flash an old STM32 F103CB based flight controller with a simple led blinking program, But I can't get it to work. I get this error:
c:/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: cannot open map file C:/Users/Elève/Documents/PlatformIO/Projects/Test/.pio/build/genericSTM32F103CB/firmware.map: No such file or directory collect2.exe: error: ld returned 1 exit status [.pio\build\genericSTM32F103CB\firmware.elf] Error 1
I tried quite e lot of things. There is no spaces in the path, no strtange characters. I also added a build flag to my platformio.ini:
[env:genericSTM32F103CB]
platform = ststm32
board = genericSTM32F103CB
framework = arduino
build_flags = -Wl,-Map,${BUILD-DIR}/genericSTM32F103CB/firmware.map
But it still doesn't work. I also tried a different syntax that i've found: -W1, -Map="${BUILD-DIR}/genericSTM32F103CB/firmware.map"
, but it doesn't change anything. Each time, I've looked carefully at the selected directory during the compilation, and I can see several files being created, but sure enough, no firmware.map. So what's the issue here?
Upvotes: 0
Views: 946
Reputation: 11
I had a similar issue. The folder name was something like "ProjectName MyName" and the culprit was the SPACE character.
Upvotes: 1
Reputation: 401
[EDIT]
Solved
The user folder has an "è" character in it (non-ASCII) and that proved to be the culprit as for some reason PlatformIO couldn't find the necessary map file based on the project path that includes non-ascii characters.
So, the solution is to move the project to a folder that has a path with ASCII characters only and recompile from there (or change your PC user account name :-)
[ORIGINAL ANSWER]
It looks like the installation for the STM32 platform is not in the best shape. There is couple of things you can try:
You can trash everything there and try to recompile or with your project opened in VS Code in the side bar click the PlatformIO icon, then open Project Tasks > Full Clean (if you don't see "full clean" you should update PlatformIO or remove the files manually as I've mentioned)
This sometimes sorts things out but it could also be a more messed up issue.
I would suggest that you close your project first and then run uninstall. Then re-open the project and PlatformIO should pickup what's written in the platformio.ini (comment out the "build_flags = ...") and start re-downloading the STM32 packages.
There is a few to download so keep an eye on the progress and any error messages. If PlatformIO doesn't start to download the STM32 platform automatically then try going through the same "Platform" section and search./install from there.
If after re-installing the entire STM32 platform it's the same issue than it's a matter with the actual board definition, had that happening few times with some boards and usually the easiest way is to pick a different board from the same family.
There is of course ways of manually removing files that live in the PlatformIO installation but if it gets to that, uninstall the whole PlatformIO and start again (I had to do that on few occasions :-)
Hope this helps
Upvotes: 0