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.

Retry.....check this stupid code on CC1110F32. BUGG

Code tested on CC1110F32 mini 868 with CCdebugger

Put a breakpoint on line "a++" run one time, and run again...

A this point the code will stopped at address 0xFFFF with KEIL or at 0x0000 with IAR...

Make one step assembler...Ok, check now the variable "a" the value will be 0xAA.

So, the code stop at the right point of code, but PC become 0xFFFF (xram).

Which bug is this ?

void main( void )
{
  unsigned char a;
  SLEEP &= ~0x04; // power down oscillators
  while( !( SLEEP & 0x40 ) ); // wait for high speed crystal to become stable
  CLKCON = 0x00; // switch from RC oscillator to high speed crystal oscillator


  WDCTL = 0x03; // set 1.92 ms for reset
  WDCTL |= 0x08; // start watchdog
  a = 0xAA;
  a ++;

  while ( 1 ) a *= 2; // a *= 2 only to avoid compiler remove it and wait reset
}

  • I have run the code and it works as expected. You are never clearing the watchdog meaning that when you hit the breakpoint, the watchdog resets the chip and PC will be 0x0000 and "a" will be 0.

    You cannot set breakpoint in the code when using the watchdog.

  • I use already Silabs and Nuvoton, and this problem is not present, if a internal reset happen, you can put the breakpoint on all code and it work prefect.

    You think that is ok, but when you are stopped on 0xFFFF, the code is stopped realy on line "a ++"..try with one assembler step... the variable a become 0xAA immediatly so you hare not stopped on reset, but reset happen on breakpoint.

    This is not normal, and is not possible to continue debug after one internal reset.

    And another test,

    If you make step to step when you are on the line "while(1)" until the reset, IT WORK

    If you run the program , this problem happen and you jump to 0xFFFF.

    Two different results with same program...only changing the way to proced