Giter Club home page Giter Club logo

arduino's Introduction

Silicon Labs Arduino Core

This project enables Silicon Labs hardware to be used with the Arduino ecosystem.

Currently supported hardware:

SparkFun ThingPlus Matter MGM240P xG27 Dev Kit xG24 Explorer Kit BGM220 Explorer Kit

Installation

  • Download and install the latest Arduino IDE
  • Go to the Settings menu
  • 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)
  • Open the 'Boards Manager' from the side menu and search for 'Silicon Labs'
  • Install the 'Silicon Labs' platform

Getting started

If you're using your board for the first time with Arduino IDE you need to burn the bootloader first.

  • Select the board you have from the 'Tools > Board' menu
  • Go to the 'Tools > Programmer' menu and select 'Simplicity Commander'
  • 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!

Variants

Each supported board has a number of different variants depending on the protocol stack used and whether the included SDK is precompiled or not. For example the xG24 Explorer Kit has the following four variants:

  • xG24 Explorer Kit (BLE) - Bluetooth Low Energy variant
  • xG24 Explorer Kit (BLE) (precomp) - Bluetooth Low Energy variant with a precompiled SDK
  • xG24 Explorer Kit (Matter) - Matter variant
  • xG24 Explorer Kit (Matter) (precomp) - Matter variant with a precompiled SDK

This naming scheme applies to all other boards as well. When developing applications for a certain protocol make sure the correct variant is selected.

The precomp and regular variants produce the same binary at the end - however the precompiled SDK variants offer a much faster compilation speed, but debugging on them is limited on the SDK part.

Matter library

Matter

The core comes bundled with the Matter library. The library's goal is to make using Matter, creating and managing devices easy and user-friendly.

The library sits on top of Silicon Labs' Matter SDK which is included in the (Matter) variants of the boards that support the protocol. Make sure to select the (Matter) variant of the board you're using Matter with to have the SDK required by the library included.

See the docs for the Matter library here.

ezBLE

ezBLE is an Arduino library which makes sending and receiving data over BLE super simple. It provides the same API as Serial and handles connections, discovery, data transfer, and all BLE tasks in the background. It's compatible with all Silicon Labs BLE hardware.

You can use it the same way as Serial to transfer data over BLE. You'll need at least two devices, one acting as a server and one as a client. Once the connection is established the communication is bidirectional, each device can send and receive data from each other over BLE.

Initialize it as client or server:

ezBLE.beginClient()

or

ezBLE.beginServer()

You can optionally name your ezBLE nodes to separate them from others. The client and the server will both look for the configured name and connect to each other:

ezBLE.beginClient("myCustomEzBleName")
ezBLE.beginServer("myCustomEzBleName")

Wait for the connection to establish:

while(!ezBLE.connected());

Send data:

ezBLE.println("Hello, BLE!")

Receive data:

while(ezBLE.available()) {
  Serial.print((char)ezBLE.read());
}

The ezBLE library is shipped with the core, no need to download it separately. See the included examples for full code.

Additional APIs

There are some additional functions besides the standard Arduino API you can call on Silicon Labs boards:

  • getCpuTemp() - returns the die temperature in Celsius
  • systemReset() - issues a system reset and restarts the MCU
  • getMcuUniqueId() - returns the unique ID of the microcontroller
  • getMcuUniqueIdStr() - returns the unique ID of the microcontroller in hexadecimal as a string
  • getCoreVersion() - returns the current core version as a string
  • setCPUClock() - sets the CPU clock speed - it can be one of CPU_40MHZ, CPU_76MHZ, CPU_80MHZ
  • getCPUClock() - returns the current CPU speed in hertz
  • analogReferenceDAC() - selects the voltage reference for the DAC hardware

Debugging

All Silicon Labs boards 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:

Debugger configuration file

Go to the folder where your sketch is located and create a file named debug_custom.json - and add the following content to it:

{
    "servertype": "jlink",
    "device": "EFR32MG24B210F1536IM48",
    "interface": "SWD",
    "serverpath": "JLinkGDBServer"
}

This is a sample debugging configuration for the xG24 Explorer Kit. 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 ThingPlus Matter MGM240P MGM240PB32VNA
xG27 Dev Kit EFR32BG27C140F768IM40
xG24 Explorer Kit EFR32MG24B210F1536IM48
BGM220 Explorer Kit BGM220PC22HNA

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

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 ThingPlus 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.

Limitiations

The project is under constant development and there are a few things which come with some limitations.

Bluetooth LE API

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.

USB-UART baud rate

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.

Uploading firmware to multiple devices

As of now the included programmer utility cannot distinguish between multiple devices based on their serial ports. This means that you can only have one board connected at a time in order for programming to be successful.

Questions and help

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.

Resources for the supported boards

SparkFun ThingPlus Matter MGM240P

Product page | Overview & guide

Pinout diagram

xG27 Dev Kit

Product page | User guide

Pinout diagram

xG24 Explorer Kit

Product page | User guide

Pinout diagram

BGM220 Explorer Kit

Product page | User guide

Core development

We use uncrustify to ensure consistent code formatting.

Use the config under package/uncrustify.cfg to automatically adhere to formatting rules.

Silabs <3 Arduino

Made with ❤️ at Silicon Labs

arduino's People

Contributors

silabs-bozont avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino's Issues

[Feature Request] [Matter] Window Covering Support

I have a project which with the current list of clusters supported in matter would be best represented as a window closure setting a position on the lift control. Therefore thought I'd throw the feature request out.

(I do have shorter term workarounds)

DeviceCommissioned when it isn't

I am using Apple HomeKit.
Adding to HomeKit works

If for some reason (added another matter temperature sensor). I remove the matter device from Apple HomeKit,
the sketch code thinks it is still commissioned...

To add the board back to Apple HomeKit again, I have to flash the board using the commander app

Now I can add the board to Apple HomeKit. (again)

Something to fix in the matter code update??

Cannot get ezBLE.connected() == TRUE

I'm running ezBLE examples on a BGM220 Explorer kit.
The sketch gets stuck in the loop
while (!ezBLE.connected()) ;
I'm connecting to the BGM explorer kit using a smartphone running Apps for Bluetooth debugging like EFR Connect and nRF Connect.
Tested with bonding and without bonding, nothing changes, it looks like the board/sketch does not detect the connection.
Should I install a specific stack using Simplicity Studio?

declaration of delay() is not compatible with C language

Core version: 1.0.0
Variant:          BGM220 Explorer Kit

Let's take this simple sketch and built it for BGM220 Explorer Kit target:

$ ls delay_test/
delay_test_c.c  delay_test.ino

$ cat delay_test/delay_test.ino

extern "C" void my_func();

void setup()
{
  delay(10);

  my_func();
}

void loop() { }

$ cat delay_test/delay_test_c.c

void my_func()
{
  delay(10);
}

Build of this sketch gives a linker failure

$ export BOARD=SiliconLabs:silabs:bgm220explorerkit

$ arduino-cli  compile -v --build-path=/tmp/arduino -b "$BOARD" delay_test

< ... skipped ... >

/home/codespace/.arduino15/packages/SiliconLabs/tools/gcc-arm-none-eabi/12.2.rel1/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld: /tmp/arduino/sketch/delay_test_c.c.o: in function `my_func':
/workspaces/codespaces-blank/C6/delay_test/delay_test_c.c:3: undefined reference to `delay'
collect2: error: ld returned 1 exit status


Used platform      Version Path
SiliconLabs:silabs 1.0.0   /home/codespace/.arduino15/packages/SiliconLabs/hardware/silabs/1.0.0

We can see that declaration of delay() is not compatible with GNU-C language:
https://github.com/SiliconLabs/arduino/blob/main/cores/silabs/wiring.h#L74

When delay() function declaration is this one:

#ifdef __cplusplus
extern "C"{
#endif

void delay(uint32_t ms);

#ifdef __cplusplus
} // extern "C"
#endif

- the build of this sketch is doing good.

It makes sense to consider update declaration of other Arduino functions compatible with C language like ArduinoCore-API does:
https://github.com/arduino/ArduinoCore-API/blob/master/api/Common.h

Wrong Commander_linux_x86_64_1v14p5b1276 for Linux

The https://siliconlabs.github.io/arduino/package_arduinosilabs_index.json mentions Commander_linux_x86_64_1v14p5b1276 with the wrong extension, zip.

                {
                    "version": "1.14.5",
                    "name": "simplicitycommander",
                    "systems": [
                        {
                            "host": "x86_64-pc-linux-gnu",
                            "url": "https://github.com/SiliconLabs/arduino/releases/download/1.0.0/Commander_linux_x86_64_1v14p5b1276.zip",
                            "archiveFileName": "Commander_linux_x86_64_1v14p5b1276.zip",
                            "checksum": "SHA-256:9c81f401ff38d0eb8719389ea570ba3880852d099b6c8b9495c375cc442e0e9b",
                            "size": "58726426"
                        }
                    ]
                }

The correct address is https://github.com/SiliconLabs/arduino/releases/download/1.0.0/Commander_linux_x86_64_1v14p5b1276.tar.bz with tar.bz.

Not able to commission lightbulb_color example code

I followed the following steps for matter_lightbulb.

Erased the flash chip using Simplicity Studio. ( to erase previously stored commission data )
update bootloader code using burn bootloader.
programmed matter_lightbulb example code.
commissioned matter device using alexa mobile app and echo 4th gen.
Tested with alexa mobile app and echo, worked as expected.
for matter_lightbulb_color example

Followed step 1 and step 2.
programmed matter_lightbulb_color example code.
commissioned failed, in alexa app it is asking to select thread border router to commission but in the device serial print says "device commissioned".
Not able to understand the issue. repeated above mentioned steps multiple times. same result.

Arduino IDE 2.3.2. SparkFun Thing Plus Matter - MGM240P no output in serial monitor

Hi.
I have the issue with Arduino IDE
Arduino IDE.
I uploaded the Matter lightbulb example to SparkFun Thing Plus Matter - MGM240P board.
Burn bootloader using Simplicity Commander programmer, the bootloader file looks right:
C:\Users\xxxx\AppData\Local\Arduino15\packages\SiliconLabs\hardware\silabs\1.0.0/bootloaders/sparkfun-thingplus-matter-bootloader-storage-internal-single-512k.hex

But nothing output in Serial monitor or Putty, I tried 'help, config, onboardingcode none, Enter key' - nothing.

When I uploaded the code and bootloader using Simplicity IDE, I connected through the Putty and it was responding to commands. And was able to add device to Google Home app.

I prefer to use Arduino IDE. Please advise.
ildus

What means 'Attribute is dirty' in the Matter implementation?

Hi,

Could you tell me what means 'Attribute is dirty' in the Matter implementation?
I see a lot of this type of message in the logs.

Logs from MatterFan

00> [00:00:43.743][detail][EM] Found matching exchange: 17597r, Delegate: 0x20008934
00> [00:00:43.743][detail][EM] Rxd Ack; Removing MessageCounter:260359174 from Retrans Table on exchange 17597r
00> [00:00:43.743][info  ][IM] Received status response, status is 0x00
00> [00:00:43.743][detail][DMG] <RE> OnReportConfirm: NumReports = 0
00> [00:00:43.743][detail][DMG] IM RH moving to [GeneratingReports]
00> [00:00:43.744][detail][DMG] Building Reports for ReadHandler with LastReportGeneration = lu DirtyGeneration = lu
00> [00:00:43.744][detail][DMG] <RE:Run> Cluster 35, Attribute b is dirty
00> [00:00:43.744][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_000B ([00:00:43.745][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_000D (expanded=1)
00> [00:00:43.745][detail][DMG] <RE:Run> Cluster 35, Attribute e is dirty
00> [00:00:43.754][detail][DMG] <RE:Run> Cluster 35, Attribute 25 is dirty
00> [00:00:43.754][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_0025 (expanded=1)
00> [00:00:43.755][detail][DMG] <RE:Run> Cluster 35, Attribute 26 is dirty
00> [00:00:43.755][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_0026 (expanded=1)
00> [00:00:43.755][detail][DMG] <RE:Run> Cluster 35, Attribute 27 is dirty
00> [00:00:43.755][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_0027 (expanded=1)
00> [00:00:43.756][detail][DMG] <RE:Run> Cluster 35, Attribute 28 is dirty
00> [00:00:43.756][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_0028 (expanded=1)
00> [00:00:43.756][detail][DMG] <RE:Run> Cluster 35, Attribute 29 is dirty
00> [00:00:43.756][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_0029 (expanded=1)
00> [00:00:43.756][detail][DMG] <RE:Run> Cluster 35, Attribute 2a is dirty
00> [00:00:43.7[00:00:43.760][error ][DL] _WriteThreadNetworkDiagnosticAttributeToTlv failed: Error CHIP:0x0000000B
00> [00:00:43.760][error ][DMG] Error retrieving data from clusterId: 0x0000_0035, err = b
00> [00:00:43.760][detail][DMG] <RE:Run> We cannot put more chunks into this report. Enable chunking.
00> [00:00:43.761][detail][DMG] <RE:Run> first cluster event is too big so that it fails to[00:00:43.877][detail][IN] UDP Message Received packet nb : 9 SrcAddr : fda9:150:8b20:0:2194:5663:f84e:513d[57265] DestAddr : fda9:150:8b20:0:490e:e563:ccbc:62d[5540] Payload Length 42
00> [00:00:43.878][info  ][EM] >>> [E:17597r S:25169 M:150817906 (Ack:260359175)] (S) Msg RX from 1:00000000212740BC [FE0B] --- Type 0001:01 (IM:StatusResponse)
00> [00:00:43.878][detail][EM] Found matching exchange: 17597r, Delegate: 0x20008934
00> [00:00:43.878][detail][EM] Rxd Ack; Removing MessageCounter:260359175 from Retrans Table on exchange 17597r
00> [00:00:43.878][info  ][IM] Received status response, status is 0x00
00> [00:00:43.878][detail][DMG] <RE> OnReportConfirm: NumReports = 0
00> [00:00:43.878][detail][DMG] IM RH moving to [GeneratingReports]
00> [00:00:43.879][detail][DMG] Building Reports for ReadHandler with LastReportGeneration = lu DirtyGeneration = lu
00> [00:00:43.879][detail][DMG] <RE:Run> Cluster 35, Attribute 31 is dirty
00> [00:00:43.879][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_0031 [00:00:43.880][detail][DMG] <RE:Run> Cluster 35, Attribute 34 is dirty
00> [00:00:43.880][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_0034 (expanded=1)[00:00:43.891][detail][DMG] <RE:Run> Cluster 35, Attribute 3b is dirty
00> [00:00:43.891][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_003B (expanded=1)
00> [00:00:43.894][detail][DMG] <RE:Run> Cluster 35, Attribute 3c is dirty
00> [00:00:43.897][detail][DMG] <RE:Run> Cluster 35, Attribute 3d is dirty
00> [00:00:43.894][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_003C (expanded=1)
00> [00:00:43.897][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_003D (expanded=1)
00> [00:00:43.900][detail][DMG] <RE:Run> Cluster 35, Attribute 3e is dirty
00> [00:00:43.900][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_003E (expanded=1)
00> [00:00:43.901][detail][DMG] <RE:Run> Cluster 35, Attribute fffc is dirty
00> [00:00:43.901][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_FFFC (expanded=1)
00> [00:00:43.901][detail][DMG] <RE:Run> Cluster 35, Attribute fffd is dirty
00> [00:00:43.901][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_FFFD (expanded=1)
00> [00:00:43.902][detail][DMG] <RE:Run> Cluster 35, Attribute fff8 is dirty
00> [00:00:43.902][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_FFF8 (expanded=1)
00> [00:00:43.902][detail][DMG] <RE:Run> Cluster 35, Attribute fff9 is dirty
00> [00:00:43.902][detail][DMG] Reading attribute: Cluster=0x0000_0035 Endpoint=0 AttributeId=0x0000_FFF9 (expanded=1)
00> [00:00:43.903][detail][DMG] <RE:Run> Cluster 35, Attribute fffb is dirty
00> [[00:00:43.910][info  ][EM] <<< [E:17597r S:25169 M:260359176 (Ack:150817906)] (S) Msg TX to 1:00000000212740BC [FE0B] --- Type 0001:05 (IM:ReportData)
00> [00:00:43.911][info  ][IN] (S) Sending msg 260359176 on secure session with LSID: 25169
00> [00:00:43.912][detail][DMG] IM RH moving to [AwaitingReportResponse]
00> [00:00:43.912][detail][DMG] <RE> ReportsInFlight = 1 with readHandler 0, RE has more messages
00> [00:00:44.002][detail][IN] UDP Message Received packet nb : 10 SrcAddr : fda9:150:8b20:0:2194:5663:f84e:513d[57265] DestAddr : fda9:150:8b20:0:490e:e563:ccbc:62d[5540] Payload Length 42
00> [00:00:44.003][info  ][EM] >>> [E:17597r S:25169 M:150817907 (Ack:260359176)] (S) Msg RX from 1:00000000212740BC [FE0B] --- Type 0001:01 (IM:StatusResponse)
00> [00:00:44.004][detail][EM] Found matching exchange: 17597r, Delegate: 0x20008934
00> [00:00:44.004][detail][EM] Rxd Ack; Removing MessageCounter:260359176 from Retrans Table on exchange 17597r
00> [00:00:44.004][info  ][IM] Received status response, status is 0x00
00> [00:00:44.004][detail][DMG] <RE> OnReportConfirm: NumReports = 0
00> [00:00:44.004][detail][DMG] IM RH moving to [GeneratingReports]
00> [00:00:44.004][detail][DMG] Building Reports for ReadHandler with LastReportGeneration = lu DirtyGeneration = lu
00> [00:00:44.005][detail][DMG] <RE:Run> Cluster 3e, Attribute 0 is dirty
00> [00:00:44.005][detail][DMG] Reading attribute: Cluster=0x0000_003E Endpoint=0 AttributeId=0x0000_0000 [00:00:44.006][detail][DMG] <RE:Run> Cluster 3e, Attribute 1 is dirty
00> [00:00:44.006][detail][DMG] Reading attribute: Cluster=0x0000_003E Endpoint=0 AttributeId=0x0000_0001 (expanded=1)
00> [00:00:44.115][detail][IN] UDP Message Received packet nb : 11 SrcAddr : fda9:150:8b20:0:2194:5663:f84e:513d[57265] DestAddr : fda9:150:8b20:0:490e:e563:ccbc:62d[5540] Payload Length 42
00> [00:00:44.116][info  ][EM] >>> [E:17597r S:25169 M:150817908 (Ack:260359177)] (S) Msg RX from 1:00000000212740BC [FE0B] --- Type 0001:01 (IM:StatusResponse)
00> [00:00:44.116][detail][EM] Found matching exchange: 17597r, Delegate: 0x20008934
00> [00:00:44.117][detail][EM] Rxd Ack; Removing MessageCounter:260359177 from Retrans Table on exchange 17597r
00> [00:00:44.117][info  ][IM] Received status response, status is 0x00
00> [00:00:44.117][detail][DMG] <RE> OnReportConfirm: NumReports = 0
00> [00:00:44.117][detail][DMG] IM RH moving to [GeneratingReports]
00> [00:00:44.117][detail][DMG] Building Reports for ReadHandler with LastReportGeneration = lu DirtyGeneration = lu
00> [00:00:44.117][detail][DMG] <RE:Run> Cluster 3e, Attribute 4 is dirty
00> [00:00:44.118][detail][DMG] Reading attribute: Cluster=0x0000_003E Endpoint=0 AttributeId=0x0000_0004 [00:00:44.119][detail][DMG] <RE:Run> Cluster 3e, Attribute 5 is dirty
00> [00:00:44.119][detail][DMG] Reading attribute: Cluster=0x0000_003E Endpoint=0 AttributeId=0x0000_0005 (expanded=1)
00> [00:00:44.129][detail][DMG] <RE:Run> Cluster 40, Attribute fff8 is dirty
00> [00:00:44.129][detail][DMG] Reading attribute: Cluster=0x0000_0040 Endpoint=0 AttributeId=0x0000_FFF8 (expanded=1)
00> [00:00:44.129][detail][DMG] <RE:Run> Cluster 40, Attribute fff9 is dirty
00> [00:00:44.129][detail][DMG] Reading attribute: Cluster=0x0000_0040 Endpoint=0 AttributeId=0x0000_FFF9 (expanded=1)
00> [00:00:44.129][detail][DMG] <RE:Run> Cluster 40, Attribute fffb is dirty
00> [00:00:44.130][detail][DMG] Reading attribute: Cluster=0x0000_0040 Endpoint=0 AttributeId=0x0000_FFFB (expanded=1)
00> [00:00:44.130][error ][DMG] Error retrieving data from clusterId: 0x0000_0040, err = b
00> [00:00:44.130][detail][DMG] <RE:Run> We cannot put more chunks into this report. Enable chunking.
00> [00:00:44.131][detail][DMG] Fetched 0 events
00> [00:00:44.131][detail][DMG] <RE> Sending report (payload has 990 bytes)...
00> [00:00:44.132][info  ][EM] <<< [E:17597r S:25169 M:260359178 (Ack:150817908)] (S) Msg TX to 1:00000000212740BC [FE0B] --- Type 0001:05 (IM:Repor[00:00:44.133][detail][DMG] IM RH moving to [AwaitingReportResponse]
00> [00:00:44.133][detail][DMG] <RE> ReportsInFlight = 1 with readHandler 0, RE has more messages
00> [00:00:44.242][detail][IN] UDP Message Received packet nb : 12 SrcAddr : fda9:150:8b20:0:2194:5663:f84e:513d[57265] DestAddr : fda9:150:8b20:0:490e:e563:ccbc:62d[5540] Payload Length 42
00> [00:00:44.243][info  ][EM] >>> [E:17597r S:25169 M:150817909 (Ack:260359178)] (S) Msg RX from 1:00000000212740BC [FE0B] --- Type 0001:01 (IM:StatusResponse)

Please add Matter contact sensor

Could a contact sensor be added to the Matter library?
A contact sensor can trigger push notifications, which can be very useful in some scenario's.

pulseIn measures incorrectly

The pulseIn function should measure the time from the requested state to the opposite of the requested state. The current code starts at the opposite of requested state.

Matter and bluetooth simultaneously

I bought a Sparkfun Thing Plus Matter. And I love it!
One thing I'd like to use it for is to make a device, that has a bluetooth interface, Matter compatible. In this scenario the Thing would expose the Matter interface to Homekit and simultaneously it would communicate with de device I mentioned over bluetooth (BLE).
I'm using the Arduino IDE to develop this "man in the middle" scenario.

But this doesn't seem to be feasible. It looks like the Thing either supports Matter over Thread or it supports Bluetooth.

Is that correct? And, if so, why is that?

Issue with debugging

I am using the blinky example on the BGM220 Explorer kit. Build and link, upload and run work fine.

When trying to debug according to the procedure,

[2024-01-13T17:34:00.769Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
JLinkGDBServer -singlerun -nogui -if SWD -port 50000 -swoport 50001 -telnetport 50002 -device BGM220PC22HNA
[2024-01-13T17:34:05.970Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

The debug_custom.json file contains

{
  "servertype": "jlink",
  "device": "BGM220PC22HNA",
  "interface": "SWD",
  "serverpath": "JLinkGDBServer"
}

The installed JLinkGDBServer version is

SEGGER J-Link GDB Server V7.94d Command Line Version
JLinkARM.dll V7.94d (DLL compiled Jan 11 2024 09:42:08)

on

Linux NUC-12 6.1.0-17-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.69-1 (2023-12-30) x86_64 GNU/Linux

However, Simplicity Studio debugs fine.

What am I missing? Thank you!

Issue while burning the bootloaded

Hi,

I have the xG24 Explorer kit, I am trying to burn one example code into the kit but facing multiple issues.

  1. Not able to burn the Bootloader
    image

Config
image

debug_custom.json contents

{ "servertype": "jlink", "device": "EFR32MG24B210F1536IM48", "interface": "SWD", "serverpath": "C:\Program Files\SEGGER\JLink_V794e\JLinkGDBServerCL" }

Please help me to try the examples

Some constants are not defined

I couldn't find some constants like π, ½π, e, among others in Arduino.h.

#define PI 3.1415926535897932384626433832795
#define HALF_PI 1.5707963267948966192313216916398
#define TWO_PI 6.283185307179586476925286766559
#define DEG_TO_RAD 0.017453292519943295769236907684886
#define RAD_TO_DEG 57.295779513082320876798154814105
#define EULER 2.718281828459045235360287471352

Compilation fails with an error.

sketch_feb25a.ino:3:15: error: 'PI' was not declared in this scope; did you mean 'SPI'?

Nothing happening here!

Hello All,

3 months ago the version 1.0.0 has been dropped at Github. Since then not much is happening at Github. I got some examples workings Silicon Labs xG24 exlorer kit boards. Today I received the Sparkfun Thingsplus Matter boards. I would love to go forward!!!!

But the https://siliconlabs.github.io/arduino/package_arduinosilabs_index.json link only gives me acces to 1.0.0.

At the https://docs.arduino.cc/tutorials/nano-matter/user-manual/ I can se that there is already a version 1.1.2.

Al I can read here is wait! But why? An open source project who is death for 3 months is not a great start. And this shows to me that You don’t share code at all.

So is this a real open source project? Or -in name only- for messages in the press who are nice for shareholders, not for makers.

Bye,
Screenshot 2024-04-04 at 16 27 00

Guus

Sleepy End Devices?

Hi,

first of all I would like to thank you for this great software library. All examples work wonderfully with both a Homepod mini and an OpenThread Border Router.

I'm trying to make a sensor node (temperature and humidity) as a sleepy end device. I have set
#define CHIP_DEVICE_CONFIG_ENABLE_SED true in my arduino code, but I get a compiler error
/Arduino15/packages/SiliconLabs/hardware/silabs/1.0.0/variants/thingplusmatter_matter/matter_2.1.1/src/platform/silabs/CHIPDevicePlatformConfig.h:121:10: fatal error: sl_matter_sleepy_config.h: No such file or directory 121 | #include <sl_matter_sleepy_config.h>

Are sleepy end devices not yet supported by the arduino core or do I miss something?
Thank You in advance
Stefan

Matter over Thread

I am on a Mac Computer. Love the MGM240P board. Going thru the different Matter examples. I also have some EveHome devices with the Eve app on my ipad. The Eve app scans for Thread devices. It does NOT find the MGM240P board!
Current Library is NOT matter over thread?????

How to reset/remove Matter commisioning

Hi,
Is there a method in the Matter library to remove all the fabrics from the device and reset to the initial pairing state?
Couldn't see anything in the docs, an reflashing still finds the stored fabrics.

Matter fan/thermostat : Initializing OpenThread stack issue

Matter fan issue

I build the matter fan matter_fan.ino example for xG24 Explorer Kit.
After flashing program and bootloader and reboot the board it remains at the 'Initializing OpenThread stack' step:

RTT log

[00:00:00.000][silabs ]==================================================
[00:00:00.000][silabs ]Arduino Matter device starting
[00:00:00.000][silabs ]==================================================
[00:00:00.000][silabs ]Init CHIP Stack
[00:00:00.000][silabs ]Initializing OpenThread stack

Screenshot

image

Can you help me correct this issue?

Context

I tried the ligh example with Simplicity studio and it worked fine.

[Feature request] support for xG21 target(s)

Current version of the Core ( 1.0.0 ) contains support for a few xG22, xG24 and xG27 targets.
However, xG21 is not in the list.

Please, consider to add support for xG21 in the upcoming versions of the Core.
Thank you!

Debuging with Arduino IDE 2.3.0 fails

Debuging with Arduino IDE fails with this error even if I followed this guide:
https://github.com/SiliconLabs/arduino?tab=readme-ov-file#debugger-configuration-file

Invalid servertype parameters. The following values are supported: "jlink", "openocd", "stlink", "stutil", "pyocd", "bmp", "pe", "qemu", "external"

debug_custom.json

{
    "servertype": "jlink",
    "device": "MGM240PB32VNA",
    "interface": "SWD",
    "serverpath": "C:/Program Files/SEGGER/JLink_V794d/JLinkGDBServerCL.exe"
}

Env

  • Arduino IDE version: 2.3.0

image

Please Add Door Lock (0x000A)

I am designing a latch style lock for my shed and I would like to use Arduino / Matter. I think this is a cool use of Matter / Matter over Thread if possible. There is a door lock example in connectedhomeip
/connectedhomeip/examples/lock-app/

Minimal Viable Product:
ID: 0x000A
setLockState : Lock/Unlock
getDoorState: Door Open/Closed
readBattLevel: Battery Level
Tamper Alert

Secondary (Complex) Phases
Keypad
RFID
Users

OneWire ... DS18B20 problem. on my Silicon Labs MGM240P using Matter library

DS19B20_test.txt
Trying to make Matter sketch with two DS18B20 probes

OneWire oneWire(ONE_WIRE_BUS); // libary installed by DallasTemperature
DallasTemperature sensorsDS18B20(&oneWire); //. libary DallasTemperature by Miles Burton

If I put these lines before setup(), the sketch hangs and never gets to the setup function.
If I put these lines in the setup(),

sensorsDS18B20.requestTemperatures();
Serial.print(sensorsDS18B20.getTempFByIndex(0));

returns -196.60 about 1/2 of the time,
returns the correct temperature from the DS18B20 sensor the rest of the time.

I tried different DS18B20 sensors. (that work on ESP32 sketch)

Trying to figure out how to use the debugger with the lines before the setup() function???
OneWire Library has a bug in it? The MGM240P board has a bug? causes the line " OneWire oneWire(ONE_WIRE_BUS); " to hang????

attached is small program. Same problem on SparkFun ThingPlus Matter MGM240P, no matter code envolved

[Feature request] BridgedDeviceBasicInformation cluster

Hi,

Can you add BridgedDeviceBasicInformation cluster to your examples?
This makes it possible to present a comprehensible device name in the user interface.

List of currently defined clusters

Code (dec) Code (hex) Name
3 0x03 Identify
4 0x04 Groups
.. .. ...
57 0x39 BridgedDeviceBasicInformation
59 0x3B Switch

BridgedDeviceBasicInformation

Here's an example for this cluster:

        "7/57/5": "Hue dimmer salon",
        "7/57/17": true,
        "7/57/2": 4107,
        "7/57/1": "Signify Netherlands B.V.",
        "7/57/3": "RWL021",
        "7/57/10": "1.1.28573",
        "7/57/18": "115dc69142c249e1a217447262f98823",
        "7/57/14": "Hue dimmer switch",
        "7/57/65532": 0,
        "7/57/65533": 1,
        "7/57/65528": [],
        "7/57/65529": [],
        "7/57/65531": [
          5,
          17,
          2,
          1,
          3,
          10,
          18,
          14,
          65528,
          65529,
          65531,
          65532,
          65533
        ]

Excessive use of RAM by certain static objects

Core version: 1.0.0
Variant:          BGM220 Explorer Kit

Let's take this simple sketch and built it for BGM220 Explorer Kit target:

extern "C" void * _sbrk   (int);

static uint32_t BGM220_getFreeHeap()
{
  char top;
  return &top - reinterpret_cast<char*>(_sbrk(0));
}

void setup()
{
  Serial.begin(38400);

  Serial.print("Free Heap = "); Serial.println(BGM220_getFreeHeap());
  Serial.flush();
}
void loop() { }

We can see that this simple 'hello world' kind of sketch consumes 19392 bytes (59%) out of 32 KBytes RAM available in the BGM220.

Sketch uses 222668 bytes (42%) of program storage space. Maximum is 524288 bytes.
Global variables use 19392 bytes (59%) of dynamic memory, leaving 13376 bytes for local variables. Maximum is 32768 bytes.

These are the static objects of the sketch that consume most of RAM space:

$ arm-none-eabi-nm -n --size-sort sketch.elf | grep ' B ' | tail -12

00000050 B nvm3_defaultHandleData
00000050 B xQueueRegistry
00000058 B ADC
00000064 B mbedtls_psa_slots_mutex
00000084 B sl_spidrv_usart_mikroe_handle_data
00000090 B PWM
000000c0 B ll_scan
000000c0 B SPI
00000108 B Serial
00000110 B bg_pool_pools
00000138 B __sf
0000013c B Wire

$ arm-none-eabi-nm -n --size-sort sketch.elf | grep ' b ' | tail -12

00000140 b Timer_Stack.0
00000150 b context_vcom
00000188 b RAILINT_f5d6bd4b87b830444924423a67685a3c
00000200 b gpioCallbacks
00000200 b ll_radioTxBuffer
00000200 b RAIL_DefaultRxFifo
00000280 b Idle_Stack.2
00000320 b defaultCache
00000400 b _ZL18arduino_task_stack
00000460 b pxReadyTasksLists
00000800 b sl_stack
00001400 b ucHeap

To reproduce

$ arduino-cli config add board_manager.additional_urls https://siliconlabs.github.io/arduino/package_arduinosilabs_index.json 
$ arduino-cli core install SiliconLabs:[email protected]
$ export BOARD=SiliconLabs:silabs:bgm220explorerkit
$ arduino-cli compile -v --build-path=/tmp/arduino_silabs -b "$BOARD" <path-to-sketch-folder>

How to erase board flash memory

Hello,

I would like to erase my Sparkfun ThingPlus Matter board flash memory.
I can't find how to do it in the README page. Could you tell me how?

Actually when I flash and run matter_temp_sensor.ino the device is already commissioned and I can't reset it.

20:20:55.466 -> Matter flow sensor
20:20:55.855 -> Waiting for network connection...
20:20:56.040 -> Device connected
20:21:05.796 -> Current flow: 0.00 m3/h
20:21:15.799 -> Current flow: 0.50 m3/h
20:21:25.794 -> Current flow: 1.00 m3/h
20:21:35.841 -> Current flow: 1.50 m3/h
20:21:45.819 -> Current flow: 2.00 m3/h
20:21:55.845 -> Current flow: 2.50 m3/h
20:22:05.831 -> Current flow: 3.00 m3/h

Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.