The Silicon Labs Wi-SUN stack allows for a wide variety applications to be built on its foundation. This repo showcases some example applications built using the Silicon Labs Wi-SUN stack.
- Wi-SUN Node Monitoring: An extendable node monitoring application providing information on the device/board/application and connected statistics. It can be easily extended to monitor sensors and control actuators.
- Wi-SUN SoC CSMP Agent Skeleton: A reference implementation of the CSMP agent sample application skeleton that can be built using the csmp-agent-lib build system, to allow a node to connect to FND.
- Download and install Simplicity Studio 5.
- On Simplicity Studio 5, go to Window -> Preferences -> Simplicity Studio -> External Repos.
- Click [Add]. In the URI field, copy & paste the following link:
https://github.com/SiliconLabs/wisun_applications.git
- Click [Next] then [Finish] and [Apply and Close].
- Connect the Silicon Labs Starter Kit and open Simplicity Studio 5.
- Select the [Launcher] perspective.
- From the [Debug Adapters] panel on the left top corner, select your Silicon Labs Starter Kit.
- Ensure that an SDK is selected in the [General Information] tile of the [Overview] tab.
- Select the [EXAMPLE PROJECTS & DEMOS] tab in [Launcher] perspective.
- Under Provider (at the bottom of the list), select wisun_applications and click [create] on the desired project.
- If the project you are looking for is not listed in wisun_applications, it is possible that your debug adapter is not listed as compatible with the application. Try using a Silicon Labs debug adapter first, and check if it is listed in the project's boardCompatibility section of templates.xml.
Wi-SUN Node Monitoring application contains a crash handler component that reports and recovers from application asserts and crashes.
In order to utilize the component in another project:
- Copy sl_wisun_crash_handler.c and sl_wisun_crash_handler.h to the project, and add them to compilation.
- Add RMU (emlib_rmu) component to the project.
- Add linker flags below to the project. In Studio, go to Project -> Properties -> C/C++ Build -> Settings -> GNU ARM C Linker -> Miscellaneous. The component will work without them, but it will be unable to capture some asserts on GCC.
-Wl,--wrap=__stack_chk_fail,--wrap=__assert_func
- Call crash handler initialization in app_init.
#include "sl_wisun_crash_handler.h"
...
void app_init(void)
{
sl_wisun_crash_handler_init();
}
- After initialization, read crash reason.
#include "sl_wisun_crash_handler.h"
...
const sl_wisun_crash_t *crash;
...
crash = sl_wisun_crash_handler_read();
if (crash) {
switch (crash->type) {
case SL_WISUN_CRASH_TYPE_XXX:
break;
...
}
sl_wisun_crash_handler_clear();
}
- Alternatively, call
sl_wisun_check_previous_crash()
to fill thecrash_info_string
then print the string. This string will be available during the entire application runtime (the Wi-SUN Node Monitoring application makes it available via a CoAP request).
#include "sl_wisun_crash_handler.h"
...
int crash_type;
...
crash_type = sl_wisun_check_previous_crash();
if (crash_type) {
printf("%s\n", crash_info_string);
}
Warning
If the project uses Gecko Bootloader, bootloader's bss section may overlap with application's noinit section, causing the crash handler to not function properly. In Wi-SUN Node Monitoring application this is avoided by increasing the stack size SL_STACK_SIZE, which pushes application's noinit section further into RAM. Another possibility is to modify the generated linker script and swap the placement of application's bss and noinit sections.
- Official Wi-SUN documentation can be found in the Wi-SUN pages on docs.silabs.com.
- Project-specific information is provided in the README.md file in each project folder.
To report bugs in the Wi-SUN Application Examples projects, please create a new "Issue" in the "Issues" section of this repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues.
Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of this repo.
The Gecko SDK suite supports development with Silicon Labs IoT SoC and module devices. Unless otherwise specified in the specific directory, all examples are considered to be EXPERIMENTAL QUALITY which implies that the code provided in the repos has not been formally tested and is provided as-is. It is not suitable for production environments. In addition, this code will not be maintained and there may be no bug maintenance planned for these resources. Silicon Labs may update projects from time to time.