2013-03-01

How to setup CC2540 Mini Development Kit - tutorial

Specifically for: CC2540, BLE stack v1.3, IAR 8051.

This is unbelievable, I've been at it for the second time, the first time I've encountered this.

Amusingly enough, a year and a half later, I'm encountering the same difficulty, which program (hex file) to install on which element of the setup, the dongle, and the keyfob.

A few tips:
  • First you must download the BLE v1.3 stack and tools installation.
  • If I'm not mistaken the debugger driver is been setup automatically.
  • If you are unable to program the components, then your debugger is probably out of date... use the Flash programmer or the IAR 8051 v8.20.1 (If you would be using this option, you would need to read this before you're able to build any project).
  • If the correct software is installed then the red LED would be steady on!!
  • If your computer does not recognize the dongle in the device manager, then you have installed the wrong hex file/project on it, one which keeps the red LED always on as well!!
  • If you have installed the correct software on the keyfob, the LED would be green for a sec and then OFF!!
  • If you have tried to use the BTool to discover the keyfob, and you were not successful, press the right button, this would bring the device into discovery mode.

The correct hex file for the dongle is:  CC2540_USBdongle_HostTestRelease_All.hex
(This was quite easy to determine... it is the only one with the word dongle in it)

Now as for the keyfob, this was quite confusing since:
    (I've edited the next section 3 times... this is absolutely ridicules)

  • Another file is called HostTestRelease (matching the dongle).
  • The documents speaks of SimpleBLEPeripheral.
  • And I've searched in all the documents of the demo application, and have not found any reference to the correct file (except in the link I've just added at the bottom of the post).

The correct hex file for the keyfob is: CC2540MiniDkDemoSlave.hex

Eventually after you've been able to work all the details, you can read the developer guide, or skim through this for some perspective about the BLE protocol/implementation/usage.

I hope this helps someone else... I know I've wasted two evenings figuring out what the hell is going on...

Ha... and another thing... if you search for the source code for the demo pplication, you would not find it in: (as you would expect)
    ${Installation-Dir}/Projects/ble/SimpleBLEPeripheral/CC2540...

You would find it in: (which also makes sense but not as much)
    ${Installation-Dir}/Projects/ble/KeyFob/CC2540DB

2013-02-28

Run TI BLE SimpleBLEPeripheral v1.3 application issue

Building the SimpleBLEPeripheral example project, which comes with TI's BLE v1.3 examples, using the  IAR 8051, v8.20.1, results with the following error:

Error[e16]: Segment SLEEP_CODE (size: 0x9 align: 0) is too long for segment definition. At least 0x1 more bytes needed. The
problem occurred while processing the segment placement command
"-Z(CODE)SLEEP_CODE=_SLEEP_CODE_SPACE_START-_SLEEP_CODE_SPACE_END", where at the moment of
placement the available memory ranges were "CODE:7ff8-7fff"
Reserved ranges relevant to this placement:
CODE:7ff8-7fff SLEEP_CODE
BIT:0-7 BREG
BIT:80-97 SFR_AN
BIT:a0-af SFR_AN
BIT:b8-c7 SFR_AN
BIT:e8-ef SFR_AN
BIT:f8-ff SFR_AN


Now here is the solution:

Search in IAR for this text:
   PCON = halSleepPconValue

And replace it with the following:
   asm("MOV 0x87,halSleepPconValue");


Try again to build your project... now it should work.