Note: This KBA has been marked as deprecated. BGScript is no longer supported. Please refer to QSG108 to get started and learn about our tools.
Silicon Labs provides three methods or workflows for developing Bluetooth Applications; BGSCript, IAR Embedded Workbench and Silicon Labs SimplicityStudio. This article will describe these workflows and discuss the advantages of each one.
The first so-called workflow is called BGscript. This is our own event based scripting language which is similar in syntax to BASIC. This language allows developers to create Bluetooth applications at a higher level of abstraction, avoiding the need to write drivers for common peripherals such as UARTs. Many features in the Bluetooth stack, such as sleep, wakeup, packet trace and UART behavior, can be controlled from an xml file.
Another advantage of BGScript is that the development tools are provided free of charge. The Bluetooth stack provides information as a series of events. To create an application with BGScript, the developer only needs to write handlers for the events to be processed. As such, BGScript is a great way to get up and running quickly with a simple Bluetooth application. A simple GUI tool for building and downloading BGScript applications called BGtool is provided.
The limitations of BGScript are mainly the lack of support for debugging and the fact that only integral data types are supported.
Support for BGScript is delivered in the form of an SDK available from www.silabs.com.
Another supported workflow is using the C language through the IAR tools. The C language is possibly the most commonly understood programming language, particularly among embedded developers. Developing in C results in greater runtime efficiency than BGScript but requires a little more effort on the part of the developer. Drivers are usually written by the developer unless they can be obtained from the SimplicityStudio method described below. The C language has more flexibility in data representation and processing than BGScript which can ease the development and debugging process.
Another advantage of developing in C comes in the availability of debugging. The IAR tools include a powerful debugger with all of the features that many developers have come to expect such as breakpoints, register and variable watch, and simulated terminal I/O window. Some examples are available to demonstrate how to get started. Please see the examples folder of your SDK installation. This method gives the developer the most flexibility as there are no constraints as there were would be when using a code generation framework such as the SimplicityStudio AppBuilder or language like BGScript.
Another possibility for developing Bluetooth applications is SimplicityStudio. This is Silicon Labs’ own integrated development environment and is capable of running the IAR command line compiler, assembler and linker. One of the main advantages of this approach is the appbuilder, a GUI interface for code generation. This tools allows the developer to generate drivers for peripherals and configure Bluetooth features such as advertisement, beaconing and transmit power from a simple graphical interface.
SimplicityStudio also provides several example applications to help you get a running start. Please see QSG120.pdf for a complete guide to getting started with this approach. Note that this method is available when developing for Bluegecko SOCs and BGM1xx modules. SimplicityStudio also offers advanced tools for analyzing the behavior of an application such as the energy profiler and network analyzer. Please note that this method requires a separate SDK installation from the BGscript SDK.
Each of these methods has its own advantage. Developing in C, whether through IAR or SimplicityStudio, generally results in more efficient code but may require more implementation on the part of the developer while BGScript offers a quick way to get up and running on a simple project.