Page 3
Porting BLEv1.4.0 Projects to BLEv1.4.1 ..............9.3.3 Porting BLEv1.3.2 Projects to BLEv1.4.0 ................9.3.4 Porting BLEv1.2 Projects to BLEv1.3 ..............9.3.5 Porting From CC2540 to CC2541 Project ..................... Release Notes History ......................Document History .......................... GAP API ........................ Commands SWRU271H – October 2010 – Revised April 2019...
SWRU271H – October 2010 – Revised April 2019 Preface The purpose of this document is to give an overview of the TI CC2540 and CC2541 Bluetooth Low Energy software development kit. This document also introduces the Bluetooth Low Energy standard, but should not be used as a substitute for the complete specification.
NOTE: The TI BLE-Stack v1.5.x is qualified to Bluetooth 5.0 using the same core specification features as defined by Bluetooth 4.0 and implemented in previous BLE-Stack v1.4.x releases. References to Bluetooth 4.0 in this and related CC2540/CC2541 documentation using the v1.5.x release refer to functionality only. For an overview of TI devices that implement features defined by newer Bluetooth specifications, see www.ti.com/ble.
Single-Device: The controller, host, profiles, and application are implemented on the CC2540/41 as a true single-chip solution. This configuration is the simplest and most common when using the CC2540/41 devices. TI uses this configuration in most sample projects. The configuration is the most cost effective and provides the lowest-power performance. The SimpleBLEPeripheral and SimpleBLECentral projects are examples of applications built using the single-device configuration.
• Network Processor: The controller and host layers are implemented together on the CC2540/41, while the profiles and the application are implemented separately on an external host processor. The application and profiles communicate with the CC2540/41 through vendor-specific HCI commands using an SPI, a UART interface, or a virtual UART interface over USB.
The HostTestRelease project is used to build the Bluetooth Low Energy network processor software for the CC2540/41. This project contains configurations for both master and slave roles. The Bluetooth Low Energy development kit includes other sample projects. These projects implement various profiles and demonstration applications.
The Bluetooth Low Energy software development kit contains a sample project, SimpleBLEPeripheral, that implements a basic Bluetooth Low Energy peripheral device. This project is built using the single-device stack configuration, with the stack, profiles, and application running on the CC2540/41. Project Overview On the left side of the IAR window, the Workspace section lists the files used by the project.
Page 21
INCLUDE – This group includes all of the necessary header files for the Bluetooth Low Energy protocol stack API. For details, see Appendix A through Appendix G CC2540 Bluetooth low energy API Guide. • LIB – This group contains the protocol stack library file CC2540_BLE_peri.lib. For more information on the protocol stack libraries, see Section 5.8.
GAP functions. This function sets up the GAP functions of the application. Connectable undirected advertisements make the device discoverable (for CC2540/41DK-MINI keyfob builds, the device becomes discoverable when you press the button on the right). A central device can discover the peripheral device by scanning.
HAL. The application has code specific to the Keyfob reference hardware in the CC2540/41DK-MINI development kit. This code is surrounded by the preprocessor directive #if defined (CC2540_MINIDK) and gets compiled when using the CC2540/41DK- MINI Keyfob configuration.
Bluetooth Low Energy Stack Library: This library includes the lower-layer stack functionality and varies based on the GAP role. You can include the full library, but you can use a smaller subset to conserve code space typically. This library is different for a CC2540 and CC2541 project. •...
For an example using the LCD driver, see the CC2540/1 configuration in the SimpleBLEPeripheral project. To include the LED driver, define HAL_LED=TRUE in the preprocessor definitions. TI designed the driver to function with the LEDs on the key fob.
32-MHz ticks. This definition is set in hal_sleep.c to 25 for the CC2541 EM and 35 for the CC2540 EM by default. If the value of the definition is larger, the buffer time is longer and more power is wasted.
Using IAR Embedded Workbench After the required version of IAR has been installed, you are ready to develop for the CC2540/41. This section describes how to open and build an existing project for a CC2540. Similar steps apply for a CC2541.
CC2540/41DK mini development kit. Alternatively, CC2540 is optimized for the SmartRF05 + CC2540 EM included with the full development kit. Other configurations include a 128-KB part, an OAD, and so forth: Figure 8-3.
Page 76
HAL_UART – This symbol indicates whether to include the UART driver when set to TRUE. If not defined, it is set to FALSE. • CC2540_MINIDK – Define this symbol when using the keyfob board in the CC2540/41DK-MINI development kit. This symbol configures the hardware based on the keyfob board layout. •...
NOTE: This action compiles the source code, links the files, and builds the project. Any compiler errors or warnings appear in the Build window. 3. To download the compiled code onto a CC2540/41 device and debug, connect the keyfob using a hardware debugger (such as the CC Debugger included with the CC2540/41DK-MINI development kit) connected to the PC over USB.
Figure 8-10 shows both of these buttons: Figure 8-10. IAR Debug Toolbar 8. While the program executes, disconnect the hardware debugger from the CC2540/41. The debugger runs while the device remains powered. 8.3.4 Linker Map File After building a project, IAR generates a linker map file that you can find in the Output group in the file list.
Page 80
Ensure the sum of the CODE memory plus CONST memory does not exceed the maximum flash size of the device (either 128KB or 256KB, depending on the version of the CC2540/41). Ensure the size of the XDATA memory does not exceed 7936 bytes, as the CC2540/41 contains 8KB of SRAM (256 bytes are reserved).
\Components\osal\mcu\cc2540\osal_snv.c f. \Components\hal\target\CC2540EB\_hal_uart_dma.c and \Components\hal\target\CC2540USB\_hal_uart_dma.c g. \Projects\ble\Profiles\Roles\gapbondmgr.c 2. Update the CC2540 USB Library: All library sub folders and files from \Components\hal\target\CC2540USB\* 3. The following GATT services have minor updates. Copy the respective service.c file from \Projects\ble\Profiles to your project: a.
Porting From Earlier BLE-Stack Versions This section explains necessary steps to port a BLE-Stack v1.x.x project running on a certain stack version to a newer one, and how to port between CC2540 and CC2541 projects. 9.3.1 Porting BLEv1.4.1 Projects to BLEv1.4.2 BLE v1.4.2 is a BLE-Stack maintenance release to the v1.4.1 release with all bug fixes applied in the...
1.3.2\Projects\ble\$PROJECT$ to C:\Texas Instruments\BLE-CC254x- 1.3\Projects\ble\$PROJECT$ where $PROJECT$ is your project folder. 2. If you modifed any files from C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\Profiles, you will need to merge your changes with the new 1.4.0 version. 3. Open your project (now in the 1.4.0 folder) with IAR 8.20.
9.3.5 Porting From CC2540 to CC2541 Project This chapter describes how to port a CC2540 Project to work on a CC2541. Similar steps can be taken for the reverse direction. 1. Create and select a new CC2540 project configuration based on the CC2541 configuration under Project ->...
6. Add the CC2540_BLE_peri.lib to the library group. Figure 9-6. BLE Library: Add To LIB Group 7. You also have to ensure to exclude the CC2540 library from the other CC2541 configurations. Release Notes History Texas Instruments, Inc. CC2540/41 Bluetooth® Low Energy Software Development Kit Version 1.4.2 June 7, 2016...
Page 91
Version 1.4.1 May 18, 2015 Notices: • This version of the Texas Instruments Bluetooth Low Energy stack and software is a maintenance update to the v1.4 release. It contains several bug fixes and enhancements. • The Bluetooth Low Energy protocol stack, including both the controller and host, was completely retested for v1.4.1.
Page 92
Version 1.4.0 November 8, 2013 Notices: • This version of the Texas Instruments Bluetooth Low Energy stack and software is a minor update to the v1.3.2 release. It contains some minor bug fixes and a few functional changes. • The Bluetooth Low Energy protocol stack, including both the controller and host, was completely retested for v1.4.0.
Page 93
Version 1.3.2 June 13, 2013 Notices: • This version of the Texas Instruments Bluetooth Low Energy stack and software is a minor update to the v1.3.1 release. It contains some minor bug fixes and a few functional changes. • The Bluetooth Low Energy protocol stack, including both the controller and host, was completely retested for v1.3.2.
Page 94
Notices: • This version of the Texas Instruments Bluetooth Low Energy stack and software is a minor update to the v1.3 release. It contains some minor bug fixes, with no major functional changes. It also contains two additional projects for the CC2541 Advanced Remote Control Kit.
Page 95
• A new Boot Image Manager (BIM) is included. This allows one CC2540 or CC2541 device to contain two separate software images (an "A" image and a "B" image) stored in flash. Upon power-up, the BIM selects which image to boot into. This can be based on criteria such as the state of a GPIO pin, or based on a selection from the previously running application upon reset.
Page 97
Version 1.2.1 Apr 13, 2012 Notices: • This version of the Texas Instruments Bluetooth Low Energy stack and software is a minor update to the v1.2 release. It contains some minor enhancements and bug fixes, with no API changes or major functional changes.
Page 98
Notices: • This version of the Texas Instruments Bluetooth Low Energy stack and software includes support for the CC2541, as well as some enhancements and bug fixes. Details of these can be found below. If you have not previously worked with the v1.1b release (which had limited distribution), TI recommends you also read the notes detailing the changes and enhancements from v1.1a to v1.1b in addition to the...
Page 100
This is useful when using Direct Test Mode (DTM), in that the Tx power level will be set to the maximum value set by the HCI_EXT_SetMaxDtmTxPowerCmd command, which may be less than +4dBm for the CC2540 and less than 0dBm for the CC2541. The function prototype can be found in hci.h.
Page 101
– A master device can now advertise while in a connection. – New production test mode (PTM) has been added allowing the CC2540 to run Direct Test Mode (DTM) while connected to a tester using a "single-chip" Bluetooth Low Energy library.
Page 102
– Added linker configuration file for support of 128kB flash versions of the CC2540. An example is included in the SimpleBLEPeripheral project. – The SimpleBLEPeripheral project "CC2540 Slave" configuration has been updated to better support the SmartRF05EB + CC2540EM hardware platform, making use of the LCD display.
Page 103
Bluetooth Low Energy applications using the CC2540 system-on-chip. It includes object code with the Bluetooth Low Energy protocol stack, a sample project and applications with source code, and BTool, a Windows PC application for testing Bluetooth Low Energy applications.
Page 147
CC2590 High Gain Mode (HGM) Low/High setting. When using this command, the CC254x Tx output power and Rx gain retain their previous values unless the previous Tx output power value was set to 4 dBm on the CC2540. In this case, the value is set to 0dBm.