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.

CC2541: How to attach to a running target ?

Part Number: CC2541


I am trying to chase down a bug that happens on a target that is not attached to a debugger, so I would like to attach at a later point to be able to debug it. Like halt a running CPU and copy the contents of RAM, and registers.

According to the TI's documentation, the minimum connection required to be able to debug CC2541 are DC, DD, RST, VDD and GND.

IAR Embedded workbench doesn't have this option.

Is there a way I can achieve this ? 

  • Hi,

    You can use Debug without Downloading in IAR to connect to a running target:

    Best Regards,

    R.M

  • I tried this method, IAR Embedded studio throws this error when I remove the reset line connection to the target.

    I think the Embedded studio is trying to reset the target when I click on the "Debug without Downloading".

    Here is the communication log from IAR studio.

    Reset(resetForDebug=1)
    Reset(resetForDebug=1)
    ReadConfig(*pConfig=0xFF) = 1
    WriteConfig(config=0xFB) = 1
    ReadXdataMemory(address=0x6249, count=1, pProtection=0x00000000)
    ReadXdataMemory(address=0x6276, count=2, pProtection=0x00000000)
    ReadStatus(*pStatus=0xFF) = 1
    

  • Hi,

    I'm afraid it is not possible to connect to running target without reset of the CC2541 first. On CC2541 debug mode is entered by forcing two falling-edge transitions on the DC pin while RST pin is held low.

    Does the bug not happen when running in debug mode?

    Best Regards,

    R.M   

  • No, the Bug doesn't happen when debugging. Or I should say we don't know how to reproduce this bug, but we have some samples which are in this state and want to pause the code execution and look at the contents on the CC2541. I know we can do this on the CC2640R2, but didn't know this is not possible on CC2541.

    Thanks for the confirmation.

    Brahmesh

  • Hi,

    Yes for CC2640R2 you can do this on ARM IAR but unfortunately not for CC2541 and 8051 IAR.

    Best Regards,

    R.M