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.

CCS/TM4C123GH6PM: write to certain GPIO locks/resets microcontroller

Part Number: TM4C123GH6PM
Other Parts Discussed in Thread: EK-TM4C123GXL

Tool/software: Code Composer Studio

Hi there again TI Forum,

I have another issue i cannot get over myself and i'm seeking for help.

So. My Problem is this code:

void writeData(axis_t* l_axis, uint8_t* data, uint8_t len)
//write Data to SPI, Datawidth is set to 8bit;
{
    int i;
    for(i=0; i<len; i++){
        GPIOPinWrite(l_axis->latchpinBase, l_axis->latchpin, 0);//enable SPI Module
        SysCtlDelay(50);//Have 125ns pause after each and every byte transmitted;
        SSIDataPut(l_axis->SPI_BASE, (uint32_t)data[i]);
        while(SSIBusy(l_axis->SPI_BASE));
        GPIOPinWrite(l_axis->latchpinBase, l_axis->latchpin, l_axis->latchpin);//disable SPI Module <-------- this Line
        SysCtlDelay(50);//Have 625ns pause after each and every byte transmitted;
    }
}

Is killing/locking the microcontroller, when using GPIO_PORT_D GPIO_PIN_3 as target. Using others PORTS/Pins work.

Port and Pin are configured using

MAP_GPIOPinTypeGPIOOutput(GPIO_PORTD_BASE, GPIO_PIN_1);
MAP_GPIOPinWrite(GPIO_PORTD_BASE, GPIO_PIN_1, GPIO_PIN_1);
MAP_GPIOPadConfigSet(GPIO_PORTD_BASE, GPIO_PIN_1, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);

as is output from the pinmuxtool, i added the padConfigSet in the hope it might resolve the issue.

The issue is now that the first couple of times this code is working(reliably), but then, using this command from some USB/Command Handler it just fails.

I use a TivaC Launchpad, and the debugger gets deconnected. Without using a debugger the microcontroller just gets irresponsive (seen from USB) and needs to be restarted. So i cannot just read out errorstates ort tell you if the uController is in some ISR. Changing the Launchpad for another(which usually helps in such cases) doesn't help here.

I boiled it down to the line

HWREG(ui32Port + (GPIO_O_DATA + (ui8Pins << 2))) = ui8Val;

So, do have any idea what could go wrong? Have you had any similar problem? Could you point me to some direction, because i feel slightly clueless about what i could do now.

I'm using ccs7 on windows 10,

TivaWare 2.1.178 driverlib and usblib, recompiled for TM4C123GH6PM

PD1 also is the FSS signal of the SSI module i use here, but FSS is disabled using TIPinMux.

The SSI is used in SPI Mode3 and init using

    SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI1);
    while(!SysCtlPeripheralReady(SYSCTL_PERIPH_SSI1));
    SSIConfigSetExpClk(SSI1_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_3, // Moto fmt, polarity 1, phase 1,
                       SSI_MODE_MASTER, SPI_FREQ, 8);
    //
    // Enable the SSI0 module.
    //
    SSIEnable(SSI1_BASE);

which also should not enable the corresponding FSS pin.

most of the forum GPIO related themes are about setting pins not right, but in my case it resets the whole uController.

I was using a watchpoint to check __STACK_TOP and it doesn't get written, so i think it's not a stackoverflow error.

So... hoping for your ideas and input

Olli

  • I have been unable to recreate your issue.

    Oliver Schwanke said:
    killing/locking the microcontroller, when using GPIO_PORT_D GPIO_PIN_3

    By "Killing/locking" do you mean that JTAG access is lost?

    Can you provide a project that shows this issue using an EK-TM4C123GXL?

  • I have not heard back from you so I assume you resolved this issue. I will close this thread. You may reply to this thread and it will reopen if the issue is not resolved.