Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

LM Flash Programmer - "Error - Unable to initialize target- 0"

Hi,

I have been using LM4F112E5 stellaris micro controller  for my application. I use the LM3S9b92 controller with 'LM flash programmer' to program the controller. 

While downloading the program,  I  have getting following error.  "Unable to initialize the target - 0"

I have written the following code for JTAG pins -

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
GPIODirModeSet(GPIO_PORTC_BASE, GPIO_PIN_0 |GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3, GPIO_DIR_MODE_OUT);
GPIOPadConfigSet(GPIO_PORTC_BASE,  GPIO_PIN_0 |GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_OD);

GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_0, 0);
GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_1, 0);
GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_2, 0);
GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_3, GPIO_PIN_3);

 when i download at first time, it get successfully programmed, but while downloading second time i got the above error.  please let me know what should be the problem.

  • Vivek,

    The second time you programmed, your JTAG pins were recommitted, and cannot be used as JTAG pins until they are changed back, by either software or by an unlock.

    You can do a JTAG unlock using the 'Other Utilities' tab of LM Flash Programmer.  Follow the prompts for the unlock procedure.  If you do not have a delay in the code, you will need to hold the external reset pin low the entire time....through powering on, and clicking unlock...otherwise the CPU will process the code. 

    To convert the JTAG pins PC0:3 to GPIO, a recommit has to be done.  If this was not done, as shown in Stellarisware example gpio_jtag, then it is likely the device is going into a bus fault before JTAG can be properly initialized when you are attempting to connect (program.)  If this is the case, your best fix is to do a JTAG unlock using LM Flash Programmer. 

    If you do not have LM Flash Programmer utility, please download it at http://www.ti.com/tool/lmflashprogrammer.

    Lela

     

  • Thanks for your reply. It works.