question

AdamB-4111 avatar image
0 Votes"
AdamB-4111 asked AdamB-4111 answered

VS Code unable to build Azure Sphere application after closed and re-opened

Hello Folks,

I'm new to the Azure Sphere development environment with VS Code and Azure Sphere extension

I'm able to use the (Shift+ Ctrl + P) "Azure Sphere: Generate New Project" command to make a Blinky program and am able to build and flash OK.

However, when I close the file and later go to re-open it, none of the commands work any more.

"F5" Build , "F7" Make, etc.

Instead I get errors saying that I haven't configured anything to work.

Sadly the "Azure Sphere" options on the Command Pallet are super limited.

Did I miss something for how I am supposed to re-open a file to have it work?

Thanks!

117623-1-f5-in-mainc.png

117588-2-f5-in-cmakelists.png


azure-sphere
1-f5-in-mainc.png (170.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AdamB-4111 avatar image
1 Vote"
AdamB-4111 answered

Self-answer: Here is the technique that I use with VS Code to avoid problems with building the code.


Clone repository steps

  1. Pull repo with git clone .git

  2. Delete file /out/CMakeCache.txt

  3. Run CMake: Clean Rebuild from command pallet

  4. Build should be successful, and ready to start making changes to main.c

  5. Flash data by going to 'Project/out/ARM-Debug' and using azsphere device sideload deploy --image-package filename.imagepackage


New Project Notes

  • Be sure .gitignore from Azure Sphere: Generate New Project has been removed.
    The /out/ folder holds important information

  • git init in the folder created by VS Code works great. No need for additional folder layer


Workarounds

  • Error of GPIO in use (etc) was fixed by by running azsphere device recover
    (probably a better way -> but works for now)






5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.