Series 2 DCI and SWD Programming
This example uses a Wireless Starter Kit (WSTK) with the BRD4182A Radio Board (EFR32MG22C224F512IM40) to program the Series 2 device through DCI and SWD interface.
The example redirects standard I/O to the virtual serial port (VCOM) of the kit. By default, the serial port setting is 115200 bps and 8-N-1 configuration.
The example has been instrumented with code to count the number of clock cycles spent in SWD programming operations. The results are printed on the VCOM serial port console.
DCI Programming
The following DCI operations are supported in this example:
- GET SE STATUS
- READ SE OTP CONFIGURATION
- READ SERIAL NUMBER
- READ PUBLIC SIGN KEY
- READ PUBLIC COMMAND KEY
- ENABLE SECURE DEBUG
- DISABLE SECURE DEBUG
- LOCK DEVICE
- ERASE DEVICE (UNLOCK)
- RECOVER SECURE BOOT FAILURE DEVICE
- UPGRADE SE FIRMWARE THROUGH DCI
- INITIALIZE AES-128 KEY (EFR32xG21)
- INITIALIZE PUBLIC SIGN KEY
- INITIALIZE PUBLIC COMMAND KEY
- INITIALIZE HSE OTP (EFR32xG21A)
- INITIALIZE HSE OTP (EFR32xG21B)
- INITIALIZE VSE OTP (EFR32xG22)
- DISABLE DEVICE ERASE
SWD Programming
The following SWD operations are supported in this example:
- ERASE MAIN FLASH
- PROGRAM MAIN FLASH
- ERASE USER DATA
- PROGRAM USER DATA
- UPGRADE SE FIRMWARE THROUGH APPLICATION FIRMWARE
Getting Started
- Upgrade the kit’s firmware to the latest version (see
Adapter Firmware
under General Device Information in Simplicity Studio 5 Users Guide).
- Open any terminal program and connect to the kit’s VCOM port.
- Create this alpha platform example project in the Simplicity IDE (see Examples in Simplicity Studio 5 Users Guide, check
ALPHA()
checkbox to browse the alpha examples).
- Build the example and download it to the kit (see Simple Build and Flash Programmer in Simplicity Studio 5 Users Guide).
- Run the example and follow the instructions shown on the console.
Additional Information
- The default clock source is 80 MHz HFRCODPLL.
- The default optimization level is
Optimize for debugging (-Og)
on Simplicity IDE and None
on IAR Embedded Workbench.
Resources
AN1190: Series 2 Secure Debug
AN1218: Series 2 Secure Boot with RTSL
AN1222: Production Programming of Series 2 Devices
AN1247: Anti-Tamper Protection Configuration and Use
AN1303: Series 2 DCI and SWD Programming