Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

Writing Firmware for a Simple Peripheral

Nick Walker edited this page Aug 11, 2014 · 4 revisions

Planning

We're going to be making a simple BLE profile for a not-so-theoretical alarm clock. First, let's do some thinking about what services our profile will provide. We'll definitely need to make the time available.

Organization of a CC2541 Project

TI's example projects are densely documented, to the point that it can actually be hard to tell what's going on at a glance. This is especially true within IAR, which is a mediocre IDE. Let's start from the SimpleBLEPeripheral example project. The information presented here is condensed from the documentation that is included with the BLE stack in the documents directory.

OnBoard.c defines the capabilities of the evaluation hardware. If you specify that you're building your code to run on any of TI's first party dev-kits, you'll have access to a bunch of helpful functions already. Main.c is the entry point for the application and initializes the hardware and operating system abstraction layers. OSAL.c starts all of the processes needed to manage the BLE stack. Your application process will be initialized at the very bottom. SimpleProfile.c/.h defines the GATT configuration of a given profile. SimplePeripheral.c/.h contain lot of callbacks and such that actually define the way the peripheral will work. The init function should be your main starting place for writing any application specific code.

Okay, great! So what API do we use

Clone this wiki locally