Programming and Debugging.
There are two options available for programming and debugging the XIAO MG24 projects.
- Via built in SWD via OpenOCD.
- Using the SWD pads and a Segger JLink (compatible) debugger.
Option 1.
Quite involved - will tackle this later.
Option 2.
Either solder SWD connections to the XIAO MG24 or use the Expansion Board to connect SWD to the device.
Only GND, SWDIO and SWCLK are required.
Select the “bootloader” project and build the project.
In the “Binaries” folder of the bootloader project, select the “hex” file and Right Click → Flash to Device.
Select your JLink connected to the XIAO MG24 and click OK.
Erase and Program the device.
Select the “light” project and click the “Debug” symbol on the menu bar (or Right Click → Debug As → 1 Silicon Labs ARM Program.
Select the JLink and click OK.
The Debug perspective will be opened and the code set at “sl_main_second_stage_init();” function.
Connect a Serial Terminal (eg PuTTY) to the XIAO MG24 serial port.
Click the run button to start the debugger.
The following messages are sent…
[00:00:00.125][info ][DL] Starting scheduler
[00:00:00.125][info ][DL] ==================================================
[00:00:00.126][info ][DL] SL-Light starting
[00:00:00.126][info ][DL] ==================================================
[00:00:00.126][info ][DL] Init CHIP Stack
[00:00:00.131][info ][DL] Setting device name to : "SL-Light"
[00:00:00.132][info ][DL] Provision mode disabled
[00:00:00.132][info ][DL] Initializing OpenThread stack
[00:00:00.133][info ][DL] OpenThread started: OK
[00:00:00.134][info ][DL] Setting OpenThread device type to ROUTER
[00:00:00.134][info ][DL] Starting OpenThread task
[00:00:00.135][info ][SVR] Initializing subscription resumption storage...
[00:00:00.137][info ][SVR] Server initializing...
[00:00:00.137][detail][FP] Initializing FabricTable from persistent storage
[00:00:00.138][info ][TS] Last Known Good Time: [unknown]
[00:00:00.138][info ][TS] Setting Last Known Good Time to firmware build time 2 023-10-10T16:28:52
[00:00:00.140][info ][DMG] AccessControl: initializing
[00:00:00.141][info ][DMG] Examples::AccessControlDelegate::Init
[00:00:00.141][info ][DMG] AccessControl: setting
[00:00:00.141][info ][DMG] DefaultAclStorage: initializing
[00:00:00.142][info ][DMG] DefaultAclStorage: 0 entries loaded
[00:00:00.142][info ][SVR] WARNING: mTestEventTriggerDelegate is null
[00:00:00.142][detail][IN] UDP::Init bind&listen port=5540
[00:00:00.143][detail][IN] UDP::Init bound to port=5540
[00:00:00.143][detail][IN] BLEBase::Init - setting/overriding transport
[00:00:00.143][detail][IN] TransportMgr initialized
[00:00:00.148][detail][DL] Using Thread extended MAC for hostname.
[00:00:00.150][info ][ZCL] Using ZAP configuration...
[00:00:00.151][detail][DMG] Failed to read stored attribute (0, 0x0000_0028, 0x0 000_0005: a0
[00:00:00.152][detail][DMG] Failed to read stored attribute (0, 0x0000_0028, 0x0 000_0010: a0
[00:00:00.154][detail][DMG] Failed to read stored attribute (1, 0x0000_0006, 0x0 000_0000: a0
[00:00:00.155][detail][DMG] Failed to read stored attribute (1, 0x0000_0006, 0x0 000_4003: a0
[00:00:00.156][detail][DMG] Failed to read stored attribute (1, 0x0000_0008, 0x0 000_0000: a0
[00:00:00.157][detail][DMG] Failed to read stored attribute (1, 0x0000_0008, 0x0 000_4000: a0
[00:00:00.158][detail][DMG] Failed to read stored attribute (1, 0x0000_0300, 0x0 000_0000: a0
[00:00:00.159][detail][DMG] Failed to read stored attribute (1, 0x0000_0300, 0x0 000_0001: a0
[00:00:00.160][detail][DMG] Failed to read stored attribute (1, 0x0000_0300, 0x0 000_0003: a0
[00:00:00.161][detail][DMG] Failed to read stored attribute (1, 0x0000_0300, 0x0 000_0004: a0
[00:00:00.162][detail][DMG] Failed to read stored attribute (1, 0x0000_0300, 0x0 000_0007: a0
[00:00:00.163][detail][DMG] Failed to read stored attribute (1, 0x0000_0300, 0x0 000_0008: a0
[00:00:00.164][detail][DMG] Failed to read stored attribute (1, 0x0000_0300, 0x0 000_4000: a0
[00:00:00.165][detail][DMG] Failed to read stored attribute (1, 0x0000_0300, 0x0 000_4001: a0
[00:00:00.166][detail][DMG] Failed to read stored attribute (1, 0x0000_0300, 0x0 000_4002: a0
[00:00:00.166][detail][DMG] Failed to read stored attribute (1, 0x0000_0300, 0x0 000_4003: a0
[00:00:00.166][detail][DMG] Failed to read stored attribute (1, 0x0000_0300, 0x0 000_4004: a0
[00:00:00.168][detail][DMG] Failed to read stored attribute (1, 0x0000_0300, 0x0 000_4010: a0
[00:00:00.168][info ][DMG] AccessControlCluster: initializing
[00:00:00.168][detail][ZCL] GeneralDiagnostics: OnDeviceReboot
[00:00:00.169][detail][DMG] Endpoint 0, Cluster 0x0000_0033 update version to d3 5a9324
[00:00:00.169][detail][EVL] LogEvent event number: 0x0000000000000000 priority: 2, endpoint id: 0x0 cluster id: 0x0000_0033 event id: 0x3 Epoch timestamp: 0x00 0000DC6ACFAC28
[00:00:00.170][info ][ZCL] Initiating Admin Commissioning cluster.
[00:00:00.170][detail][DMG] Endpoint 1, Cluster 0x0000_0003 update version to e2 afd74a
[00:00:00.171][info ][ZCL] Cluster callback: 0x0000_0003
[00:00:00.171][info ][ZCL] Identify attribute ID: 0x0000_0001 Type: 48 Value: 2 , length 1
[00:00:00.172][detail][DMG] Endpoint 1, Cluster 0x0000_0004 update version to b8 d0002f
[00:00:00.172][info ][ZCL] Cluster callback: 0x0000_0004
[00:00:00.172][detail][DMG] Endpoint 1, Cluster 0x0000_0004 update version to b8 d00030
[00:00:00.173][info ][ZCL] Cluster callback: 0x0000_0004
[00:00:00.173][info ][ZCL] Endpoint 1 On/off already set to new value
[00:00:00.174][detail][DMG] Endpoint 1, Cluster 0x0000_0008 update version to c2 cfaab
[00:00:00.174][detail][DMG] Endpoint 1, Cluster 0x0000_0062 update version to fa bd4a
[00:00:00.174][info ][ZCL] Cluster callback: 0x0000_0062
[00:00:00.175][detail][DMG] Endpoint 1, Cluster 0x0000_0300 update version to a3 af4a7b
[00:00:00.176][detail][DMG] Endpoint 1, Cluster 0x0000_0300 update version to a3 af4a7c
[00:00:00.177][info ][ZCL] Cluster callback: 0x0000_0300
[00:00:00.177][info ][ZCL] Color Control attribute ID: 0x0000_0008 Type: 48 Val ue: 2, length 1
[00:00:00.179][detail][DMG] Endpoint 1, Cluster 0x0000_0300 update version to a3 af4a7d
[00:00:00.179][info ][ZCL] Cluster callback: 0x0000_0300
[00:00:00.179][info ][ZCL] Color Control attribute ID: 0x0000_4001 Type: 48 Val ue: 2, length 1
[00:00:00.181][detail][IN] SecureSession[0x20007920]: Allocated Type:1 LSID:6300 5
[00:00:00.182][detail][SC] Assigned local session key ID 63005
[00:00:00.182][detail][SC] Waiting for PBKDF param request
[00:00:00.182][info ][DIS] Updating services using commissioning mode 1
[00:00:00.183][error ][DIS] Failed to remove advertised services: 3
[00:00:00.183][detail][DL] Using Thread extended MAC for hostname.
[00:00:00.184][info ][DIS] Advertise commission parameter vendorID=65521 produc tID=32773 discriminator=3840/15 cm=1 cp=0
[00:00:00.184][error ][DIS] Failed to advertise commissionable node: 3
[00:00:00.184][error ][DIS] Failed to finalize service update: 3
[00:00:00.185][info ][DIS] Updating services using commissioning mode 1
[00:00:00.185][error ][DIS] Failed to remove advertised services: 3
[00:00:00.185][detail][DL] Using Thread extended MAC for hostname.
[00:00:00.186][info ][DIS] Advertise commission parameter vendorID=65521 produc tID=32773 discriminator=3840/15 cm=1 cp=0
[00:00:00.186][error ][DIS] Failed to advertise commissionable node: 3
[00:00:00.187][error ][DIS] Failed to finalize service update: 3
[00:00:00.187][info ][IN] CASE Server enabling CASE session setups
[00:00:00.188][detail][IN] SecureSession[0x200079f8]: Allocated Type:2 LSID:6300 6
[00:00:00.188][detail][SC] Allocated SecureSession (0x200079f8) - waiting for Si gma1 msg
[00:00:00.188][detail][ZCL] Emitting StartUp event
[00:00:00.189][detail][EVL] LogEvent event number: 0x0000000000000001 priority: 2, endpoint id: 0x0 cluster id: 0x0000_0028 event id: 0x0 Epoch timestamp: 0x00 0000DC6ACFAC3B
[00:00:00.189][info ][SVR] Server Listening...
[00:00:00.190][silabs ]Starting Platform Manager Event Loop
[00:00:00.192][info ][DL] Starting App Task
[00:00:00.475][info ][DL] Bluetooth stack booted: v10.1.0-b0
[00:00:00.475][info ][DL] RAIL version:, v2.19.1-b0
[00:00:00.476][detail][DL] CHIP event task running
[00:00:00.476][detail][DL] Start BLE advertisement
[00:00:00.477][detail][DL] BLE Static Device Address DF:4D:F2:55:30:71
[00:00:00.478][info ][DL] Starting advertising with interval_min=32, intverval_ max=96 (units of 625us)
[00:00:00.480][info ][DL] _OnPlatformEvent default: event->Type = 32781
[00:00:00.481][info ][DL] _OnPlatformEvent default: event->Type = 32779
[00:00:00.482][detail][DL] OpenThread State Changed (Flags: 0x00038210)
[00:00:00.483][detail][DL] Network Name: OpenThread
[00:00:00.483][detail][DL] PAN Id: 0xFFFF
[00:00:00.483][detail][DL] Extended PAN Id: 0xDEAD00BEEF00CAFE
[00:00:00.484][detail][DL] Channel: 11
[00:00:00.484][detail][DL] Mesh Prefix: fdde:ad00:beef:0:0:0:0:0/64
[00:00:00.485][info ][SVR] Current Software Version String: 1
[00:00:00.485][info ][SVR] Current Software Version: 1
[00:00:00.485][info ][DL] Device Configuration:
[00:00:00.486][info ][DL] Serial Number: (not set)
[00:00:00.486][info ][DL] Vendor Id: 65521 (0xFFF1)
[00:00:00.487][info ][DL] Product Id: 32773 (0x8005)
[00:00:00.487][info ][DL] Product Name: SL_Sample
[00:00:00.488][info ][DL] Hardware Version: 1
[00:00:00.488][info ][DL] Setup Pin Code (0 for UNKNOWN/ERROR): 0
[00:00:00.488][info ][DL] Setup Discriminator (0xFFFF for UNKNOWN/ERROR): 384 0 (0xF00)
[00:00:00.489][info ][DL] Manufacturing Date: (not set)
[00:00:00.489][info ][DL] Device Type: 65535 (0xFFFF)
[00:00:00.490][info ][SVR] SetupQRCode: [MT:6FCJ142C00KA0648G00]
[00:00:00.490][info ][SVR] Copy/paste the below URL in a browser to see the QR Code:
[00:00:00.490][info ][SVR] https://project-chip.github.io/connectedhomeip/qrcod e.html?data=MT%3A6FCJ142C00KA0648G00
[00:00:00.491][info ][ZCL] On/Off ep1 value: 0
[00:00:00.491][silabs ]App Task started
matterCli> [00:00:30.481][info ][DL] Starting advertising with interval_min=240, intverval_max=1920 (units of 625us)