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.

How to set cc2640 into release mode using CCS?

Other Parts Discussed in Thread: CC2640, CC2540

Hi,

I am using cc2640 5mm x5mm package, with CCS(code composer studio) and TI sample project "Simple BLE Peripheral", debugger XDS110.

Currently I cannot run my code in release mode, I can only run it in debug mode. I mean I must run it with debugger attached to PC, I must run it by clicking the "start debugging" button(looks like a green triangle). Otherwise my program does not work.

What I want is that after flashing the program in cc2640, then run it without debugger. And I expect that each time after power on reset, it always runs from beginning. But now each time after power on reset, it does not run.

Does anyone knows how? Thank you.

  • You can go to CCS->Properties->ARM Hex Utility and select "Enable ARM Hex Utility" to output hex files. Then, you can download hex files with Flash Programmer 2 to your CC2640 and run it.
  • Thank you. But the Flash Programmer 2 can not recognize my cc2640, it shows "unknown device". So I cannot flash the hex file. Is it because my XDS110 firmware is out of date? How to update? 

    I think CCS itself should have a way to run in release mode, do you know that?

  • Which Flash Programmer 2 version do you use? If you download and install latest Flash Programmer 2 version 1.7.2, it will ask you for XDS110 FW update when it is connected.
  • Thank you. I installed Flash Programmer 2 version 1.7.2 and plug in the XDS110, it pops up for an update, and I clicked to update. But I forgot meanwhile my XDS110 was running in debug mode using ccs, so my XDS110 had a hardware conflict, both Flash Programmer and CCS tried to access it at the same time, then Flash Programmer 2 said update failed, due to "fail to retrieve serial number". Right now my XDS110 crashes. It can no longer be used to flash program with CCS, and Flash Programmer 2 can only recognize that it is a XDS110, but Flash Programmer 2 cannot do anything further, can not pops up to update XDS110 firmware, cannot recognize cc2640 which is attached to XDS110.

    Can you make my XDS110 work? Thanks.
  • You can find a readme.txt under C:\ti\ccs_base\common\uscif\xds110 folder. You can try to follow the steps in it to rescue your XDS110.
  •  Thank you. My XDS110 is alive again. I followed your instructions, using Flash Programmer 2 to flash the hex files of both Simple BLE Peripheral  stack and its app as my screen shot. Then, unplug debugger, reset my board's power to run in release mode, it is actully running. Everything is normal except bluetooth can not connect to mobile app. In release mode, my board is advertising, but when my phone's app tries to connect, it will result in "Interrogation timeout". While in debug mode in CCS, the bluetooth connection is good.

    Do you know what is wrong? Thanks.

  • I would suggest you to use BTool and CC2540 USB dongle to see if Simple BLE Peripheral can join Btool.
  • Hi Zhang,

    This is usually caused by the missing CCFG data at the end of flash memory. You can find an example ccfg.c file under folder "driverlib". What you need to do is to link the CCFG data with your program by using linker command file.
  • Thank you. I agree and I am trying to follow you. However, I found a lot of "driverlib" in ti folder, which one should be used? Also you mentioned using linker command file, I do not know how. Could you describe a little more about it? Thank you.
  • Yes, there are a lot of driverlib. TI is not good at folder structure planning. Beginners are used to get confused.

    If you are using the framework provided by TI-RTOS, you have better to obey the new method to setup ccfg and cmd file. I don't use this method, so I can't help you much on this.

    I like to keep thing simple, so I use transitional way to setup ccfg and cmd file. I copy CC26xxWare/startup_files/ccfg.c and CC26xxWare/linker_files/cc26x0f128.cmd to my project folder. They will be automatically added to project by CCS.

    You can also "link" them without copying. I would like to have a separated copy because I have to modify them for different projects.

  • Hi, I have found ccfg.c, but how to link it with my program? What is linker command file? Thanks.

  • Hi Zhang,

    You can copy the ccfg.c file to your project folder and add it the the project in CCS. After executing "build" command in CCS, it will be linked with other C files to get the final executable output file.

    A linker command file is a special file to configure the memory map for your project. This kind of file is very common in embedded systems. You can read this link at first for more details about command file.