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.

Error : Timed out while waiting for target powerup/polling a hardware resource.

Other Parts Discussed in Thread: EK-TM4C123GXL, TM4C123GH6PM, LM3S3748, LM3S2965

Hello, I am using EK-TM4C123GXL board. I was trying a adc single-ended example.

//*****************************************************************************
//
// single_ended.c - Example demonstrating how to configure the ADC for
//                  single ended operation.
//
// Copyright (c) 2010-2013 Texas Instruments Incorporated.  All rights reserved.
// Software License Agreement
// 
//   Redistribution and use in source and binary forms, with or without
//   modification, are permitted provided that the following conditions
//   are met:
// 
//   Redistributions of source code must retain the above copyright
//   notice, this list of conditions and the following disclaimer.
// 
//   Redistributions in binary form must reproduce the above copyright
//   notice, this list of conditions and the following disclaimer in the
//   documentation and/or other materials provided with the  
//   distribution.
// 
//   Neither the name of Texas Instruments Incorporated nor the names of
//   its contributors may be used to endorse or promote products derived
//   from this software without specific prior written permission.
// 
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// 
// This is part of revision 2.0.1.11577 of the Tiva Firmware Development Package.
//
//*****************************************************************************

#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_memmap.h"
#include "driverlib/adc.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "utils/uartstdio.h"

//*****************************************************************************
//
//! \addtogroup adc_examples_list
//! <h1>Single Ended ADC (single_ended)</h1>
//!
//! This example shows how to setup ADC0 as a single ended input and take a
//! single sample on AIN0/PE7.
//!
//! This example uses the following peripherals and I/O signals.  You must
//! review these and change as needed for your own board:
//! - ADC0 peripheral
//! - GPIO Port E peripheral (for AIN0 pin)
//! - AIN0 - PE7
//!
//! The following UART signals are configured only for displaying console
//! messages for this example.  These are not required for operation of the
//! ADC.
//! - UART0 peripheral
//! - GPIO Port A peripheral (for UART0 pins)
//! - UART0RX - PA0
//! - UART0TX - PA1
//!
//! This example uses the following interrupt handlers.  To use this example
//! in your own application you must add these interrupt handlers to your
//! vector table.
//! - None.
//
//*****************************************************************************

//*****************************************************************************
//
// This function sets up UART0 to be used for a console to display information
// as the example is running.
//
//*****************************************************************************
void
InitConsole(void)
{
    //
    // Enable GPIO port A which is used for UART0 pins.
    // TODO: change this to whichever GPIO port you are using.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

    //
    // Configure the pin muxing for UART0 functions on port A0 and A1.
    // This step is not necessary if your part does not support pin muxing.
    // TODO: change this to select the port/pin you are using.
    //
    GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);

    //
    // Enable UART0 so that we can configure the clock.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

    //
    // Use the internal 16MHz oscillator as the UART clock source.
    //
    UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);

    //
    // Select the alternate (UART) function for these pins.
    // TODO: change this to select the port/pin you are using.
    //
    GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    //
    // Initialize the UART for console I/O.
    //
    UARTStdioConfig(0, 115200, 16000000);
}

//*****************************************************************************
//
// Configure ADC0 for a single-ended input and a single sample.  Once the
// sample is ready, an interrupt flag will be set.  Using a polling method,
// the data will be read then displayed on the console via UART0.
//
//*****************************************************************************
int
main(void)
{
    //
    // This array is used for storing the data read from the ADC FIFO. It
    // must be as large as the FIFO for the sequencer in use.  This example
    // uses sequence 3 which has a FIFO depth of 1.  If another sequence
    // was used with a deeper FIFO, then the array size must be changed.
    //
    uint32_t pui32ADC0Value[1];

    //
    // Set the clocking to run at 20 MHz (200 MHz / 10) using the PLL.  When
    // using the ADC, you must either use the PLL or supply a 16 MHz clock
    // source.
    // TODO: The SYSCTL_XTAL_ value must be changed to match the value of the
    // crystal on your board.
    //
    SysCtlClockSet(SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN |
                   SYSCTL_XTAL_16MHZ);

    //
    // Set up the serial console to use for displaying messages.  This is
    // just for this example program and is not needed for ADC operation.
    //
    InitConsole();

    //
    // Display the setup on the console.
    //
    UARTprintf("ADC ->\n");
    UARTprintf("  Type: Single Ended\n");
    UARTprintf("  Samples: One\n");
    UARTprintf("  Update Rate: 250ms\n");
    UARTprintf("  Input Pin: AIN0/PE7\n\n");

    //
    // The ADC0 peripheral must be enabled for use.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);

    //
    // For this example ADC0 is used with AIN0 on port E7.
    // The actual port and pins used may be different on your part, consult
    // the data sheet for more information.  GPIO port E needs to be enabled
    // so these pins can be used.
    // TODO: change this to whichever GPIO port you are using.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);

    //
    // Select the analog ADC function for these pins.
    // Consult the data sheet to see which functions are allocated per pin.
    // TODO: change this to select the port/pin you are using.
    //
    GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_7);

    //
    // Enable sample sequence 3 with a processor signal trigger.  Sequence 3
    // will do a single sample when the processor sends a signal to start the
    // conversion.  Each ADC module has 4 programmable sequences, sequence 0
    // to sequence 3.  This example is arbitrarily using sequence 3.
    //
    ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_PROCESSOR, 0);

    //
    // Configure step 0 on sequence 3.  Sample channel 0 (ADC_CTL_CH0) in
    // single-ended mode (default) and configure the interrupt flag
    // (ADC_CTL_IE) to be set when the sample is done.  Tell the ADC logic
    // that this is the last conversion on sequence 3 (ADC_CTL_END).  Sequence
    // 3 has only one programmable step.  Sequence 1 and 2 have 4 steps, and
    // sequence 0 has 8 programmable steps.  Since we are only doing a single
    // conversion using sequence 3 we will only configure step 0.  For more
    // information on the ADC sequences and steps, reference the datasheet.
    //
    ADCSequenceStepConfigure(ADC0_BASE, 3, 0, ADC_CTL_CH0 | ADC_CTL_IE |
                             ADC_CTL_END);

    //
    // Since sample sequence 3 is now configured, it must be enabled.
    //
    ADCSequenceEnable(ADC0_BASE, 3);

    //
    // Clear the interrupt status flag.  This is done to make sure the
    // interrupt flag is cleared before we sample.
    //
    ADCIntClear(ADC0_BASE, 3);

    //
    // Sample AIN0 forever.  Display the value on the console.
    //
    while(1)
    {
        //
        // Trigger the ADC conversion.
        //
        ADCProcessorTrigger(ADC0_BASE, 3);

        //
        // Wait for conversion to be completed.
        //
        while(!ADCIntStatus(ADC0_BASE, 3, false))
        {
        }

        //
        // Clear the ADC interrupt flag.
        //
        ADCIntClear(ADC0_BASE, 3);

        //
        // Read ADC Value.
        //
        ADCSequenceDataGet(ADC0_BASE, 3, pui32ADC0Value);

        //
        // Display the AIN0 (PE7) digital value on the console.
        //
        UARTprintf("AIN0 = %4d\r", pui32ADC0Value[0]);

        //
        // This function provides a means of generating a constant length
        // delay.  The function delay (in cycles) = 3 * parameter.  Delay
        // 250ms arbitrarily.
        //
        SysCtlDelay(SysCtlClockGet() / 12);
    }
}

I changed a code a little. I used PE3 to AIN0 instead of PE7.

(The original example used PE7 for the example)

(refernce : TM4C123GH6PM datasheet 1331 page)

Plus I connected a single-turn potentiometer to PE3 and changed the clock setting to

SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN); .//40MHz

While sending data to UART, I recieved a error message from CCSv6.

CORTEX_M4_0: Error: Timed out while waiting for target powerup/polling a hardware resource.

What might be the problem?

Other forum(Stellaris forum) show similar problems like this. The suggested answer was

use SysCtlLDOSet(SYSCTL_LDO_2_75V); .

(Link : http://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/170954.aspx )

 

However, Tiva doesn't give API related to control LDO doesn't it?

What should I do..?

 

Regards, Min-Ku.

  • Hello Min-Ku

    As you mentioned that potentiometer was connected. After removing the potentiometer, the issue still persists? First thing to check would be

    1. VDD and VDDA Supply is 3.3V

    2. VDDLDO is 1.2V

    Did you try recovering the part using Unlock Sequence?

    Regards

    Amit

  • Hi,

    There it might be some conflicts with your settings - in the file provided, UART is initialized to use the PIOSC and for the rest, the main run from 16MHz, mandatory needed for the ADC. While your claim to setup the main at 40MHz, I do not know how the ADC will run. Check the settings and either remove the UART running from PIOSC, either set the main to run from something higher, like 80 MHz ( or set also the ADC to run from PIOSC).

    Petrei

  • @Amit

    Hello Amit. I checked the VDD and VDDA pins. The EK-TM4C123GXL board's VDD and VDDA pins showed 3.3 Volts.

    Is the VDDLDO pins are VDDC pins? It showed 1.27 volts.

    The same error occurs even though I disconnected the potentiometer.

    Sorry but I didn't understand recovering the part using Unlock sequence..

    @Petrei

    Hello Petrei.

    Do you mean I have to change like this?

    UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);

    ==> UARTClockSourceSet(UART0_BASE, UART_CLOCK_SYSTEM);

    Or

    SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);

    ==>SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC |  SYSCTL_OSC_INT|  SYSCTL_MAIN_OSC_DIS);

    I refered to this while doing the adc :  6648.TM4C123G_LaunchPad_Workshop_Workbook.pdf

    (At page 113)

    I didn't understand the conflicts you mentioned. Does everything should use the same clock source?

    Regards, Min-Ku

  • Hello Min-Ku,

    The VDDC of 1.27V does not seem right. All parts are factory trimmed for 1.2V.

    Also in the code I see

        SysCtlClockSet(SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN |
                       SYSCTL_XTAL_16MHZ);

    which would mean 20MHz. Can you check if the JTAG Clock is not too high (max 2 MHz)

    Regards

    Amit

  • Hi Amit.

    As you pointed out, the VDDC was shorted to something.

    There was a small solder fragment which was stuck...

    Now it shows 1.2V.

    Thank you very much.

    Can I ask 3 more question?

    1.  In order to get the system clock to be 80MHz, I thougth this would do.

    SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);

    However the SysCtlClockGet function returns 66.667MHz.

    What parameter will make it 80MHz?

    2. How can I check the JTAG Clock speed? I'm using CCSv6.

    I debug my EK-TM4C123GXL board by USB (Stellaris ICDI).

    3. Unfortunately, another debugging error appeared..

    CORTEX_M4_0: Trouble Reading Register SP: Timed out while waiting for target powerup/polling a hardware resource.

    Do you know why this error pops up?

    Regards, Min-Ku

  • Hello Min-Ku

    1. There is a problem with the SysCtlClockGet API. Even though you lock the PLL for 80MHz, it will return 66.67MHz. So just override the API return value with 80MHz.

    2. There is a ccxml file in the CCS project. If you open the file -> Advanced Setup -> Target Configuration -> Select CORTEX_M4_0, there would be a paramete JTAG Frequency (Hz). That is where you can make the edit

    3. I would suggest doing a Unlock Sequence and then retrying the CCS connect. If it does not work (I hope not that the chip was damageddue to the VDDLDO short) then you may have to replace the part

    Regards

    Amit

  • Is there a solution to this problem?  I am experiencing the same problem debugging a project in (Windoze 8.1) CCS 6.0.1.00040 on the TM4C123GXL Launchpad.  I have nothing connected to the Launchpad other than a logic analyzer and the code seems to execute flawlessly for a random period of time, then I get this error.

  • Apparently this particular debugger does not like to operate on a USB hub.  I don't recall having any problems with any other debuggers on my hub.  The MSP430 Launchpad, Silicon Labs USB Debug Adapter (two simultaneously), Infineon XMC2Go, Atmel SAMD20-XPRO, Atmel JTAGICE-Mkii, and PICKit3 have never pooched on me...

    Anyways, connecting theTM4C123GXL directly to my computer seems to have cured the problem; it has been running non-stop for a few hours now.

  • Hello Clark,,

    We have been reported the same once before where the LaunchPad does not work on a USB Hub connected on Windows 8 Machine. But when directly connected it seems to be working fine.

    Thanks to post your observations as well.

    Regards

    Amit

  • Hi Amit,


    I belive the root cause is USB-3 compatible  on this brd, not Win 8.

    I'm using USB-3 hub, it work very shortly and now it stops working.

    When I plug into PC USB directly, it appears working.

    So, do you have any solution to this problem ?

    Thanks,

    ~Duy-Ky

  • Hello Duy-Ky

    Yes, we had reports of the same nature with USB3.0 (and sometimes Win-8). There is no solution as of now except to have a USB2.0 port

    Regards

    Amit

  • Hi Amit,

    It might be more informative for others if we could clarify something regarding USB-3/Win-8

    I found 2 issues with Win 8

    1) It requires special mode in installing driver, it's SW relate-issue, so once somebody could load program onto the board, there's no SW issue here

    2) But s/he could not continue debugging, it's likely Win8 box is a new PC board with USB-3 port, and it's the cause. Normally USB-3 has BLUE, instead of BLACK, plastic part inside the connector.

    In my case, I have USB-3 hub and I could confirm that it cannot be used for this board, but I have NO PROBLEM with others, like LM3S3748/2695, or XDS100v2, ...

    The obvious difference between this board and others is this board uses another TM4C123 as a debugger, while LM3S2965 uses FTDI-JTAG for debugger

    That's why I suggest you to log a report as the develop team to look at USB stack used in TM4C123 as debugger to see if it's USB-3 compatible. I doubt it if they ever test on USB-3 hub

    Thanks, Amit


    ~Duy-Ky

  • Hello Duy-Ky,

    Yes, I appreciate your feedback. I also have a USB3.0 connector on my PC and I have never interfaced it with a Hub. The direct PC connector works all the time. So maybe it is a mix of Win-9+USBHUB+USB3.0 that may be the cause on top of a custom driver based on uC.

    I will pass on the feedback amongst other to our development team.

    Regards

    Amit