[Solved] LPC1313 locks up waiting for SYSPLL (IAR/J-Link EDU toolchain)

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [Solved] LPC1313 locks up waiting for SYSPLL (IAR/J-Link EDU toolchain)

    I am hoping that someone finds this problem familiar.

    During startup and using an unmodified SystemInit() function in system_LPC13xx.c ...

    #if (SYSPLL_SETUP) /* System PLL Setup */
    LPC_SYSCON->SYSPLLCTRL = SYSPLLCTRL_Val;
    LPC_SYSCON->PDRUNCFG &= ~(1 << 7); /* Power-up SYSPLL */
    while (!(LPC_SYSCON->SYSPLLSTAT & 0x01)); /* Wait Until PLL Locked */
    #endif

    My program is stuck on the instruction "while (!(LPC_SYSCON->SYSPLLSTAT & 0x01))
    Checking the assembly code and addresses, doesn't show anything incorrect. The PLL just doesn't indicate Sync'd and Locked.

    Both the software and hardware previously worked, but not after I had some tool chain upgrades.
    The problem also occurs with the IAR/CMSIS example projects for the LPC13xx.

    This all worked under IAR 5.3x running a competitor's hardware and dll.
    I upgraded IAR to 6.20 and a Segger J-Link EDU with the latest firmware and dll.
    (I also tried IAR-5.50 + Segger J-Link, no difference)

    At this time I suspect IDE, library initialization, nxp1313 bootloader or configuration bit issues, or J-Link issues.
    The program runs from on-board flash. The SystemInit() function is the first function called from Reset_Handler

    As a sanity check, I added code to turn off one of my LEDS before the instruction and another one after the instruction. The LEDs operated properly, so I know I am looking at the right code. The code behaves identically using connected J-Link power and unconnected battery power, so the problem is programmed into the part.

    Does anyone have an idea where to look next?

    The post was edited 1 time, last by Hankers ().

  • One of the delivered settings in System_LPC13xx.c is to start up the System Oscillator. On the board there is no crystal attached so the system oscillator likely was doing something bad which affected the SYSPLL.

    My solution is pull out the code I need to my own file (that won't get stomped on in an upgrade) and not power SYSOSC.
  • Hi Hankers,

    if I understand you correctly, there is is no problem on the J-Link side and after
    pulling out the piece of code which switched to the System oscillator everything works as expected, correct?


    Best regards
    Alex
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.