Arduino makes great hardware, but they don't always have great examples for all their different styles of hardware, so a few years ago I started putting together a ton of examples that run on the PortentaH7 with vision shield, but I am now finding many of these examples work on many other boards as well.
Latest addons WiFiSSLClient websocket dot186 here and Camera BMP to PNG to sd card dot362 here
The library is so big I had to make an indexing system to be able to find examples:
dot1: general examples,
dot22: accessories with actuators
etc, etc
I have a huge Library of examples for the Arduino Pro MBED os boards called the "Portenta Pro Community Solutions"
Just using the Arduino IDE search for "community" and it should be one of the top libraries.
The repository is here if you want to browser the examples:
A full Robotics course using some of the examples is here
Thanks @ptillisch I should have mentioned that the Seeeduino XIAO first board the SAMD21 Cortex M0+ works great with my library (Great for testing an unknown setup that might damage the Portenta since the XIAO is very cheap). I don't have any of the other XIAO boards but they may also work.
Are you using a platform with an Mbed OS-based core for that board? Or does the platform you are using have the non-RTOS core like in the "Arduino SAMD Boards (32-bits ARM Cortex-M0+)" platform?
Probably why most of my sketches work is simply that they are typical Arduino sensor connection sketches. About the only main difference (other than the obvious lack of WiFI and cool shields) is the XIAO does not have the RGB onboard LED.
That is different. Seeed Studio maintains multiple boards platforms. The one I linked above is the "Seeed nRF52 mbed-enabled Boards" platform, which provides support for the Seeed Studio XIAO nRF52840 and XIAO nRF52840 Sense boards. That was an easy win for Seeed Studio because Arduino had already created the nRF52840 core for the Nano 33 BLE boards, so Seeed only had to fork the "Arduino Mbed OS Boards" platform and make some small modifications to adapt it to their boards.
I just use the link https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json in my arduino IDE preferences. So I guess I am using a non-MBED version, however most of my code works and compiles very fast.
As I mentioned it is probably because most of the code that I teach in my course github maker100 is basic sensor and actuator setup so probably minimal MBED code is actually used. Just typical arduino sketch code. Anyway the XIAO is a cheap board for students to start with when you don't want them breaking your PortentaH7. then us the Portenta with vision shield for the advanced stuff and any edgeimpulse.com machine learning.