Reputation: 751
I am starting a new project with the raspberry pi pico using arduino-cli development environment and VSCode as editor.
The problem is about the VSCode C/C++ extension includePath
parameter in order to make intellisense work: requires PinNamesTypes.h
as it is (indeed) a (an indirect) dependence of Arduino.h
My code compiles, uploads and runs fine (Arduino cli creates its own environment someway...).
I have searched the libraries but that file, referenced by the files:
[drivers home]/variants/RASPBERRY_PI_PICO/pinmode_arduino.h
[drivers home]/cores/arduino/as_mbed_library/pinmode_arduino.h
is not present.
Computer is Macbook Pro (M2)
I have installed arduino-cli and VSCode
The board I am developing on is Raspberry Pi Pico W
In order to install the drivers I did the following:
arduino-cli core update-index
arduino-cli core install arduino:mbed_rp2040
By trial and error (i.e. starting with including Arduino.h and then adding the folder containing each referenced file that VSCode could not find) I configured the IncludePath the following way:
[drivers home]/cores/arduino",
[drivers home]/cores/arduino/as_mbed_library",
[drivers home]/cores/arduino/mbed/hal/include",
[drivers home]/cores/arduino/mbed/targets/TARGET_RASPBERRYPI/TARGET_RP2040/**",
[drivers home]/cores/arduino/mbed/targets/TARGET_RASPBERRYPI/TARGET_RP2040/TARGET_RASPBERRY_PI_PICO",
[drivers home]/cores/arduino/mbed/targets/TARGET_RASPBERRYPI/TARGET_RP2040//pico-sdk/boards/include",
[drivers home]/cores/arduino/mbed/cmsis/CMSIS_5/CMSIS/TARGET_CORTEX_M/Include",
[drivers home]/cores/arduino/mbed/platform/include",
[drivers home]/cores/arduino/mbed/platform/cxxsupport"
where
[drivers home]=/Users/[my username]/Library/Arduino15/packages/arduino/hardware/mbed_rp2040/4.1.5
that is where the arduino-cli core install
command placed the files.
Simply creating a folder named "missing" containing an empty file made the errors disappear:
MySketch.ino
missing
|
PinNamesTypes.h
Did I do something wrong in setup? Could I solve this problem in a better way / made a more "clean" workaround?
Installing ssd1306 libraries I have a situation even worse Compiling works fine but errors on errors (abstract classes instantiated etc...)
Final consideration: Mine are not "arduino" problems but "VSCode" ones; is it worth trying to fix it or should I drop VSCode and switch to Arduino IDE?
Upvotes: 0
Views: 42
Reputation: 1
On my system,
[drivers home]/variants/RASPBERRY_PI_PICO/pinmode_arduino.h
does NOT actually have the
#include "PinNamesTypes.h"
line, whereas the
[drivers home]/cores/arduino/as_mbed_library/pinmode_arduino.h
does include this line. If I put
[drivers home]/variants/RASPBERRY_PI_PICO/
in front of
[drivers home]/cores/arduino/as_mbed_library/
in my include search, then I do not get the missing PinNamesTypes.h error.
To address your final concern, I have gotten my pico to program the ssd1306 with the u8g2 library on the Arduino IDE. I have also gotten Arduino code ported to Vs Code via the platformio extension.
Upvotes: 0