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.

EK-TM4C123GXL: Time to mount an SDcard using USB TM4C123G

Part Number: EK-TM4C123GXL

I'm having a problem and I cannot find the solution.

As a first I made for test an USB+SDcard reader project (with fatfs) and I flashed it on the launchpad.
Windows takes in detecting the new device around 5s, and it works perfect.

Then I used the same project on my own board.
Windows takes in detecting the new device around 30s, and it works perfect.

It is not a hardware problem, because it's the same to the launchpad.

Any hint?

My init code is:


void USB_MSC_Initialize(void)
{
    USBIntRegister(USB0_BASE, USB0DeviceIntHandler);
    //USBIntEnableControl(USB0_BASE,    USB_INTCTRL_ALL);
    //ROM_IntPrioritySet(USB0_BASE, 0x00);

    //
    // Set the USB stack mode to Device mode without VBUS monitoring.
    //
    USBStackModeSet(0, eUSBModeForceDevice, 0);

    //
    // Pass our device information to the USB library and place the device
    // on the bus.
    //
    USBDMSCInit(0, (tUSBDMSCDevice*)&g_sMSCDevice);
}


void USB_MSC_Config(void)
{
    //
    // Configure and enable uDMA
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UDMA);
    ROM_SysCtlDelay(10);
    ROM_uDMAControlBaseSet(&sDMAControlTable[0]);
    ROM_uDMAEnable();

    //
    // Enable Peripheral Clocks
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0);
    ROM_SysCtlUSBPLLEnable();
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
    ROM_SysCtlDelay(10);

    //
    // Enable pin PD5 for USB0 USB0DP
    //
    ROM_GPIOPinTypeUSBAnalog(GPIO_PORTD_BASE, GPIO_PIN_5);

    //
    // Enable pin PD4 for USB0 USB0DM
    //
    ROM_GPIOPinTypeUSBAnalog(GPIO_PORTD_BASE, GPIO_PIN_4);

}

int main(void)
{

    //
    // Set the clocking to run from the PLL at 50MHz
    //
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_3 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);

    USB_MSC_Config();
    USB_MSC_Initialize();



    while(1)
    {

    }

}

  • If the hardware is exactly the same, the software exactly the same and the part is exactly the same, it will behave exactly the same. Since your system is behaving differently, I suggest to you that something is not exactly the same. While your hardware may be designed to be like the EK-TM4C123GXL, there might be a design or assembly difference (either intentional or unintentional). I suggest you create a simple project to toggle an I/O pin. Compare the results between your board and the EK-TM4C123GXL. Look at the time from reset released to the first toggle as well as the toggle frequency. That should help verify proper startup and operating frequency.
  • andres_dalmati said:
    ... my own board ... Windows takes around 30s - works perfect.   It is not a hardware problem, because it's the same (as) the launchpad.

    If - as you write - your "own board" is (really) the SAME as the LPad - why invest such time/cost/effort?     (in reinventing a "known good" wheel?)

    Repeatedly - poster's "dismiss or grossly underestimate" the skill & effort requirements - required to produce a proper & robust, MCU-based pcb.     Might a "far more productive approach" see your "own board" as carrying only those "special components" - required for your application - and communicating those signals back to the "known good" LPad?

    There's most always "hidden pay-back" in following this path:

    • your more limited - less demanding - smaller "own pcb" enjoys a far greater "chance for success"
    • when your boards are joined - and properly working/teamed - most always "improved methods, component choices, and other efficiencies" will "bubble up" - leading to improved performance (upon board spin #2)

    Getting "everything right" - on a FIRST GO - proves extremely unlikely.    (just as you've (and others here) observed...)

  • Hi Bob, thanks for the answer.

    Sorry for having made the terrible mistake of writing "same" ;)

    My board is not the same.
    My board has SD card, accelerometer, GPS, display, WIFI and RF module. Everything working.

    I meant that the tracks are the same as in the LaunchPad. Without any component in the middle.

    I made new tests, and it turns out that the "problem" is something related to SD. With some SD it works faster and with others slower. Regardless if they have more or less size.

    Test result (tested on launchpad and my board):


    1- SDHC 4GB Kingston C4. mount inmediately.
    2- SDHC 8GB Verbatim C4. ~20seg.
    3- SDHC Ultra 8GB SandDisk C10. ~20seg.
    4- SDHC 16GB Kingston C4. ~6 Seg.

  • It was "you" who judged "same" as "terrible mistake."    (others here (two I believe) gently disputed the "claim" of sameness.)      You do accept that (some) attention to detail IS required.    And now - very nicely provided.

    Your presentation - w/the clear-cut detail - is helpful to many here - thus your effort is appreciated and I thank you.

    Your post suggests that the "problem" stemmed from the (likely) "inadvertent deviation from initial test conditions."       All such test conditions should be recorded - reduced to writing & confirmed - so that "apples to apples" compare/contrast is maintained...

    It is firm's/my experience that the larger capacity, newer SDHC cards may prove a challenge.    (that HAD been the case - as these devices provide the, "Highest storage to cost ratio" - you may wish to expand your test now to 32GB, possibly even beyond.)

    Thanks again for a very neat, well detailed/thought, group benefiting,  "follow up."