This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2540: Getting started and simple examples

Part Number: CC2540

Hello everybody.

I want rather cheap uC with USB and BLE and I chose CC2540. I bought the dongle and the CCDubugger, installed the driver and IAR Workbench. But then I got stuck up.

I downloaded both BLE-CC254x-1.5.2.0 and BLE-CC254x-1.4.0 and tried to use SimpleBLEPeripheral. It successufully compiles and uploads, but my phone doesn't find any BLE devices.

When I was looking for any "getting started" tutorial for this chip, I found out that it doesn't exist. There is only one video on youtube, from which I got know about IAR and SimpleBLEPeripheral, but I couldn't repeat it. Also I have not found any "blink" example. I think that there are not enought tutorials on this chip.

What I want to know is how to start programming for this uC. How the compile and launch the basic programm on it and how to use BLE, USB and other periperals.

  • Hi Viktoriya,

    What you have described sounds like the appropriate way to begin development. Does the dongle light up or flash its LED's as it uploads? Check out the Quickstart Guide for more info too. Did you plug the battery in?

    Best,

    Nate

  • Hello, Nathan.

    Thankyou for helping. After reading your post, I fiund out that I don't have the keyfob board. I meant the sniffer by the word "dongle". I already ask my partner to order the keyfob board. I'll write here when I receive it.

    I still want to know, if there are any examples that I can run on the sniffer?

  • There’s HostTest example can be running on CC2540 USB dongle to make it work with BTool. You can refer to www.ti.com/.../swru270c.pdf

  • Thank you Yikai!

  • Thank you for recommend this example. I really need to read the tutorial more attentively.

    I launched the example, and my phone got able to connect to PC throгgh the CC2540 dongle, when the phone is in advertising mode and the dongle is used as a scanner. I consider it as a signinficant progress in exploring CC2540. I'm gonna tell about the isues I faced during the launching.

    First of all, there are two version of SDK(or what it is): BLE-CC254x-1.4.0 and BLE-CC254x-1.5.2.0. The higher version HostTest didn't work, it even don't turn on the LED on the dongle. But 1.4.0 works fine. If you can explain this, I'd be glad.

    Then, the debugger doesn't work. I click "Download and debug", it downloads and the debugger froze up in the position on the picture. If I click "Go", the green arrow just blinks and doesn't move. When I Click "Stop", the debugger stops and the dongle begins to work as a sniffer. I really want to launch the debugger, help me please.

    And the last one, I coudn't read and write and characteristics with BLE Device Monitor, only with BTool. They both establish the connection but DM throws an error when I try to read a characteristic. I saw a thread with the issue like mine, but I don't remember where it is.

  • First of all, there are two version of SDK(or what it is): BLE-CC254x-1.4.0 and BLE-CC254x-1.5.2.0. The higher version HostTest didn't work, it even don't turn on the LED on the dongle. But 1.4.0 works fine. If you can explain this, I'd be glad.

    You'll need to make sure that you use the BTool version from the same version as your HostTest. It won't work if you try to use HostTest 1.4.0 with BTool 1.5.2

    Then, the debugger doesn't work. I click "Download and debug", it downloads and the debugger froze up in the position on the picture. If I click "Go", the green arrow just blinks and doesn't move. When I Click "Stop", the debugger stops and the dongle begins to work as a sniffer. I really want to launch the debugger, help me please.

    I think you will need this tool to debug the CC2540 in IAR because it's an 8051 core.

    And the last one, I coudn't read and write and characteristics with BLE Device Monitor, only with BTool. They both establish the connection but DM throws an error when I try to read a characteristic. I saw a thread with the issue like mine, but I don't remember where it is.

    I would recommend using BTool in general. The BLE Device Monitor application is older and less frequently used/updated.

  • You'll need to make sure that you use the BTool version from the same version as your HostTest. It won't work if you try to use HostTest 1.4.0 with BTool 1.5.2

    I installed BTool from C:\Texas Instruments\BLE-CC254x-1.5.2.0\Accessories\BTool. It's a bit weird, but the version of BTool from this folder is 1.40.15. Anyway, I launched the HostTest example for BLE-CC254x-1.5.2.0.

    I think you will need this tool to debug the CC2540 in IAR because it's an 8051 core.

    I have CCDebugger as I wrote. It download the firmware, but I can't make a step while debugging, it always stays on the first line.

    Thank you again for answering my questions.

  • but I can't make a step while debugging, it always stays on the first line.

    Can you do a screenshot to show me what you described?

  • I attached the screenshot above.

    I think the reason is in the Debug/Release configuration of the project. My IDE compiles it as Release and I remember that in STM if you compile a project in the Release configuration, you can't execute it step-by-step. But I can't fint how to switch this setting in IAR. Do you know it?

  • The screenshot looks no problem to me. If you debug step-by-step not go, can the green arrow move forward?

  • No, it can't move forward. It is the issue.

  • Hi Viktoriya,

    Have you reviewed the instructions in chapter 8 of the software development guide here? It steps through exactly what you're trying to do.

    Best

    Nate