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.

not able to flash any program in my board

Other Parts Discussed in Thread: LMFLASHPROGRAMMER

i was able to flash other program previously.when i was trying to set the system clock to 120 MHz by using PLL in TIVA Launchpad after going through data sheet, after flashing that program i am not able to flash other program.when ever i am trying to flash its showing **error**unable to initialize target-0.i am not able to do reset also.i searched in the net and found that debug port is locked that's why this error is coming.i tried to unlock the debug port by using LM flash programmer other utility but still the same error is coming.

Is there any other way to unlock the Debug port?

  • Hello Jeke,

    Normally a debug port gets locked due to the following reasons

    1. The JTAG Pins have been made as a GPIO causing debugger to lose connect to the CPU

    2. The System Clock has been incorrectly configured

    Now that you have clearly mentioned that when you tried to use 120MHz it got locked out. Can you post the section of the code that you used for 120MHz System Clock

    Secondly, the debug port unlock does work. Make sure that you follow the steps

    1. Press the Reset Button and Power the board when plugging the USB cable

    2. While the reset button is kept pressed use the LMFlashProgrammer Unlock Utilty. Keep the reset button pressed till the application does not tell to release reset

    3. Power cycle the board

    I hope that you are using Stellaris ICDI to do the entire operation

    Regards

    Amit

  • Hi Amit,

    I am  using Stellaris ICDI to do the entire operation.Below is my code that i used for configuring system clock.while unlocking the Debug Port it also showing the message like data from non-volatile memory,user register and MAC address will be cleared.will this cause any problem?

    #include <stdint.h>
    void SetSystemClockFrequency(void);
    /*
     * main.c
     */
    int main(void) {
        volatile uint32_t index=0;

        SetSystemClockFrequency();
        //for blinking LED by setting bits in DATA register
        //Enable the GPIO PORTN
        (*((volatile uint32_t *)(0x400FE608)))=0x00001000;
        //Configure PORTN PIN0 AND PIN1 as output
        (*((volatile uint32_t *)(0x40064400)))=0x00000003;
        //configure PORTN PIN0 AND PIN1 as Digital enable
        (*((volatile uint32_t *)(0x4006451C)))=0x00000003;

        //Enable the GPIO PORTF
        (*((volatile uint32_t *)(0x400FE608)))|=0x00000020;
        //Configure PORTF PIN0 and PIN4 as output
        (*((volatile uint32_t *)(0x4005D400)))=0x00000011;
        //configure PORTF PIN0 and PIN4 as Digital enable
        (*((volatile uint32_t *)(0x4005D51C)))=0x00000011;

        //send the data to PORTN PIN0 and PIN1 and PORTF PIN0 and PIN4 to blink LED D1,D2,D3,D4
        while(1)
        {

            //turn ON LED D1 and Turn off LED D2,D3,D4
            (*((volatile uint32_t *)(0x4006400C)))=0x02;
            (*((volatile uint32_t *)(0x4005D044)))=0x00;
            for(index = 0;index<2000000;index++);
            //turn ON LED D2 and Turn OFF LED D1,D3,D4
            (*((volatile uint32_t *)(0x4006400C)))=0x01;
            (*((volatile uint32_t *)(0x4005D044)))=0x00;
            for(index = 0;index<2000000;index++);
            //turn ON LED D3 and Turn OFF LED D1,D2,D4
            (*((volatile uint32_t *)(0x4006400C)))=0x00;
            (*((volatile uint32_t *)(0x4005D044)))=0x10;
            for(index = 0;index<2000000;index++);
            //turn ON LED D4 and Turn OFF LED D1,D2,D3
            (*((volatile uint32_t *)(0x4006400C)))=0x00;
            (*((volatile uint32_t *)(0x4005D044)))=0x01;
            for(index = 0;index<2000000;index++);
        }
        return 0;
    }

    void SetSystemClockFrequency(void)
    {
        //setting the system clock to 120MHz

        //supply power to MOSC
        *((volatile uint32_t *)0x400FE07C)&=0XFFFFFFFD;

        //set MOSC as the PLL input source
        *((volatile uint32_t *)0x400FE0B0)|=0X00300000;
        *((volatile uint32_t *)0x400FE0B0)|=0X03000000;

        //if needed then set for MOSC crystal mode
        /**((volatile uint32_t *)0x400FE07C)&=0XFFFFFFF7;
        while(((*((volatile uint32_t *)0x400FE050))& 0x100) == (0X00));*/

        //set the MINT.MFRAC and Q,N to configure the PLL oscillating frequency
        *((volatile uint32_t *)0x400FE160)|=0X00000060;
        *((volatile uint32_t *)0x400FE164)|=0X00000004;

        //set the NEWFREQ flag to 1 so that MINT,MRAG,Q and N will be taken in to account
        *((volatile uint32_t *)0x400FE0B0)|=0X40000000;

        //change the Memory Timing Parameters according to new frequency set
        *((volatile uint32_t *)0x400FE0C0)|=0X03000000;
        *((volatile uint32_t *)0x400FE0C0)&=0XFFDFFFFF;
        *((volatile uint32_t *)0x400FE0C0)|=0X00050000;
        *((volatile uint32_t *)0x400FE0C0)|=0X00000300;
        *((volatile uint32_t *)0x400FE0C0)&=0XFFFFFFDF;
        *((volatile uint32_t *)0x400FE0C0)|=0X00000005;

        //USEPLL only when it is locked (when the oscillating frequency is stable)
        while(((*((volatile uint32_t *)0x400FE168))& 0x01) == (0X00));
     
        //set the PLL system clock divisor
        *((volatile uint32_t *)0x400FE0B0)|=0X00000003;

        //configure to USE the PLL
        *((volatile uint32_t *)0x400FE0B0)|=0X10000000;

        //set the FLag so that new timing parameter will come into account
        *((volatile uint32_t *)0x400FE0B0)|=0X80000000;
    }

    Thanks,

    Jeke

  • Hello Jeke,

    Direct Register Access should be used only when the 100% confidence factor has been achieved. Clearly when the PLL M,N and Q are being set the PLL Power bit must be set. Without the same the PLL will not start and clearly System Clock would end up being flatline.

    Secondly what is the MOSC clock frequency, it is not clear here either, and that would define MOSCTL settings.

    I would strongly suggest try the unlock sequence and move to the TivaWare API's

    Regards

    Amit

  • Hi Amit,

    thanks for your comment.i tried the steps as u mentioned and it worked.

    Thanks,

    Jeke.

  • Let the record show that the, "Anti-KISS" (aka Direct Register) struck again!

    Pity that the (past - perhaps present MCU manuals too) seemed to suggest Direct Register use w/in many of the peripheral set-ups & configures.  A far easier, far faster - simply superior - Peripheral Driver Library eliminates so much grief.  In the past - MCU manuals made little (perhaps NO) mention of the driver library - (if still true) that deserves correction - imho...