Results In Ninety Minutes: BLE Development With Blue Gecko

The past few years have seen an explosion in Internet of Things (IoT) applications, with products such as smart meters, wireless sensors, wearables, home automation devices, and alarm systems. Wireless connectivity is at the heart of the IoT, with a number of wireless standards working together to cover the entire spectrum of applications.

In particular, Bluetooth Low Energy (BLE), also known as Bluetooth Smart, is designed for applications in fitness, healthcare, security, home entertainment, and geography-based retail marketing (beacons). Compared to Classic Bluetooth, Bluetooth Smart offers reduced power consumption, low cost, fast connection times, combined with high levels of reliability and security. 

With Blue Gecko, the latest member of Silicon Lab's Wireless Gecko SoC family, developers can prototype a new idea or develop a simple BLE application in as little as 90 minutes by using the comprehensive kits, tools, and demo software available. 

Silicon Labs Wireless Gecko Family

With the Wireless Gecko family (EFR32), Silicon Labs offers highly- integrated, robust, reliable, and easy-to-use wireless and RF silicon on chip (SoC) solutions. Wireless Gecko devices are based on the ARM Cortex-M4 32-bit core plus floating point unit, operating at up to 40MHz, with up to 256kB of flash program memory and 32kB RAM data memory.  Depending on the device, peripherals include analog to digital converters, comparators, PWM channels, AES, ECC & SHA encryption, I2C communications, and more.

Blue Gecko is optimized for Bluetooth Smart; other SoCs include Mighty Gecko for the ZigBee® and Thread protocols, and Flex Gecko for 2.4 GHz proprietary applications.

Blue Gecko Overview 

The Blue Gecko SoC family (EFR32BG) provides scalability, energy efficiency, security and design simplicity for Bluetooth Smart applications. In addition to wireless SoCs, the Blue Gecko portfolio includes pre-certified wireless modules, a Bluetooth Smart software stack and an easy-to-use C-language software development kit (SDK).

Blue Gecko Hardware: SoC or Module?

0516 SE Blue Gecko Wireless Image 1

Figure 1: Comparison of a Blue Gecko BGM113 Module and SoC Reference Design (source: Silicon Labs)

When it comes to the hardware, there are two main options:
1) Use a predesigned wireless module containing the SoC
2) Use a wireless system-on-a-chip (SoC) and integrate it into your custom printed circuit board (PCB). 

The module comes with a fully-characterized PCB design including RF optimization and antenna layout, shielding, timing components, and external bill of materials (BOM). A module has higher upfront costs and might consume more space than a custom SoC design. Silicon Labs Blue Gecko modules include regulatory approvals and standards certifications, though, which save time and cost later in the development cycle. 

The SoC is smaller and cheaper than a wireless module and the total BOM cost is likely to be lower. But the upfront design brings hidden costs that need to be carefully considered. Some of the hidden costs of an SoC-based design include: 

- RF Engineers and Design: A Bluetooth design involves specialized design skills. Many factors can affect performance, including PCB insulation material, trace shape, even screw placement.  An RF engineer may cost up to $200,000 a year. 
- Lab Equipment and Facilities: An anechoic chamber may cost $20,000 or more, plus another $30-$50k for equipment. RF testing facilities can run several thousand dollars per day.
- PCB Layout and Antenna Selection: Although SoC manufacturers typically include detailed reference designs and layout guidelines, RF developments rarely go precisely according to plan. A few quick-turn PCB spins can boost costs considerably. 
- Regulatory Approvals and Certifications: A Bluetooth Smart product must meet the regulatory requirements of the FCC, EU, or other authority. It also requires certification by the Bluetooth SIG. Using a pre-certified module may allow the final product to skip many of the tests. 
- Reduced Product Revenue from TTM Delays: In today's marketing environment with its ever-shrinking development cycles, even a small delay can translate into lost revenue. 
- Supply Management and Assurance: For low-volume production runs, modules can mitigate supply risk. Sourcing a single module is much simpler than sourcing all the components to put an SoC on the board. 

Although every design is different, even some high-volume manufacturers of mobile phones have chosen a module solution.  A detailed analysis of SoC vs. module design choices is found here. 

Bluetooth Smart Wireless Starter Kit 

No matter which path you decide to take, the Bluetooth Smart Wireless Starter Kit (WSTK) provides a quick and convenient way to evaluate Blue Gecko hardware and get started with software development. It consists of the main board, a plugin radio board, and optional expansion boards.

The main board contains Ethernet and USB connectivity, the Si7021 temperature and humidity sensor, a 128 x 128-pixel display, coin-cell battery holder, and other peripherals.

0516 SE Blue Gecko Wireless Image 2

Figure 2: The Wireless Starter Kit (WSTK) with the BGM111 Blue Gecko wireless module and expansion board.(Source: Silicon Labs)

A choice of radio boards is available for Blue Gecko development. For modules, there are two versions, BG111 and BG113, with different specifications; for SoC work, the EFR32BG radio board is also available. The expansion board offers extra functions such as an accelerometer, joystick, LEDs, and two pushbuttons.

Blue Gecko Software Development Options

For Bluetooth Smart code development with Blue Gecko SoCs or Modules, you have the choice of two flexible development environments to use with the WSTK. 

For a simple application with standard functions, or to prototype an idea with minimal effort, consider using BGScript.  It's a BASIC-style scripting language that provides a quick and easy software development environment. BGScript creates simple Bluetooth Smart applications that run on the BGM111 or BGM113.

For more complex requirements or if you're designing custom hardware, you can develop applications from scratch with embedded C using Simplicity Studio with its Eclipse-based IDE and comprehensive suite of optimization tools.  The compiled code runs natively on a Blue Gecko Bluetooth Smart SoC. 

For a quick evaluation of Blue Gecko code, the Blue Gecko App runs on a smartphone or tablet with Bluetooth 4.0 or later.  It includes four sample applications: a health thermometer, a retail beacon, key fob detection, and a BLE Stack & Profile Test.  

Software Development With BGScript

BGScript provides access to all needed functionality to start coding immediately without worrying about the complexities of the Bluetooth protocol, embedded hardware, scheduling, memory management, etc. Applications can be used to automate common Bluetooth Smart functions such as opening a connection, listening for GPIO interrupts, and even reading and writing data via UART, SPI, I2C or GPIO interfaces.

0516 SE Blue Gecko Wireless Image 3

Figure 3:  The BGScript programming model Source (Silicon Labs)

BGScript applications can also perform simple data processing tasks using the available BGScript arithmetic, bitwise, buffer, and data comparison operations.

BGScript is built on top of the BGAPI layer in the Bluetooth Smart software stack and executes directly on a BGM111 or BGM113 wireless module. 

It is an event-driven programming language; an event such as system boot, Bluetooth connection, or an I/O interrupt, triggers the execution of the application code associated with that event. The script code is interpreted during run time by a BGScript interpreter included as part of the firmware. 

Complete applications can be implemented without an external host controller, reducing BOM cost and minimizing board size.

Software Development In 90 Minutes

0516 SE Blue Gecko Wireless Image Green text

Figure 4: A sample of BGScript code showing the boot event listener with its calls to the BGAPI (source: Silicon Labs)

Since a BGScript application program consists mostly of calls to BGAPI, an application can be assembled very quickly. Figure 4 shows a sample of code: the boot event listener for the Health Thermometer application, which is one of the 4 example applications included with Blue Gecko SDK. The boot event application code consists of several calls to the BGAPI: 

-- set a GPIO pin high to enable control of an LED on the evaluation board
-- set the advertisement parameters to a 100ms interval
-- begin broadcasting connectable advertisement packets to let remote BLE devices to scan and connect
-- set up a one-second repeating timer to schedule temperature readings. 

A more detailed discussion of this application can be found here.  Two useful documents on Blue Gecko BGScript development are the BGScript Development Guide, which covers the language function, syntax, and built-in operators; and the API Reference Guide for the BGM111 or BGM113, which details every available API method in the stack.

BGScript Advantages & Limitations

As an interpreted language, BGScript has pluses and minuses.

Some of the advantages are:

- Creates standalone applications that run directly on a module 
- Uses simple syntax and requires minimal programming experience
- Uses standard programming language features and operations
- Includes functions to simplify complex tasks and access common BGAPI features 
- Does not require custom C programming or a compiler license

Some limitations are:
- Since it is an interpreted language and requires extra overhead to run, BGScript's performance is limited compared to external API control. BGScript can run several thousand commands per second. Although BGScript runs on both modules and SoCs, its SDK does not allow full access to the underlying hardware peripherals.

C-based Software Development With Simplicity Studio and Bluetooth Smart C-SDK

0516 SE Blue Gecko Wireless Image 4

Figure 5: Simplicity Studio is a powerful software development framework built on an Eclipse IDE (source: Silicon Labs)

BGScript handles many standard operations and provides an abstraction layer for the Bluetooth Smart stack, but it is best suited to simpler applications because the BGScript API does not give unrestricted access to the underlying hardware.

If you have a complex application with fast timers or interrupts, or if your application must communicate with an external device such as a microcontroller via a UART, you need Simplicity Studio, a complete development environment built on an Eclipse-based IDE.  The IDE gives developers flexibility by supporting IAR's Embedded Workbench ARM compiler. It also provides seamless integration with optimization tools such as:

- The AppBuilder, an interactive tool to configure Silicon Labs-supplied code modules to implement applications  
- The Profiler, which enables power profiling of code in real time by measuring power consumption
- The Network Analyzer, which captures a trace of wireless network activity
- The Hardware Configurator, which automatically generates code for hardware peripherals and port I/O
- The Bluetooth Smart C-SDK, which allows you to develop System-On-Chip (SoC) software applications in C on a single microcontroller.

0516 SE Blue Gecko Wireless Image 5

Figure 6: Bluetooth Smart Development With Simplicity Studio (source: Silicon Labs)

Figure 6 shows the model for BT Smart development with Simplicity Studio. In contrast to the BGScript version, the application interacts directly with the BGAPI. 

For Blue Gecko development, the required Simplicity Studio components are:

- Simplicity Studio Framework with the EFR32BG Support Package
- Bluetooth Smart C-SDK
- IAR Embedded Workbench (IAR systems) for ARM 7.3 or later- used as a compiler in the Simplicity Studio environment. 

Simplicity Studio Advantages & Limitations

Simplicity Studio is a full-featured development system. Like any similar system, it takes time to become familiar with the many Bluetooth Smart development tools.

Advantages include:

- Compiled C code gives faster operation than an interpreted BGScript solution
- The Bluetooth Smart C-SDK gives access to the more underlying hardware peripherals, and enables greater flexibility in developing customer applications
- Hardware Configurator allows access to SoC peripherals and custom configuration of SoC peripherals on OEM PCBs
- Energy Profiler enables power optimization of code in real time by natively measuring power consumption (without requiring any additional measurement equipment or hardware probing)

Some disadvantages are:

- Longer development time
- Requires in-depth knowledge of C 
- Requires purchase of a License for IAR Embedded Workbench (IAR systems) for ARM 7.3 or later

Conclusion 

Blue Gecko offers the perfect combination of features to allow BLE developers to get to market in the shortest possible time, whether they use a pre-certified module or develop a custom SoC-based solution from scratch.  

Built upon an industry-standard ARM Cortex-M4 core, Blue Gecko offers the best of both worlds. For quick testing of new ideas or standard applications, a BGScript-based development environment can have applications up and running almost immediately. For ground-up development, Simplicity Studio lets developers customize every aspect of their design, with a broad range of optimization tools and prewritten code modules.

No matter which software platform is used, there is full software compatibility between the Blue Gecko SoC and module solutions enabling developers to quickly migrate from module to SoC as requirements change. 

Latest News

Sorry, your filter selection returned no results.

We've updated our privacy policy. Please take a moment to review these changes. By clicking I Agree to Arrow Electronics Terms Of Use  and have read and understand the Privacy Policy and Cookie Policy.

Our website places cookies on your device to improve your experience and to improve our site. Read more about the cookies we use and how to disable them here. Cookies and tracking technologies may be used for marketing purposes.
By clicking “Accept”, you are consenting to placement of cookies on your device and to our use of tracking technologies. Click “Read More” below for more information and instructions on how to disable cookies and tracking technologies. While acceptance of cookies and tracking technologies is voluntary, disabling them may result in the website not working properly, and certain advertisements may be less relevant to you.
We respect your privacy. Read our privacy policy here