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 stack crash / restart?

Other Parts Discussed in Thread: CC2540

Hi All,

 I am using the CC2540 and my firmware is based on the SimpleBLEPeripheral (I have added new characteristics with 128bit UUIDs).

If I start my hardware from a power-cycle, it works OK.

If I start my hardware with / without debugger, it works OK.


However, if I reflash and restart via the debugger (in IAR), it might work, it might not. Generally, the firmware suggests it's advertisting (debug output in peripheralStateNotificationCB() ). But BTool doesn't see it. I know it hasn't crashed because I have a periodic task running (every 500ms) which toggles an LED. And I know BTool is working as it sees other BLE stuff in range.

I am wondering if the binary only stack isn't being reset properly, or the other embedded core doing the software radio magic has got into a strange state because the 8051 has been stopped / started with the debugger.

Can anybody confirm that using the debugger to reset the 8051 will also perform a full hardware reset on the radio?

If not, is there a way to guarantee the radio is in it's power-on state? Or to perform a full reset?

Thanks,

Chris.

  • Hi Chris,

    Generally the reset in IAR (8.20.2) should be sufficient. If you start at main(), this should to a power on initialization of the radio.
    Do you see this behavior with the CC2540EM?

    Best wishes
  • Thanks.
    I have managed to track down the source of the problem so I believe, and that was adding printf() via the CC Debugger into the peripheralStateNotificationCB() function to tell me what state the GAP was...... Sanity is restored now I have removed those.
    I can't rationalise that with the symptoms, but I can't go any futher into the library to find out exactly what is going on.

    Chris.