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.

JTAG TAP ACK=OK/FAULT wait timeout

CPU: LM3S9B96 - IQC80C5SD - $A-28P201H
Q: 10MHz

call SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_10MHZ | SYSCTL_INT_OSC_DIS);

break in:
ulRCC2 |= (ulConfig & 0x00000008) << 3;
-> HWREG(SYSCTL_RCC) = ulRCC;

reg, var info:
ulRCC=0x78e3c00
HWREG(SYSCTL_RCC)=0x78e3ad0
HWREG(SYSCTL_RCC2)=0x7c06810

after one step:
CPU HALT (handlers not called), DEBUG PORT (JTAG) FAULT.
after power off/power on:
chip scan detected: 0x4ba00477
TAP: ACK=OK/FAULT wait timeout

restore only with recover:
srst=0, repeat 5 { to->swd, to->jtag }, srst=1, power down/up

  • My initial thought on reading this was that there may be a bug in SysCtlClockSet causing it to disable the internal oscillator (SYSCTL_INT_OSC_DIS) prior to switching to the main oscillator. Given that the part is likely using the internal oscillator when you make the function call, this would have been a very bad thing because you would be disabling the system clock. That would pretty certainly kill everything including the JTAG connection.

    Looking at the code, however, this doesn't happen. I've also verified these parameters on one of our development kits and the function works correctly for me, albeit with a 16MHz crystal rather than your 10MHz one.

    Given your 10MHz clue, I assume you are running on your own board? If that's the case, have you verified that the crystal connections are all correct and that the main oscillator is actually oscillating? If there was a problem in that area, I would expect similar results - no clock to the device. Try removing SYSCTL_INT_OSC_DIS and see if this helps. I suspect you will see the same result which would again suggest that the main oscillator isn't oscillating and would point to a problem with your crystal connection.

  • Really, problem was detected in my board. After SysCtlClockSet OSC_MAIN without OSC_DIS, call SysCtlClockSet(SYSCTL_USE_OSC | SYSCTL_OSC_INT) returned JTAG connection. But if before this, call SysCtlIntStatus(0) return MOSC_PUP | PLL_LOCK. 

    Next code not help me for detect MOSC fail:

        IntMasterEnable();
        IntEnable(INT_SYSCTL);
        SysCtlIntEnable(SYSCTL_INT_MOSC_FAIL | SYSCTL_INT_PLL_FAIL);
        SysCtlMOSCConfigSet(SYSCTL_MOSC_VALIDATE | SYSCTL_MOSC_INTERRUPT | SYSCTL_MOSC_NO_XTAL);
    
  • Detect MOSC_FAIL passed. Help for this:

    SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_OSC_INT | SYSCTL_XTAL_10MHZ);
    HWREG(SYSCTL_MOSCCTL)=(SYSCTL_MOSC_VALIDATE | SYSCTL_MOSC_INTERRUPT | SYSCTL_MOSC_NO_XTAL);
    SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_10MHZ);
    
    NMI_ISR {
       board_init(); // Enter to NMI from reset point
       NVIC_DBG_INT_R = 0x01000501ul; // DAP init
       *(uint32_t *)0xE0002000 = 3;   // FBP init
       while (!(NVIC_DBG_CTRL_R & 1)) { // Check debug mode
          ......
       } __asm__ __volatile__("bkpt #255");
    }
  • Alexander,

      I'm glad you found your problem. I am not sure if you are asking for more help in the last post. If you have another question, please could you post again and provide a few more details so that I have a better idea of your new problem?