PlatformIO Community

Wrong platform, even after restart

PIO doesn’t like to change boards. Whenever I switch, it takes a lot of pain to get it to stop uploading to the previous board. It seems especially hard to get it to stop uploading to ESP12, but I have no data on that.

I don’t think I’ve had trouble switching away from Uno.

Right now, I want to get it to upload to a Nano, but it’s stuck in Espressif mode.

How can I force it to upload to the correct board? It’s in the .ini file.

I looked around in the documents, but I only see port specification, no board override.

  1. Try and unload all project folders except the one you’re interested in from your workspace
  2. Open the platformio.ini of the project you’re interested in
  3. Make sure that in the project tasks window, you directly use the environment you’re interested in, if you have multiple ones
  4. You can add
[platformio] 
default_envs = your_environment_name

to the platformio.ini to redirect the “Default” environment to the correct on (docs).

Hi Joe.

In @maxgerhardt’s reply, the project tasks he mentions is shown here in the docs.

Cheers,
Norm.

Now the bottom toolbar isn’t loading.
The alien head is in the left bar, and it opens the stuff, but there’s no build, clean, nothing.

I restarted PIO, haven’t restarted the PC.

No build task.

You need a platformio.ini in the file->open folder which you currently have open to get the toolbar.

Cheers,
Norm.

The cpp and the ini file are both open with no buttons.
I removed all the folders and added one.

Blink for the R32. It stopped taking uploads, so I want to see if I can use something with no libraries.

Hi Joe,

What I do usually, is File->Open Folder and navigate to the top level where platformio.ini lives. Click ok.

As the platformio.ini file is present, at the top level, the PlatformIO toolbar appears after a few seconds.

I believe that opening a project from the PlatformIO Home page does this – but I never use that option. :astonished:

It makes no difference if you have the cpp or ini files open in the editor, the ini must be located inside the folder you have open.

If this is the case, then the Help->Developer Options Console tab is, hopefully, showing you why it can’t display the toolbar.

You could also check View->Appearance->Show Statusbar. That makes the toolbar visible or invisible.

Cheers,
Norm.

I also experience this sometime but I haven’t found a consistent setup to reproduce it.
Maybe related: Build uses an other projet

In any case an issue at https://github.com/platformio/platformio-vscode-ide/issues/ should be opened.

After seven or so openings, VSCode opened with the PIO buttons.

The folder I added a few openings ago is the only one in the files bar.

This setup seems a lot buggier than I’m used to.
It freezes a lot. Windows comes in to tell me PIO is not responding.

It refuses to stop uploading a file when it’s been closed and removed from the workspace.

In the PIO Home screen, when you create a new program, you type in the name of the file. Then you can tab to the Boards field but can’t start typing until you click into the Boards field. I don’t use the mouse when I can avoid it. That’s an oversight, not a bug.

There may be two more things I think I’ve encountered that don’t seem user-generated.

Next time, if it happens again, check this please:

  • Shut down VSCode.
  • Open task manager (right click the task bar).
  • Click the button to show more information – if it is there.
  • In “Applications” look for VSCode - it shouldn’t be there. Kill if found.
  • In “Processes” do the same.

I don’t use Windows unlessbat work, but I’ve seen this problem many times with apps not working correctly, becauseva previous incarnation crashed or didn’'t shut down when asked, leaving rogue processes around.

Might help, maybe.

Cheers,
Norm.