Thanks!
That solved the upload issue.
It’s a pitty that PlatformIO cannot detect the proper drive/volume automatically (similar for upload_protol embed).
I tried. This worked a few times but then again it needed upload_port to be specified again.
When using SerialUSB for printing output to the serial monitor, auto upload unfortunately does not work anymore and the Pico needs to be in BOOTSEL mode to be able to upload anything to it.
It would be useful if that could be fixed but this may be related to the design of the Pico(?).
Putting the Pico in BOOTSEL mode every time is a bit of a PITB because it has to be power cycled to reset it (due to lack of a reset button) which normally means disconnecting and reconnecting the USB connector every time.
For this reason I soldered a reset button on top of one of my Pico’s.
Luckily I’m now able to upload, but the next step is getting an existing program to run on the Pico. I currently get several compilation errors that appear not easy to fix and may possibly be related to incompatibilities in the Arduino Embed core(?).
E.g. while doing some tests I noticed that the standard SDA and SCL pin definitions are not present. Instead I2C_SDA and I2C_SCL are defined. This is a fundamental incompatibility when compared with most other Arduino cores (SPI pins are defined though).
The issues I’m currently running into seem more complex than just lacking SDA and SCL pin definitions, but latter indicates that there may be more compatibility issues with the ‘Arduino Embed’ Arduino core.
Possibly the issue is related to use of namespaces.
For instance I noticed that instead of UART one needs to specify arduino::UART.
I needed this to get a reference to SerialUSB:
arduino::UART& serial = SerialUSB;
so I can do something like
serial.println("Code does not need to know if SerialUSB or Serial");
Having to explicitly add the namespace may possibly also cause issues elsewhere, in external libraries. I’m not yet sure what is causing the problems.
The program I’m trying to run on the Pico, runs without problems on many other Arduino cores (e.g. STM32, SAMD21, ESP21, ATmega328) but for the Pico I currently get many errors when compiling.