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.

CC2640 works ONLY in debug mode and not stand alone.

Other Parts Discussed in Thread: CC2640, BLE-STACK

Hello,

I have a strange phenomenon with the CC2640 on a custom board that I made and I was wondering if you might have any tips to find out the source of this behavior.

I took the standard sensor tag program (first stack and then application) and loaded it to the device via the debugger. I hit run in debug mode and I can detect my custom board via the sensor tag app on my android phone. However, when I turn off the power to the board and disconnect the debugger from the board and then turn the power back on the program doesn't run on the CC2640. I know that since the board is not longer detectable on the sensor tag android app. 

Then, I took the sensor tag application project on CCS6.1 and modified it by adding a task that constantly  blinks an LED on my custom board. It works great via the debugger. But after I disconnected the debugger and reset the board power the software just doesn't run on the CC2640 since the LED doens't blink.

Another thing that I noticed is that if I click on the "Terminate" button in CCS6.1 during debug mode then the debugger stops (of course) but then the application on the CC2640 continues to run (or resets - I don't know for sure). At that point I can disconnect the debugger cable from my board and the application is still running. But then when I turn off the power and turn it back on the application does not run anymore.

I must add that I soldered the CC2640 IC to the board myself using a hot air blower. Could I have damaged perhaps the chip? At first that is what I had thought so I removed the chip, and put a new one using the same soldering method and I still see the SAME behavior. I don't understand why the program doesn't run on the IC when I reset the power.

I don't get it. I have a SensorTag and I checked and saw that unlike my custom board, if I take out the coin battery and put it back in then it simply resets and does works again (without any connection to my debugger). 

Any thoughts?

Thanks,

Eyal

  • Hello,

    Can you check all relevant power lines using a oscilloscope and be sure that they are clean and at the correct level? There is a possibility that your custom board isn't being powered properly when the debugger isn't connected.
  • I measured the voltages on all VDDS and VDDR inputs of the CC2640 IC.
    I measured using a Fluke 117 DVM:

    When the board is stand alone and doesn't work or when it is connected to the debugger and is working:

    VDDS is 3.02V
    VDDR is 1.68V

    I wanted to add that I tried measuring with my oscilloscope too and measured the same stable values. 

  • Just to be sure, you are running/loading code from Flash and not RAM correct? You haven't modified the linker files?
  • Hi Sean,

    That is correct.

    I did not modify the linker files and I am running the code from flash.

  • An oscilloscope capture of the power rails during power on would be helpful. Any significant hardware or layout changes?
  • Do you download BIM when you want to run It without debugger?
  • Hi YK Chen,

    I don't think BIM is relevant since I am not using OAD...
  • Hi Sean,

    Thanks for all your support but I managed to resolve the problem in a different way.
    I simply did a complete erase of memory using the latest version of the Flash Programmer 2.
    Then I reloaded the sensor tag stack followed by the sensor tag application (and later also my modified version of the application with the LED blink) and it works!
    Now I may disconnect the debugger and reset the board and the program continues to run.

    Regards,
    Eyal
  • As I know, you have to use BIM with latest sensor tag application in BLE-STACK V2.1.
  • Eyal,

    The CC26XX requires a flag set in the CCFG (customer configuration) area at the end of the flash (FLASH_IMAGE_VALID) which the ROM bootloader will look for before branching to either the application code or the ROM bootloader.

    In the SensorTag application, this is part of the BIM project by default as the last flash page is shared between BIM and CCFG.
    If you do not use BIM you can include the appBLE_ccfg.c file which is excluded from build in the SensorTag application project and you should be fine.

    Let me know if this solves the problem. For more information on the CCFG area, see the technical reference manual SWCU117, chapter 9 (Device Configuration).

    Regards,
    Svend
  • Hi Svend,

    I have solved my problem.
    I simply forced a complete erase of the flash of the CC2640 using the latest version of the Flash Programmer 2.

    Then I reloaded the stack and app versions of the SensorTag program via the debugger to my custom board and it now works stand alone even when I disconnect the debugger and reset the power.

    Nonetheless, I will also look into your recommendation and get back to you once I am back at my work station. Maybe what I did had something to do with your recommendation.

    Thanks!
    Eyal