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

AdamB-4111 346 Reputation points
2021-07-24T22:30:29.393+00:00

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
Azure Sphere
An Azure internet of things security solution including hardware, operating system, and cloud components.
167 questions
0 comments No comments
{count} votes

Accepted answer
  1. AdamB-4111 346 Reputation points
    2021-07-25T23:07:42.69+00:00

    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)
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.