# New in 107-Arduino-Cyphal on platformio with Raspberry pi pico

**URL:** <https://forum.opencyphal.org/t/new-in-107-arduino-cyphal-on-platformio-with-raspberry-pi-pico/1953>\
**Category:** Applications & Usage\
**Created:** [August 3, 2023, 2:48pm UTC](https://forum.opencyphal.org/t/new-in-107-arduino-cyphal-on-platformio-with-raspberry-pi-pico/1953 "2023-08-03T14:48:21Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/kevin/32/1431_2.png) [@Kevin](https://forum.opencyphal.org/u/Kevin)\
**Post date:** [August 3, 2023, 2:48pm UTC](https://forum.opencyphal.org/t/new-in-107-arduino-cyphal-on-platformio-with-raspberry-pi-pico/1953/1 "2023-08-03T14:48:21Z")

</div>

Hi, I am new to this 107-Arduino-Cyphal Arduino library.  
And I am trying to compile the code just purely to include the header of “107-Arduino-Cyphal.h”

 ![image](https://forum.opencyphal.org/uploads/default/original/2X/9/9e09266d06a52cd97d713094df5538abb31dfb81.png)  
And it keeps failing to compile  
 ![image](https://forum.opencyphal.org/uploads/default/original/2X/e/ebb1687670a0f02e654e2c78e8b4a656838d67b6.png)  
This is my platformio.ini  
 ![image](https://forum.opencyphal.org/uploads/default/original/2X/0/0ea930d5b9e6e36cad84cfc9c3eca6a387094098.png)

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [August 3, 2023, 3:00pm UTC](https://forum.opencyphal.org/t/new-in-107-arduino-cyphal-on-platformio-with-raspberry-pi-pico/1953/2 "2023-08-03T15:00:18Z")

</div>

[std::span](https://en.cppreference.com/w/cpp/container/span) is not available until C++20 while you appear to be using an older version of the standard. It could be that your compiler is too old.

---

<div class="post-metadata">

**Author:** ![Kevin](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/kevin/32/1431_2.png) [@Kevin](https://forum.opencyphal.org/u/Kevin)\
**Post date:** [August 3, 2023, 4:12pm UTC](https://forum.opencyphal.org/t/new-in-107-arduino-cyphal-on-platformio-with-raspberry-pi-pico/1953/3 "2023-08-03T16:12:08Z")

</div>

How could I upgrade the compiler? I searched around the internet and can’t find a way suitable for platformio

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [August 3, 2023, 4:13pm UTC](https://forum.opencyphal.org/t/new-in-107-arduino-cyphal-on-platformio-with-raspberry-pi-pico/1953/4 "2023-08-03T16:13:20Z")

</div>

No idea. Maybe ask the platformio team.

---

<div class="post-metadata">

**Author:** ![maksim.drachov](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/maksim.drachov/32/1577_2.png) [@maksim.drachov](https://forum.opencyphal.org/u/maksim.drachov)\
**Post date:** [August 3, 2023, 4:28pm UTC](https://forum.opencyphal.org/t/new-in-107-arduino-cyphal-on-platformio-with-raspberry-pi-pico/1953/5 "2023-08-03T16:28:39Z")

</div>

General Embedded pro tip: start learning how to compile without relying on crutches (like platformIO): it won’t work (I’ve tried).

---

<div class="post-metadata">

**Author:** ![aentinger](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/aentinger/32/1428_2.png) [@aentinger](https://forum.opencyphal.org/u/aentinger)\
**Post date:** [August 4, 2023, 4:07am UTC](https://forum.opencyphal.org/t/new-in-107-arduino-cyphal-on-platformio-with-raspberry-pi-pico/1953/6 "2023-08-04T04:07:31Z")

</div>

> [@maksim.drachov](#):
>
> without relying on crutches

Now, now, let’s not be hasty 😉 . The success of the Arduino platform is based exactly on this fact, that it works out of the box without requiring the arcane knowledge that’s required to build embedded systems. Naturally there are trade-offs but - as the success of Arduino shows - there’s a value being provided here by making stuff simple.

That being said, `107-Arduino-Cyphal` works with vanilla [arduino-pico](https://github.com/earlephilhower/arduino-pico) - and I would encourage you to use just that, without whatever markup and mangling platformIO provides.

```bash
arduino-cli compile -b pico:pico:rp2040 -v MySketch

```

> [@pavel.kirienko](#):
>
> [std::span](https://en.cppreference.com/w/cpp/container/span) is not available until C++20

`arduino-pico` runs `-std=gnu++17` and provided you use the right compiler (see discussion [here](https://github.com/earlephilhower/arduino-pico/issues/1294)) everything including register API should work. I’ll do a check if they’ve shipped a new default compiler with the arduino-pico platform that may be causing this issue, but otherwise I believe its a platformIO problem.

---

<div class="post-metadata">

**Author:** ![aentinger](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/aentinger/32/1428_2.png) [@aentinger](https://forum.opencyphal.org/u/aentinger)\
**Post date:** [August 4, 2023, 4:12am UTC](https://forum.opencyphal.org/t/new-in-107-arduino-cyphal-on-platformio-with-raspberry-pi-pico/1953/7 "2023-08-04T04:12:42Z")

</div>

**Update** : 107-Arduino-Cyphal/main/HEAD [still works for](https://github.com/107-systems/107-Arduino-Cyphal/actions/runs/5473079201/job/15610634905) **arduino-pico:3.3.1**.

---

<div class="post-metadata">

**Author:** ![Kevin](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/kevin/32/1431_2.png) [@Kevin](https://forum.opencyphal.org/u/Kevin)\
**Post date:** [August 4, 2023, 6:08am UTC](https://forum.opencyphal.org/t/new-in-107-arduino-cyphal-on-platformio-with-raspberry-pi-pico/1953/8 "2023-08-04T06:08:27Z")

</div>

**Thank you for the help!**  
By default, the platformio is using `-std=gnu++14` or `-std=gnu++11` which what is needed is `-std=gnu++17`  
After applying the `platformio.ini` with exactly like this:

```auto
[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = rpipico
framework = arduino
lib_deps = 
	107-systems/107-Arduino-MCP2515@^1.4.1
	107-systems/107-Arduino-Cyphal@^3.2.1
	107-systems/107-Arduino-CriticalSection@^1.0.0

```

The platformio switch its c++ Standard to `gnu++17` and everything works:  
Maybe it’s better to mention it on the Github of `107-Arduino-Cyphal`, just to help anyone new to this to have an easier start.

 ![image](https://forum.opencyphal.org/uploads/default/original/2X/f/fe820b2c822a158091d7090a03a69da3aa347159.png)

---

<div class="post-metadata">

**Author:** ![aentinger](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/aentinger/32/1428_2.png) [@aentinger](https://forum.opencyphal.org/u/aentinger)\
**Post date:** [August 4, 2023, 7:15am UTC](https://forum.opencyphal.org/t/new-in-107-arduino-cyphal-on-platformio-with-raspberry-pi-pico/1953/9 "2023-08-04T07:15:15Z")

</div>

> [@Kevin](#):
>
> Maybe it’s better to mention it on the Github of `107-Arduino-Cyphal`, just to help anyone new to this to have an easier start.

Well, @Kevin I’m happy to receive a pull request 😉 .

EDIT: I also see that the examples header description should be updated, since the referenced boards are no longer supported. That would be another great opportunity to earn some GitHub street credentials (just sayin) 😁 .

---

<div class="post-metadata">

**Author:** ![maksim.drachov](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/maksim.drachov/32/1577_2.png) [@maksim.drachov](https://forum.opencyphal.org/u/maksim.drachov)\
**Post date:** [August 5, 2023, 10:26am UTC](https://forum.opencyphal.org/t/new-in-107-arduino-cyphal-on-platformio-with-raspberry-pi-pico/1953/10 "2023-08-05T10:26:29Z")

</div>

> [@aentinger](#):
>
> The success of the Arduino platform is based exactly on this fact, that it works out of the box without requiring the arcane knowledge that’s required to build embedded systems. Naturally there are trade-offs but - as the success of Arduino shows - there’s a value being provided here by making stuff simple.

I stand corrected. 🫡

Perhaps regarding Arduino I have this one traumatic experience where some Serial port was randomly (once every 10 minutes or so) dropping out and for the life of me I couldn’t figure out why. 😭

---

<div class="post-metadata">

**Author:** ![aentinger](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/aentinger/32/1428_2.png) [@aentinger](https://forum.opencyphal.org/u/aentinger)\
**Post date:** [August 5, 2023, 11:20am UTC](https://forum.opencyphal.org/t/new-in-107-arduino-cyphal-on-platformio-with-raspberry-pi-pico/1953/11 "2023-08-05T11:20:06Z")

</div>

> [@maksim.drachov](#):
>
> Perhaps regarding Arduino I have this one traumatic experience where some Serial port was randomly (once every 10 minutes or so) dropping out and for the life of me I couldn’t figure out why. 😭

I hope you were not using fake hardware sold via Alibaba 😜 . **Note** : I’m not talking about clones (which are copies of the actual designs not claiming to be from Arduino) but about products that claim to be authentically made by Arduino, but are in fact cheap knock-offs that often barely work. The internet is full of them.
