Official Blog of Silicon Labs

    Publish
     
      • SystemView: How to enable it in a Dynamic Multiprotocol Application

        Juan Benavides | 05/123/2018 | 11:24 AM

        The Silicon Labs Dynamic Multiprotocol allows you to support multiple wireless protocols on a single chip.

        This technology time-slices the radio and rapidly changes configurations to enable different wireless protocols to operate reliably at the same time. 

        The technology leverages Micrium OS Kernel to run each wireless stack as a separate RTOS task.

        You are probably aware of the multiple benefits of SystemView; a tool to record and analyze the Micrium OS Kernel events in real-time.

        To enable SystemView, Simplicity Studio offers this utility that inserts the required C files and configures the project include paths all by the press of a button. It sounds great, except that it is usually broken by constant changes in the different SDKs from Silicon Labs.

        In this blog, I'm gonna describe how to add SystemView to your DMP project manually, for those situations in which fancy tools just won't work.

         

        Inserting the SystemView Recorder Files to your DMP Project

        Right-click over the project name to open the context menu and select the options New -> Folder

        Click the button Advanced >>  select the option Link to alternate location (Linked Folder) and enter the following path:

        STUDIO_SDK_LOC\util\third_party\segger\systemview

         

        As shown in the image below:

        Figure 1. Adding SystemView to your Project Manually

         

         

        Inserting the Include Paths in your Compiler Configuration

        Right-click over the project name to open the context menu and select the option Properties.

        Select the option C/C++ General > Paths and Symbols and add the following include paths to all Languages and Configurations

        ${StudioSdkPath}/util/third_party/segger/systemview/Config
        ${StudioSdkPath}/util/third_party/segger/systemview/SEGGER
        ${StudioSdkPath}/util/third_party/segger/systemview/Sample/MicriumOSKernel
        ${StudioSdkPath}/util/third_party/segger/systemview/Sample/MicriumOSKernel/Config

         

         

        Resolving a couple of conflicts by excluding some C Files from compilation

        Locate the file SEGGER_SYSVIEW_Config_MicriumOSKernel.c in the Project Explorer at dev-cfg > source

        Right click over the file SEGGER_SYSVIEW_Config_MicriumOSKernel.c to open the context menu and select the option Properties.

        Select the option C/C++ Build and exclude this file from compilation by selecting the checkbox Exclude resource from build.

        Similarly, locate the file SEGGER_RTT.c in the Project Explorer at debug-basic-library > EFR32

        Right click over the file SEGGER_RTT.c to open the context menu and select the option Properties.

        Select the option C/C++ Build and exclude this file from compilation by selecting the checkbox Exclude resource from build.

         

         

        Enabling the Trace Recorder

        Open the file os_cfg.h located at the following path:

        STUDIO_SDK_LOC\protocol\zigbee\app\framework\plugin-soc\micrium-rtos\config\os_cfg.h

         

        Locate and set the macro OS_CFG_TRACE_EN to DEF_ENABLED

         

         

        Finding the memory address of the RTT block

        Re-compile your project and launch a Debug Session.

        Click the button Probe located on the top toolbar of Simplicity Studio.

        Once Probe is opened, type in the keyword _RTT in the Symbol Browser panel in Probe (at the bottom of the application) and make a note of the memory address as illustrated in the image below:

        Figure 2. Finding the RTT Block's Memory Address with Probe

         

         

        Starting a Recording

        Start SystemView.

        Press F5 to start a recording.

        Select the option Address for the RTT Control Block Detection and enter the address you found with Probe as shown below:

        Figure 3. SystemView RTT Block Address

         

        It may be that as the DMP SDK and/or Simplicity Studio evolve, the tool to insert SystemView automatically finally works. I will keep checking if that's the case and I will delete this blog if it's no longer relevant. In the meantime, I hope it will help someone.

         

        Disclaimer: The views, thoughts, and opinions expressed in this blog belong solely to the author, and not necessarily to Silicon Labs.

         
      • SystemView: How to prevent overflows

        Juan Benavides | 04/120/2018 | 11:37 AM

        Almost all of Silicon Labs Starter/Development Kits include an onboard J-Link debugger, which is great to not only debug and flash your embedded application, but also to run SystemView.

        SystemView as you probably know is the tool to record and analyze your Micrium OS Kernel events in real time.

        However, the onboard J-Link can be slow depending on the rate of kernel events that your embedded application is creating. Overflow events occur when the SystemView buffer on your embedded target is full.

        In this blog I'm gonna discuss the basic steps to prevent overflows and then I will describe the ultimate way to prevent overflows.

         

        Steps to Prevent Overflows

        1. Increase the buffer size to store the events:

        Open the configuration file SEGGER_SYSVIEW_Conf.h and set the buffer size to 4096 as shown below:

        #define SEGGER_SYSVIEW_RTT_BUFFER_SIZE           4096

         

        2. In case you are running Simplicity Studio, close Simplicity Studio and let SystemView run by itself.

         

        3. In case you are running Probe, close Probe and let SystemView run by itself.

         

        4. Open the configuration file os_cfg_trace.h and decrease the number of events by disabling the following features:

        #define  OS_CFG_TRACE_API_ENTER_EN               DEF_DISABLED
        
        #define  OS_CFG_TRACE_API_EXIT_EN                DEF_DISABLED

         

        5. If you are still having overflows after making the changes above, then the ultimate way to prevent overflows is to buy a much faster External J-Link from SEGGER: https://www.segger.com/products/debug-probes/j-link/

        Most of our Starter Kits have a Debug Connector that you can use to connect the external J-Link. 

        The following section describes how to connect your external J-Link to a Silicon Labs Starter Kit.

         

        Connecting your External J-Link

        1. First you need to configure your Starter Kit to reroute the debugging circuitry to the external debug connector. 

        Open Simplicity Studio, select your Starter Kit, locate the section Debug Mode: MCU and then press the link Change as shown in the image below:

        Figure 1. Simplicity Studio: Debug Mode

         

        2. You may be asked to download an adapter firmware image. If so, press the button Yes.

         

        3. The default Debug Mode is called MCU which means that your debugger is the Onboard J-Link.

         

        4. Select from the drop-down the option IN which means that your debugger is an External J-Link as shown in the image below:

        Figure 2. Debug Mode: IN (External J-Link)

         

        5. Connect your external J-Link to the debug connector on your Silicon Labs Starter Kit.

        Depending on your kit, it may be one of the ones shown below.

        The J-Link 19-pin 0.05" Cortex-M Debug Connector shown in Figure 3 may require a J-Link 19-pin Cortex-M Adapter available from SEGGER.

        Figure 3. J-Link 19-pin 0.05" Cortex-M Debug Connector

         

        On the other hand, the standard 20-pin 0.1" JTAG Debug Connector shown in Figure 4 does not require any adapters and can be connected directly to your external J-Link.

        Figure 4. Standard 20-pin 0.1" JTAG Debug Connector

         

        For more information on how to configure your Starter Kit in the appropriate debugging mode, please consult your Starter Kit's User's Guide, the section On-Board Debugger, Debug Modes.

         

        Related Links:

        SystemView Installer: https://www.segger.com/downloads/free-utilities/#SystemView

        SystemView User's Manual: https://www.segger.com/downloads/free-utilities/#Manuals

        J-Link Debug Probes: https://www.segger.com/products/debug-probes/j-link/

        J-Link 19-pin Cortex-M Adapter: https://www.segger.com/products/debug-probes/j-link/accessories/adapters/19-pin-cortex-m-adapter/

         

      • Migration Guide: from FreeRTOS to Micrium OS

        Juan Benavides | 04/115/2018 | 03:56 PM

        Whether you are currently running your embedded application on Silicon Labs hardware or other semiconductor, the migration path is the same as illustrated in Figure 1.

        You should start from a working Micrium OS example and then move your embedded application over to the example project.

        Figure 1. Migration Paths

         

        Once you move your embedded application to the Micrium OS baseline example project, you need to change the code that calls the FreeRTOS API.


        The purpose of the attached PDF document is to describe the differences between the two kernels, offer plenty of side-by-side examples and mapping tables to help you in the process of migrating your embedded application.