Skip to content

BLEMini_BiscuitCompile

XuGuohui edited this page Sep 9, 2014 · 7 revisions

Biscuit 2.0 Firmware Programmer's Guide

Last Updated: 2014-09-05


Description


Biscuit 2.0 is an open source firmware for the TI CC2540 SoC, you can download it from our GitHub page. Everyone are welcome to help adding features to it. It provides TX/RX characteristics for sending/receiving data from an BLE Central device and it redirects data to/from UART of the CC2540. You can easily connect any development board/MCU with UART interface to CC2540 development board such as our BLE Mini.

Features


Characteristics

  1. UUID: 0x713D0002-503E-4C75-BA94-3148F18D941E
    The characteristic is used to send data to BLE central, with GATT_ PROP_ NOTIFY property. When CC2540 received data from its UART RX, it will notify the data to BLE central over the air.

  2. UUID: 0x713D0003-503E-4C75-BA94-3148F18D941E
    The characteristic is used to receive data from BLE central, with GATT_ PROP_ WRITE_NO_ RSP property. When CC2540 received data from BLE central, it will output the data via its UART TX.

  3. UUID: 0x713D0004-503E-4C75-BA94-3148F18D941E
    The characteristic is used to change the UART baud rate of CC2540, with GATT_ PROP_ READ and GATT_ PROP_ WRITE property. Reading the characteristic will get a string to show the current baud rate, such as "BAUD_57600". Writing the characteristic with one byte, from 0x00 to 0x04, will change the current baud rate.

    Alt text

    Writing with the value out of the range or which length more than one byte makes no effect. The default baud rate once updated the firmware is 57600.

  4. UUID: 0x713D0005-503E-4C75-BA94-3148F18D941E
    The characteristic is used to change the BLE device name that you will see on BLE central, with GATT_ PROP_ READ and GATT_ PROP_ WRITE property. The length of device name string must be limited within 20 bytes. The default device name once updated the firmware is "BLE Mini".

  5. UUID: 0x713D0006-503E-4C75-BA94-3148F18D941E
    The characteristic is used to indicate the firmware version, with GATT_ PROP_ READ property. The latest version is "Biscuit_2.0".

  6. UUID: 0x713D0007-503E-4C75-BA94-3148F18D941E
    The characteristic is used to change the BLE TX Power, with GATT_ PROP_ READ and GATT_ PROP_ WRITE property. Reading the characteristic will get a string to show the current TX Power, such as "0 dBm". Writing the characteristic with one byte, from 0x00 to 0x03, will change the current TX Power.

    Alt text

    Writing with the value out of the range or which length more than one byte makes no effect. The default TX Power once updated the firmware is 0 dBm.

Compile Using IAR##


  1. Download and install IAR Embedded Workbench for 8051

  2. Download TI BLE-CC254x-1.4.0 SDK and install it. Assume that the installation path is "D:\IAR Systems8.2\SDK\BLE-CC254x-1.4.0".

  3. Download Biscuit2.0 firmware from RedBearLab GitHub page.

  4. Unzip the pack and merge the folder "BLE-CC254x-1.4.0" that under "<Unzip path>\Biscuit-master\Biscuit-master\current" to "BLE-CC254x-1.4.0" that under "D:\IAR Systems8.2\SDK". Merge the folders and replace the files those are existed, keeping the RedBear's.

  5. Open "D:\IAR Systems8.2\SDK\BLE-CC254x-1.4.0\Projects\ble\Biscuit\CC2540DB\Biscuit.eww" with IAR IDE. Another way is that, open IAR IDE and click on "Menu bar > File > Open > Workspace...", navigate to "D:\IAR Systems8.2\SDK\BLE-CC254x-1.4.0\Projects\ble\Biscuit\CC2540DB" to select Biscuit.eww to open.

  6. Choose the configuration you want to compile the project:

    Alt text

    • BLEMINI-USB: The configuration will generate a hex file that can be download and run from address 0x0, independent from bootloader. When BLE Mini is runnning and is connected to host PC via Micro USB, it will show a virtual comport on PC. Thus, data you want to send to BLE central or has received from BLE central will be transmitted through the virtual comport between BLE Mini and another device, such as PC. So the UART interface is left unused and change its baud rate through characteristic will make no effect.

    • BLEMINI-UART: The configuration will generate an hex file that can be download and run from address 0x0, independent from bootloader. When BLE Mini is running, The Micro USB just acts as a power supply interface. Data you want to send to BLE central or has received from BLE central will be transmitted through UART between BLE Mini and another device, such as Arduino board.

    • BLEMINI-USB UBL-1.3.2: The configuration will generate a binary file that can be applied to drag and drop programming. If you want to download it using IAR directly, you have to deploy the UBL bootloader first, otherwise, it will not run up. After the firmware running up, the usage is the same as BLEMINI-USB firmware.

    • BLEMINI-UART UBL-1.3.2: The configuration will generate a binary file that can be applied to drag and drop programming. If you want to download it using IAR directly, you have to deploy the UBL bootloader first, otherwise, it will not run up. After the firmware running up, the usage is the same as BLEMINI-UART firmware.

  7. Click on "Menu bar > Project > Rebuild All" to generate the correspoding target file.

Deployment


  1. Download the firmware using SmartRF Flash Programmer and CCDebug. The firmware must be hex format and run from address 0x0. The firmware should be independent from bootloader.

  2. Download the firmware using IAR and CCDebug. If the firmware you are going to download doesn't run from address 0x0, you have to download the UBL bootloader first.

  3. Drag and drop. To implement this ability, first of all, you have to download the TI USB Boot Loader (UBL) version 1.3 via CCDebug. The firmware should be generated in binary format(*.bin). Regarding BLE Mini, keep the on-board button down and connect it to host PC, then it will detect a new disk. Release the on-board button and open the disk. Delete the old firmware if it exists and drag the new firmware to the disk and drop it. After the file being pasted, the new firmware will run if everything is all right.

Support