Unsupported Board Error With A Supported Board

Hello all,
I got the code below directly from Arduino. It’s for the MKR ENV shield, specifically. However, it was giving me library errors before, and an Unsupported Board error now. I am using the MKR WiFi 1010, which is a supported board (it is this board that I put for the project settings). What happened? All help is appreciated. Have a nice day, all!


Error ^

EDIT: There was text in yellow, and I assume those are bad?? Anyways, if anyone wants I can share that as well

We need to see the full platformio.ini and code in order to help here.

Here is the code:

#include <Arduino.h>
#include <Arduino_MKRENV.h>
#include <ArduinoIoTCloud.h>
#include <Arduino_ConnectionHandler.h>

const char THING_ID[] = "52becf2e-f0e9-4952-bd6b-8ecfd3fab868";

const char SSID[] = "NETGEAR10_5GEXT";
const char PASS[] = "XXXXXXXXXXXXXX";

float airPressure;
float humidity;
float light;
float uVIndex;
float temperature;

void initProperties()
{

  ArduinoCloud.setThingId(THING_ID);
  ArduinoCloud.addProperty(airPressure, READ, ON_CHANGE, NULL);
  ArduinoCloud.addProperty(humidity, READ, 2 * SECONDS, NULL);
  ArduinoCloud.addProperty(light, READ, 2 * SECONDS, NULL);
  ArduinoCloud.addProperty(uVIndex, READ, 2 * SECONDS, NULL);
  ArduinoCloud.addProperty(temperature, READ, 2 * SECONDS, NULL);
}

WiFiConnectionHandler ArduinoIoTPreferredConnection(SSID, PASS);

void setup()
{
  Serial.begin(9600);
  delay(1500);

  initProperties();
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);

  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();

  if (!ENV.begin())
  {
    Serial.println("Failed to initialize MKR ENV shield!");
    while (1)
      ;

    pinMode(LED_BUILTIN, OUTPUT);
  }
}

void loop()
{
  ArduinoCloud.update();
  temperature = ENV.readTemperature(FAHRENHEIT);
  humidity = ENV.readHumidity();
  airPressure = ENV.readPressure(PSI);
  light = ENV.readIlluminance(FOOTCANDLE);
  uVIndex = ENV.readUVIndex();
  Serial.println(temperature);
  Serial.println(humidity);
  Serial.println(airPressure);
  Serial.println(light);
  Serial.println(uVIndex);
  Serial.println();
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
}

And the platformio.ini file:

[env:mkrwifi1010]
platform = atmelsam
board = mkrwifi1010
framework = arduino
lib_deps = arduino-libraries/Arduino_MKRENV@^1.1.0, arduino-libraries/ArduinoIoTCloud @ ^0.11.3, arduino-libraries/Arduino_ConnectionHandler @ ^0.5.1, arduino-libraries/WiFiNINA @ ^1.8.0

There are a bunch of libraries in libdeps, but since I am not using them, they were not included (don’t know how they got there, never installed them

And when I try to go to the error in the file SSU.cpp, it says that the file does not exist.

Can you still please completely remove the .pio folder and then rebuild the project?

No okay that doesn’t solve it. The problem is that the “SSU” library is compiled in

Compiling .pio\build\mkrwifi1010\libcf9\SFU\SFU.cpp.o
C:\Users\Max\.platformio\packages\framework-arduino-samd\libraries\SSU\src\SSU.cpp:28:4: error: #error "Unsupported board!"
   #error "Unsupported board!"
    ^~~~~
__attribute__ ((section(".sketch_boot")))
unsigned char SSU_BOOT[0x8000] = {
#if defined(ARDUINO_SAMD_MKRGSM1400)
   #include "boot/mkrgsm1400.h"
#else
  #error "Unsupported board!"
#endif
};

And that library only works on the MKRGSM1400.

It is included by the ArduinoIoTCloud library though

|-- <ArduinoIoTCloud> 0.11.3
|   |-- <ArduinoECCX08> 1.3.4
|   |   |-- <Wire> 1.0
|   |-- <Wire> 1.0
|   |-- <Arduino_DebugUtils> 1.1.0
|   |-- <Arduino_ConnectionHandler> 0.5.1
|   |   |-- <WiFiNINA> 1.8.0
|   |   |   |-- <SPI> 1.0
|   |   |-- <Arduino_DebugUtils> 1.1.0
|   |-- <WiFiNINA> 1.8.0
|   |   |-- <SPI> 1.0
|   |-- <RTCZero> 1.6.0
|   |-- <ArduinoMqttClient> 0.1.5
|   |-- <SNU> 1.0.2
|   |-- <SSU> 1.0.0
|   |-- <SFU> 1.0.0

Adding

lib_ignore = SSU, SFU

to the platformio.ini fixes the problem by ignoring that library (docs).

Checking size .pio\build\mkrwifi1010\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [======    ]  63.5% (used 20804 bytes from 32768 bytes)
Flash: [=====     ]  49.7% (used 130368 bytes from 262144 bytes)
======================== [SUCCESS] Took 22.37 seconds ========================

There are no linking errors so I guess it works without it? No way of telling though without testing it.

Edit: Yeah when looking at the code

There are 3 possibilities so that’s why it finds all these libraries but only 1 is ever selected for the board

grafik

So it’s fine to ignore the two wrong ones.

Yep, that works! Thanks so much for the help! Happy holidays everyone!