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.

Can't connect debugger to a non functioning tag

Other Parts Discussed in Thread: CC2640

Hy,

to my situation: Since a couple of weeks I have the first 20 samples of a PCB with several sensors and CC2640. They run my firmware quite smoothly, but ever once in a while one of the devices stops: It won't advertise any more and a LED, which I use to signalize special eventy by short blinking, is on constantly.
Thanks to this post I am now able to debug a running target with CCS and XDS100v3. So when I try to connect a "good" device, I can dissamble, set breakpoints, read out memory and register. But when I try to connect a "stopped" target (no advertising, LED on) I see a message

IcePick_C: Error connecting to the target: (Error -275 @ 0x0) The attempt to poll a target device exceeded its timeout limit. The utility or debugger has requested that a target device be repeatedly accessed for a specific data or status value. This has failed because the built-in limit for the maximum number of attempts when polling the JTAG scan-path has been exceeded. (Emulation package 5.1.641.0)

What other possibilities do I have to look into the device? In what state could the processor be? Battery voltage is OK (2,88V), quarz seems to work, as far as I can judge with my limited measurement equipment.

Thank for your help!

Harald

  • Seems like your device is stuck in one of the "exception" interrupt ISR's, though I ma be wrong here

    (refer to section 4.1 in cc26xx reference manual) .

  • Yes, this sounds plausible.
    Do I have any chance to find out the reason of the exception? In the running firmware I did not touch exception handling, so in appBLE.cfg I have:
    M3Hwi.excHandlerFunc = null;

    In the next release, I will change that to
    M3Hwi.excHandlerFunc = "&myExceptionHandler"; /* null = default while loop function. Use e.g. "&myFxn" to use your own function. */
    and create a function like:void myExceptionHandler(exceptionFrame *e, unsigned int execLr)
    {
    uint16_t exceptioncounter;
    readEEPROM(0, sizeof(uint16_t), &exceptioncounter);
    exceptioncounter++;
    writeEEPROM(0, sizeof(uint16_t), &exceptioncounter);
    writeEEPROM(sizeof(uint16_t), sizeof(exceptionFrame), e);
    writeEEPROM(sizeof(uint16_t) + sizeof(exceptionFrame), sizeof(int), &execLr);

    HCI_EXT_ResetSystemCmd(HCI_EXT_RESET_SYSTEM_HARD);
    }

    Will that help? I kind of doubt, that my EEPROM calls will work properly, because they rely on RTOS and I2C driver.
    Is that the appropriate way of performing a reset?
    Regards
    Harald
  • Hi,

    Well, I'm not familiar with TI-RTOS, nor I have an installation of one to experiment and test with.
    I like the way you thinking, means you have to add some functionality into exception handling
    in order to be able to inspect where and why it hangs.
    Not sure that dumping info to ROM will help, think of a convenient way to retrieve the info once the CPU
    hangs in an exception IRQ.
    I was thinking about toggling LEDs in a known pattern, or something like that.
    If you have a deterministic way to inspect where the CPU hangs, I would suggest not to reset the SoC
    rather try to understand the root cause from the information visible/known to you so far (LEDs state,
    etc.)
  • Hy,

    >I was thinking about toggling LEDs in a known pattern

    good idea during development. But we are planning to start field test next week, so I need a "self-recovering" version soon.

    Do you have any ideas on how to test the exception handling? How could I generate the different exceptions?

    Of course, I could only call my exception handling synchronously, but I guess, It behaves differently when called from a real exception. For example, I don't expect the RTOS to be still running, so calls to any RTOS function will probably fail. Unfortunately, my EEPROM functions rely on the I2C functions provided by RTOS (i.e. Semaphore_pend in bsp_i2c.c), so I guess, they won't work either.

    Regards

    Harald

  • What about analyzing different sources of reset when the system is booting (refer to section 6.1.6.1).

    In exception handlers issue a "warm" reset (something like that), in main insert some case for different

    sources of reset and handle it differently.

    Another thing, although your EEPROM is external to cc26xx device, you still have the internal flash,

    which can be accessed without the RTOS api, direct addressing, as long as there is an area in FLASH

    where you are permitted to write your own data, you can dump some info by a simple write. This data

    will be read after reset.