Bluetooth Low Energy

When you start learning something new you may get bogged down by the enormity of it. The trick is to eat a bite at a time, start small but be consistent. This holds true for learning BLE as well. Initially you will face the issue of not knowing where to start from, just the way I did. After having four years of development experience on BLE products I think I can answer this very well.

For the purpose of clarity, I would like to state that this is not a step by step tutorial but rather a learning approach which would make your learning process faster. I will try to make the process generic and not specific to any BLE chip vendor.

Get yourself a development board.

Since we are into firmware development, we will need some development board for hands on. A development board makes the learning process so much easier and faster. All the BLE chip vendors provide development board along with software tools for coding, programming and debugging. Moreover, some of the basic peripherals like push buttons, LEDs etc. are already present on board. Development boards are good for learning as well as prototyping. You get a tested hardware design for a reasonable price.

Below are some of the leading BLE chip vendors to get your boards from.

  • Nordic Semiconductor
  • Silicon Labs
  • Cypress
  • Dialog
  • There are more, you can choose whichever you want. Just ensure that there is a lot of reading material available for their chips if you run into issues.

    Install the software tools.

    Once you have the board you can start installing the required software tools. Usually every chip vendor has a “Getting started” guide, these are step by step guides for setting up your environment for coding, flashing the chip and debugging. The chip vendor should provide an IDE(Integrated development environment) that is free for use for that particular vendor’s chip. The IDE will have a compiler, debugger and programmer which are the basic tools required for any firmware development.

    BLE is a communication protocol, your firmware device will need something to communicate to. This can be an app on Android or iOS or a PC based application (provided your PC has the required BLE hardware).

    These are couple of apps that you can use.

  • BLE Scanner
  • NRF Connect
  • Run some examples provided by the chip manufacturer.

    Every chip vendor provides sample projects to make the development faster. The first thing you should figure out is how to run these sample projects on their development boards. You should find guides to do that and generally the most basic BLE sample is of a “Beacon”. You are bound to face issue at this step so be lenient and do not curse yourself if you don’t get things working in the first shot.

    These sample projects will have the BLE stack already linked. BLE stack is firmware component and it is distributed as a prebuilt binary by chip vendors. The BLE stack is the firmware that implements the BLE specifications, you can assume it to be like an OS for your chip.

    After you get this step done congratulate yourself, you now have a working environment where you can experiment.

    Download the BLE specifications document

    Use BLE specifications document as a reference document. Whenever you come across a new term or a concept related to BLE, try to search it in this document. BLE stack developers use this as the guide for implementing the stack and every BLE stack needs to be certified by Bluetooth SIG.

    You do not need to worry about all this right now, just remember that if you need any clarification related to the BLE protocol just refer this document.

    Try to understand the “BLE Device Roles” and data transmission steps

    While trying to understand this you will come across a lot of fancy terms, get deep and clarify the meaning and purpose of all these terms as much as possible.

    You will come across terms like...

    GATT, Services, Characteristics, Descriptors, Advertisers, Central, Peripherals… and so on.

    Try to understand what these terms mean in the context of BLE. Having a good understanding of the Roles and transmission process will teach you most of the basic terminologies.

    Understanding the BLE Stack APIs and Library APIs

    As I mentioned earlier, Stack is the part where the BLE standard is implemented. Every manufacturer provides a Stack as a prebuilt binary. The manufacturer will also provide an interface to the Stack in the form of API calls. Your firmware application needs to interact with the Stack using these APIs.

    Another firmware component distributed by chip vendors, either in source code form or binary form, is the library. These libraries are firmware components to facilitate your development. These libraries can be drivers like I2C or SPI drivers. Or they can be libraries for writing data to flash. Or to drive an external peripheral like an LED or push button.

    In short, you will need the stack APIs(for BLE communication) and the library APIs(peripheral driver) to create your firmware application.

    Keep doing projects

    Nothing teaches you more than doing a hands-on implementation. Projects will teach you a lot. Hard work and dedication have no alternatives.