I ask the community to help me deal with a strange problem, details below:
Recently there was a problem with IntelliSense, it stopped working on the fly and errors appeared about “cannot open the source file” stdlib.h “(dependency of” Arduino.h “)”, before that I had not experienced such problems with PIO & VSCODE. It is not clear to me why this happened; I have not made any global changes (but updated the JRE?).
I tried to solve the problem myself, studied the existing problems and solutions discussed in the community, but have not yet achieved success.
What was done:
- at the beginning I started by removing .vscode in the project directory and restarting VSCODE
- library update
- PIO core update
- complete removal of the c: \ Users \ Derry \ .platformio directory
- reinstall vscode
- uninstall VSCODE and clean install VSCODE 1.41.0-insider (user setup)
- now I have come to the dev kernel PIO
Unfortunately this problem remained. At the same time, there are no problems with the Build Task of projects.
Below is information on a fresh installation of VSCODE:
Errors in a clean project (unfortunately errors in screenshots in Russian):
Installed Extensions:
=================== pio upgrade
pio upgrade --dev
=================== VERSION
PlatformIO
Home 3.1.0-beta.2·Core 4.1.1b3
=================== .vscode\c_cpp_properties.json
{
"configurations": [
{
"name": "!!! WARNING !!! AUTO-GENERATED FILE, PLEASE DO NOT MODIFY IT AND USE https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags"
},
{
"name": "Win32",
"includePath": [
"d:/_Arduino/_Projects/test_project_1/include",
"d:/_Arduino/_Projects/test_project_1/src",
"C:/Users/Derry/.platformio/packages/framework-arduinoavr/cores/arduino",
"C:/Users/Derry/.platformio/packages/framework-arduinoavr/variants/eightanaloginputs",
"C:/Users/Derry/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/EEPROM/src",
"C:/Users/Derry/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/HID/src",
"C:/Users/Derry/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/SPI/src",
"C:/Users/Derry/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/SoftwareSerial/src",
"C:/Users/Derry/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/Wire/src",
"C:/Users/Derry/.platformio/packages/tool-unity",
""
],
"browse": {
"limitSymbolsToIncludedHeaders": true,
"path": [
"d:/_Arduino/_Projects/test_project_1/include",
"d:/_Arduino/_Projects/test_project_1/src",
"C:/Users/Derry/.platformio/packages/framework-arduinoavr/cores/arduino",
"C:/Users/Derry/.platformio/packages/framework-arduinoavr/variants/eightanaloginputs",
"C:/Users/Derry/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/EEPROM/src",
"C:/Users/Derry/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/HID/src",
"C:/Users/Derry/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/SPI/src",
"C:/Users/Derry/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/SoftwareSerial/src",
"C:/Users/Derry/.platformio/packages/framework-arduinoavr/libraries/__cores__/arduino/Wire/src",
"C:/Users/Derry/.platformio/packages/tool-unity",
""
]
},
"defines": [
"PLATFORMIO=40101",
"ARDUINO_AVR_NANO",
"F_CPU=16000000L",
"ARDUINO_ARCH_AVR",
"ARDUINO=10805",
"__AVR_ATmega328P__",
""
],
"intelliSenseMode": "clang-x64",
"cStandard": "c11",
"cppStandard": "c++11",
"compilerPath": "\"C:/Users/Derry/.platformio/packages/toolchain-atmelavr/bin/avr-gcc.exe\" -mmcu=atmega328p"
}
],
"version": 4
}
=================== src\main.cpp
#include <Arduino.h>
void setup()
{
int a = 1;
int b = 2;
int c = a + b;
}
void loop()
{
// put your main code here, to run repeatedly:
}
=================== platformio.ini
;PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:nanoatmega328new]
platform = atmelavr
board = nanoatmega328new
framework = arduino
=================== BUILD
> Executing task: C:\Users\Derry\.platformio\penv\Scripts\platformio.exe run <
Processing nanoatmega328new (platform: atmelavr; board: nanoatmega328new; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/nanoatmega328new.html
PLATFORM: Atmel AVR 1.15.0 > Arduino Nano ATmega328 (New Bootloader)
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 30KB Flash
PACKAGES: toolchain-atmelavr 1.50400.190710 (5.4.0), framework-arduinoavr 4.1.2
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 5 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\nanoatmega328new\src\main.cpp.o
Archiving .pio\build\nanoatmega328new\libFrameworkArduinoVariant.a
Compiling .pio\build\nanoatmega328new\FrameworkArduino\CDC.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\HardwareSerial.cpp.o
src\main.cpp: In function 'void setup()':
src\main.cpp:8:7: warning: unused variable 'c' [-Wunused-variable]
int c = a + b;
^
Compiling .pio\build\nanoatmega328new\FrameworkArduino\HardwareSerial0.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\HardwareSerial1.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\HardwareSerial2.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\HardwareSerial3.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\IPAddress.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\PluggableUSB.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\Print.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\Stream.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\Tone.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\USBCore.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\WInterrupts.c.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\WString.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\abi.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\hooks.c.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\main.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\new.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\wiring.c.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\wiring_analog.c.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\wiring_digital.c.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\wiring_pulse.S.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\wiring_pulse.c.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\wiring_shift.c.o
Archiving .pio\build\nanoatmega328new\libFrameworkArduino.a
Linking .pio\build\nanoatmega328new\firmware.elf
Building .pio\build\nanoatmega328new\firmware.hex
Checking size .pio\build\nanoatmega328new\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 0.4% (used 9 bytes from 2048 bytes)
Flash: [ ] 1.4% (used 444 bytes from 30720 bytes)
================================================================================================= [SUCCESS] Took 3.19 seconds
=================== pio settings get
Name Current value [Default] Description
------------------------- -------------------------------------------- --------------------------------------------------------
auto_update_libraries No Automatically update libraries (Yes/No)
auto_update_platforms No Automatically update platforms (Yes/No)
check_libraries_interval 7 Check for the library updates interval (days)
check_platformio_interval 3 Check for the new PlatformIO interval (days)
check_platforms_interval 7 Check for the platform updates interval (days)
enable_cache Yes Enable caching for API requests and Library Manager
enable_telemetry Yes Telemetry service <http://bit.ly/pio-telemetry> (Yes/No)
force_verbose No Force verbose output when processing environments
projects_dir C:\Users\Derry\Documents\PlatformIO\Projects Default location for PlatformIO projects (PIO Home)
strict_ssl No Strict SSL for PlatformIO Services
=================== pio platform list
atmelavr ~ Atmel AVR
====================
Atmel AVR 8- and 32-bit MCUs deliver a unique combination of performance, power efficiency and design flexibility. Optimized to speed time to market-and easily adapt to new ones-they are based on the industrys most code-efficient architecture for C and assembly programming.
Home: http://platformio.org/platforms/atmelavr
Frameworks: arduino, simba
Packages: toolchain-atmelavr, framework-arduinoavr, framework-simba, tool-avrdude, tool-micronucleus
Version: 1.15.0
espressif8266 ~ Espressif 8266
==============================
Espressif Systems is a privately held fabless semiconductor company. They provide wireless communications and Wi-Fi chips which are widely used in mobile devices and the Internet of Things applications.
Home: http://platformio.org/platforms/espressif8266
Frameworks: arduino, esp8266-nonos-sdk, esp8266-rtos-sdk, simba
Packages: framework-esp8266-rtos-sdk, toolchain-xtensa, framework-simba, tool-esptool, tool-mkspiffs, tool-esptoolpy, framework-arduinoespressif8266, framework-esp8266-nonos-sdk
Version: 2.2.3
=================== pio init --ide vscode
The current working directory D:\_Arduino\_Projects\test_project_1 will be used for the project.
The next files/directories have been created in D:\_Arduino\_Projects\test_project_1
include - Put project header files here
lib - Put here project specific (private) libraries
src - Put project source files here
platformio.ini - Project Configuration File
Project has been successfully updated including configuration files for `vscode` IDE.
=================== ERRORS:
Обнаружены ошибки #include. Измените includePath. Волнистые линии отключены для этой единицы трансляции (D:\_Arduino\_Projects\test_project_1\src\main.cpp).
не удается открыть источник файл "stdlib.h" (dependency of "Arduino.h")
=================== Search results:
$ find /cygdrive/c/Users/Derry/.platformio -name stdlib.h
/cygdrive/c/Users/Derry/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include/machine/stdlib.h
/cygdrive/c/Users/Derry/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include/stdlib.h
/cygdrive/c/Users/Derry/.platformio/packages/toolchain-atmelavr/avr/include/stdlib.h
/cygdrive/c/Users/Derry/.platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/4.8.2/tr1/stdlib.h
/cygdrive/c/Users/Derry/.platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/machine/stdlib.h
/cygdrive/c/Users/Derry/.platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/stdlib.h