-
Notifications
You must be signed in to change notification settings - Fork 197
Building in VScode #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
No, I didn't know about PlatformIO at the time I was playing with it. I used LPCXpresso which is NXP own free offering that you can sign up for and download. Works well. |
Thanks. Discussing this on another forum MaxGerhardt has taken a fork off this stream, and translated it to load and build in VScode with PlatformIO - Fantastic work from Max! I have forked a copy off his and it builds fine, not able to test the upload yet as I need a 3V3 UART (FTDI232) - all mine are hard wired to 5V. |
That's good news, thanks for passing it on. It cloned fine into PlatformIO and it nearly built!. It got almost to the end and failed on "arm-none-eabi-objcopy" with the very helpful message "Error 1" I can't scroll to the end of long lines in the log shell, but copying it and pasting into an editor, it looks like the failing command is: arm-none-eabi-objcopy -v -O ihex "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.hex" ; # checksum -p ${TargetChip} -d "${BuildArtifactFileBaseName}.bin""> Should those "" be there, or are they some remnant of HTTP or maybe an implicit form of a quote mark?. I'm puzzled. It seems like it is making an .elf ok, but failing on this command to make a .hex. Any ideas? I've programmed for decades in C and a bit less in C++, but I'm a complete newbie to python and not very au fait with the Linux world. |
Did you download the files as a zip, or did you load directly into vscode/platformIO via the github addon? I had loads of failures when zipping, but once I cloned it then loaded the clone copy directly into vscode it was fine. |
I've tried both ways. I just loaded it via Github again and I'm still getting the same error. I've made sure everything is updated, but it's persistent. In the console build output, at the top, it says more detail is available using the -v or --verbose option, but where?. As I say, it's building the .elf ok, but failing when trying to build the .hex. |
Sounds like an issue with your install of VScode and platformIO, as all the code and script works fine for me. One thing, to build I use the tick at the bottom towards the left to build, sometimes you can select a build in a debug state and if you haven't an emulator for the target build it doesn't work. It could be a missing dependency - you have to load some things separate to VScode such as python (I am on 3.9.1 I think) then ensure these are in the %PATH% my path is: C:\Python39\Scripts;C:\Python39;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\System32\OpenSSH;C:\Program Files\PuTTY;C:\Program Files\xLights;C:\Program Files\Git\cmd;C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2020-q4-major\bin;C:\Users"myName"AppData\Local\Microsoft\WindowsApps;C:\Users"myName"\AppData\Local\Programs\Microsoft VS Code\bin;C:\MinGW\bin;C:\MIDI\MIDI_Library-5.0.2\src Then you need to update VScode to take this in, Ctl-Shift-P and select platformIO: rebuild intellisense index. Just to check - you have installed Platform IO on top of VScode. I have the following extensions: Obviously many of these are not needed in this case, but it shows it's working with these ones |
Many thanks for taking the time for a comprehensive answer. I have been using Arduino on top of PlatformIO on top of VSCode for some time with no problems. I have the latest Python installed with it on the path as usual. I have added a couple of (non-critical I believe) extensions on your list that I did not use. I have compiler flag -DNDEBUG defined. Python must be OK as it is getting as far building a full .elf. It is the elf to hex part that is failing. If I edit fix_linkflags.py to comment out the elf to hex conversion thus 👍
Then the whole process works OK compiling with the "tick" and ending with an .elf and If I remove the commenting, clean, and build again then it fails on Building E:\DEV\VS Code\projects\T-962\T-962-improvements.pio\build\lpc2134_01/firmware.hex I think all the points you covered are OK here, somehow it is failing to do the elf->hex copy command. I need to see more detail than "Error 1". It says to add the -v or --verbose flag but I have no idea where or to what to add it. Tried it as a compiler flag and it complained. Actually, I think I just answered my own question - it probably belongs with the copy command. I'll try it. Later... Nope, verbose flag gave no extra information. |
Ah my bad, your space in the path is probably breaking the passing of the filename arguments. Let me fix that quickly. |
Can you |
It built first time, no warnings and produced a .elf, .bin and .hex. Thank you very much. I had no idea I had a space in a directory name. Must have been one of Microsoft's progs that doesn't allow you to change it. I am almost paranoid about spaces in directory or filenames! Again, thank you. Very nice contribution |
It shouldn't have been a problem if I did my homework and properly escaped paths :D. Glad that it's working now for you. I've added some additional sanity checks (e.g., building the project from a zip file and not from a |
I know there is a hex already, but as I may wish to customise the code, I would like to build the bin/hex myself.
Has anyone ported this into VScode or PlatformIO within VScode?
I prefer all my builds in the one environment.
I would be OK with building in windows, but not really looked at this - anyone done either method able to pass on their knowledge?
The text was updated successfully, but these errors were encountered: