Testing and Debugging#
RTT Logs#
The UART interface is not always available to report traces from Sidewalk example applications. Instead, reporting leverages the J-Link RTT interface. To set up the communication between your PC and the EFR32, follow these instructions.
Install the J-Link RTT Viewer.
Open the J-Link RTT Viewer.
In the Configuration panel, Connection to J-Link section, select USB.
In the Specify Target Device list, select the connected part (for example EFR32BG21BxxxF1024 or EFR32MG24AxxxF1536).
In the Target Interface & Speed panel, select SWD and 4000 kHz.
In the RTT Control Block panel, select Auto Detection.
Click OK.
Ⓘ INFO Ⓘ: For the KG100S module, select EFR32BG21BxxxF1024 as the target device.
A terminal opens and the Sidewalk application traces are output as shown below (Bluetooth application).
00> [00000001] <I> hello neighbor application started
00> [00000001] <I> sidewalk stack version 1.17.1-13
00> [00000002] <I> silabs sidewalk extension version 2.2.1
02> [00000006] <I> pal kv-storage: kv store opened with 0 object(s)
02> [00000007] <I> pal swi: interrupt init ok
02> [00000008] <W> pal mfg: no objects found in mfg store
⚠ WARNING ⚠: J-Link RTT and Simplicity Studio use the same channel to communicate with the board. If you do not see logs in J-Link RTT, try closing and re-opening Simplicity Studio to reset the connection.
By default, in Amazon Sidewalk sample application, the RTT logs are splitted accross 3 terminals:
Terminal 0: Outputs the application logs. They are easy to understand and give basic information on the application status.
Terminal 1: Outputs the Sidewalk stack logs. They are more difficult to understand and require a deep knowledge of the Sidewalk stack. Those logs are in the Amazon Sidewalk stack, the sources are not available.
Terminal 2: Outputs the Sidewalk Platform Abstraction Layer (PAL) logs. They require some knowledge of Sidewalk and can easily be found in the code.
Switch Logs from RTT to UART#
The initial step is to verify that VCOM is active. This can be confirmed by ensuring that SL_BOARD_ENABLE_VCOM is set to 1 in the config/sl_board_control_config.h file. If it is not, you should adjust it accordingly.
To configure the log output from RTT to UART, follow these steps:
Navigate to Software Components and search for board control.
In the Board Control component, check if Enable Virtual COM UART is enabled.
Navigate to Software Components and search for iostream.
Install the IO Stream: USART component (or IO Stream: EUSART for xG28 and xG24).
Access the configuration settings of the newly created VCOM instance called vcom.
If available, disable Enable High frequency mode and Restrict the energy mode to allow the reception options.
In
config/sl_cli_config_inst.h
change the value ofSL_CLI_INST_IOSTREAM_HANDLE
tosl_iostream_vcom_handle
.Navigate back to Software Components and search for sidewalk.
Uninstall the Sidewalk Log: App RTT component and install Sidewalk Log: App VCOM component in its place.
You can also completely remove RTT by replacing Sidewalk Log: PAL RTT and Sidewalk Log: stack RTT by their VCOM equivalent. Then, remove the IO Stream: RTT component.
Cloud Application Debugging#
To debug your cloud application, several AWS objects can be use to monitor the events in your account. See Amazon CloudWatch for more information.