This project enables Silicon Labs hardware to be used with the Arduino ecosystem.
- Arduino Nano Matter
- SparkFun Thing Plus Matter MGM240P
- Silicon Labs xG24 Explorer Kit
- Silicon Labs xG24 Dev Kit
- Silicon Labs xG27 Dev Kit
- Silicon Labs BGM220 Explorer Kit
- Download and install the latest Arduino IDE (only the newer 2.x versions are supported - the legacy 1.x versions are not)
- Open the 'Settings / Preferences' window
- Open the 'Boards Manager' from the side menu and search for 'Silicon Labs'
- If it does not show up - enter
https://siliconlabs.github.io/arduino/package_arduinosilabs_index.json
in the 'Additional Boards Manager URLs' field (add a comma in between if you have multiple URLs)
- If it does not show up - enter
- Install the
Silicon Labs
platform
If you're using your board for the first time with Arduino IDE you need to burn the bootloader first. Burning the bootloader fully erases the flash memory first, then burns the bootloader. You only need to do this once during the initial setup or if you are changing Matter device types and/or want to move your device to a different Matter network.
- Select the board you have from the 'Tools > Board' menu
- Go to the 'Tools > Programmer' menu and select 'Simplicity Commander' or 'openOCD' for the Nano Matter
- After that select the 'Tools > Burn bootloader' option
- If you have trouble with flashing you may need to install the J-Link USB drivers - it's part of the J-Link Software and Documentation pack
- Verify that everything works by creating a Blink example (File > Examples > 01.Basics > Blink) and flashing it to your board
- If you see the built-in LED blinking, you're ready to go! Happy coding! 💻
Each board supports a number of different radio protocol stacks (like 'Matter', 'BLE' or 'None') which can be selected under 'Tools > Protocol stack' in the Arduino IDE.
- Selecting
Matter
will include the Matter stack - which is quite resource heavy. Selecting this is only recommended when developing Matter applications. BLE is included, but cannot be used by users as the Matter SDK takes ownership of it. Matter examples will only work with this option. - Selecting
BLE
will include the BLE stack - which is moderately resource heavy. Select this if you're developing BLE applications. BLE examples will only work with this option. - Selecting
None
will not include a radio protocol stack in your sketch - and will save a considerable amount of Flash/RAM. You can use your board as a regular Arduino without wireless hardware.
You can see the list/icon of available radio protocols for each board under currently supported hardware or by going to this menu.
The core comes bundled with the Matter
library. The library's goal is to make creating and managing Matter devices easy and user-friendly.
The library sits on top of Silicon Labs' Matter SDK which is included in the Matter protocol stack variant of the supported boards. Make sure to select Matter in the 'Tools > Protocol stack' menu to have the Matter SDK / radio stack included in your sketch.
See the docs for the Matter library here.
🛜 ezBLE
is an included Arduino library which makes sending and receiving data over BLE simple and user-friendly.
You can use it the same way as Serial to transfer data over BLE. See the full docs here.
There are some additional functions besides the standard Arduino API you can call on Silicon Labs boards:
getCPUTemp()
- returns the die temperature in CelsiussystemReset()
- issues a system reset and restarts the MCUgetDeviceUniqueId()
- returns the unique ID of the microcontrollergetDeviceUniqueIdStr()
- returns the unique ID of the microcontroller in hexadecimal as a stringgetCoreVersion()
- returns the current core version as a stringsetCPUClock()
- sets the CPU clock speed - it can be one ofCPU_40MHZ
,CPU_76MHZ
,CPU_80MHZ
getCPUClock()
- returns the current CPU speed in hertzanalogReferenceDAC()
- selects the voltage reference for the DAC hardware
All Silicon Labs boards (except for the Nano Matter) come equipped with an onboard SEGGER J-Link debugger which can be used from the Arduino IDE. In order to utilize this feature you'll need the following:
- The J-Link Software and Documentation pack installed on your system
- A debugger configuration file next to your sketch
If you'd like to debug on the Nano Matter see this chapter.
Go to the folder where your sketch is located and create a file named debug_custom.json
- and add the following content to it:
[
{
"configId": "SiliconLabs:silabs:thingplusmatter:programmer=commander",
"servertype": "jlink",
"device": "MGM240PB32VNA",
"interface": "swd",
"serverpath": "JLinkGDBServer"
}
]
This is a sample debugging configuration for the SparkFun Thing Plus Matter. You most likely need to change some values to make it work on your system and board.
Change the device
property according to the MCU on your board. Here's a table for help:
Board | MCU |
---|---|
SparkFun Thing Plus Matter MGM240P | MGM240PB32VNA |
Silicon Labs xG24 Explorer Kit | EFR32MG24B210F1536IM48 |
Silicon Labs xG24 Dev Kit | EFR32MG24B310F1536IM48 |
Silicon Labs xG27 Dev Kit | EFR32BG27C140F768IM40 |
Silicon Labs BGM220 Explorer Kit | BGM220PC22HNA |
Change the (variant name)
in the configId
property according to the FQBN (Fully Qualified Board Name) of the variant you're using:
"configId": SiliconLabs:silabs:(variant name)
:programmer=commander
Here's a table listing all the variant name
s:
Board | Variant name |
---|---|
SparkFun Thing Plus Matter | thingplusmatter |
Silicon Labs xG24 Explorer Kit | xg24explorerkit |
Silicon Labs xG24 Dev Kit | xg24devkit |
Silicon Labs xG27 Dev Kit | xg27devkit |
Silicon Labs BGM220 Explorer Kit | bgm220explorerkit |
Change the serverpath
property to the location of JLinkGDBServer on your system. JLinkGDBServer is installed with the J-Link Software and Documentation pack.
- On Windows it's usually at
C:/Program Files/SEGGER/JLink/JLinkGDBServerCL
- On Linux and macOS you can just use
JLinkGDBServer
without the full path if it's on your PATH
Make sure 'Simplicity Commander' is selected in Tools > Programmer.
You can begin a debug session by pressing the Start debugging
button in the top left corner next to the Verify and Upload buttons in the Arduino IDE.
There are two examples provided with a debugger configuration for the SparkFun Thing Plus Matter MGM240P board - one for Unix-based systems (Linux and macOS) and one for Windows.
You can find them under File > Examples > SiliconLabs > thingplusmatter_debug_unix/win.
These examples can be easily modified to work with the other boards just by changing the device
property in debug_custom.json
.
Here's the official Arduino guide on using SEGGER J-Link debuggers.
The Arduino Nano Matter comes equipped with a Atmel SAMD11 board controller which can be used to debug the main CPU.
You'll need to perform the following steps to debug on the Nano Matter:
Go to the folder where your sketch is located and create a file named debug_custom.json
- and add the following content to it:
[
{
"configId": "SiliconLabs:silabs:nano_matter:programmer=openocd",
"servertype": "openocd",
"device": "MGM240SD22VNA",
"interface": "swd",
"serverpath": "openocd"
}
]
- Make sure 'OpenOCD' is selected in Tools > Programmer.
- Compile and upload your sketch
- Press the Start Debugging button next to the Upload button
The project is under constant development and there are a few things which come with some limitations.
Bluetooth LE is available on all supported devices, however the Arduino BLE API is not supported yet. You can use BLE with Silicon Labs' own BLE API. There are a handful of examples included to demonstrate how you can create BLE devices with the Silicon Labs API. Support for the Arduino BLE API is under development and will be available in a future release.
The UART baud rate of Serial can be changed freely - however if you're using it through the USB-UART bridge then it only works with 115200 bps by default. This is because the Silicon Labs boards use an EFM32 microcontroller as a board controller/debugger/flasher/USB-UART converter and this controller has a separate configuration. If you wish to change the baud rate used through the USB-UART bridge, then you can configure the board controller to use a different speed from it's admin console. The admin console can be reached from Simplicity Studio. Use this guide to change the baud rate in the board controller. The baud rate in your sketch must match the baud rate configured in the board controller - otherwise communication won't work. This limitation does NOT affect the Arduino Nano Matter as it uses a different board controller.
Have a question or stuck somewhere? Made something cool? 🕹️ Hit us up on Reddit at r/silabs!
If you encounter an issue you can also submit it to the project issues.
Product page | Overview & guide | Pinout diagram
Product page | Overview & guide
We're encouraging the community to report any issues encountered using the core. You're also welcome to submit feature requests if you have a concrete idea on new features or improvements.
Please always use the appropriate templates when filing these in order to be accepted.
You can also open a Discussion if you have general or usability questions, or you'd like to share your project/ideas. Please, do not to open issues for general questions - always use Discussions instead.
Currently the development is in-house with each release open-sourced at publication. We're currently committed and working towards opening up the development for the community - we're going to get there soon - but unfortunately at the moment we can't yet accept community PRs into this repository. Until we open things up feel free to submit feature requests, bug reports and ideas for improvement.
If you want to clone the core and develop with it you'll need to perform a few set up steps after cloning.
The core builds on Arduino's Core-API which is a submodule of this project under extra/core-api.
First, initialize the submodules with: git submodule update --init --recursive
You'll need to create a symlink to extra/core-api/api
in the cores/silabs/
folder.
There's a script which does all this for you on macOS/Linux:
cd package
./bootstrap.sh