Ettore Galli
Ettore Galli

Reputation: 751

Arduino-cli VSCode for raspberry pi pico: Missing file PinNamesTypes.h

Short introduction

I am starting a new project with the raspberry pi pico using arduino-cli development environment and VSCode as editor.

The problem

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.

My setup and what I have done so far

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.

My workaround

Simply creating a folder named "missing" containing an empty file made the errors disappear:

MySketch.ino
missing
 |
 PinNamesTypes.h

My concern(s) and final considerations

  1. Techincal

Did I do something wrong in setup? Could I solve this problem in a better way / made a more "clean" workaround?

  1. Effort focus

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

Answers (1)

savannahpianist
savannahpianist

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

Related Questions