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.

RTOS/TM4C1292NCPDT: uDMA bus error with SPI Interface

Part Number: TM4C1292NCPDT


Tool/software: TI-RTOS

Hi,

i have developed the code for SPI-DMA slave operation in TI RTOS environment and testing using Tiva™ C Series TM4C1294 EVM board. i am facing uDMA bus error while receiving the data from master device and because of the uDMA bus error that particular channel is getting disabled. i am facing the two scenario.

Scenario 1: when i use the below code in my main program before BIOS start, the DMA is working fine without any error But my Ethernet interface is not working. 

SysCtlClockFreqSet(SYSCTL_OSC_INT | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480, 120000000);
SysCtlMOSCConfigSet (SYSCTL_MOSC_PWR_DIS);

Scenario -2: The same SPI-DMA driver, i am trying to remove the below line of code, since its power down the external OSC which is used by EMAC & Phy devices. then my SPI- DMA is producing bus error and not able to receive the data. Here Ethernet is working fine.

SysCtlMOSCConfigSet (SYSCTL_MOSC_PWR_DIS);

i wanted to know how uDMA behaviour is affecting by the external OSC? please suggest the solution to get out of this problem.

i am using below tool version.

tirtos_tivac_2_16_01_14

ndk_2_25_00_09

bios_6_45_02_31

Regards

Bala

  • Hi Bala,
    Since you need to provide the 25MHz MOSC to the PHY is there any reason why you can't use the same MOSC as the clock source for your system clock generation?
    Can you not do SysCtlClockFreqSet(SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480, 120000000);
  • HI Charles,

    i have tried different below combinations and updating the DMA -SPI driver and Ethernet working status below.

    DMA-SPI driver works fine only in the below combination where Ethernet is not working.

    SysCtlClockFreqSet(SYSCTL_OSC_INT | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480, 120000000);

    SysCtlMOSCConfigSet (SYSCTL_MOSC_PWR_DIS);

     


    Rest of the below combination Ethernet is working fine and SPI-DMA driver is not working.

    Case 1:

    SysCtlClockFreqSet(SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480, 120000000);

    SysCtlMOSCConfigSet (SYSCTL_MOSC_PWR_DIS);

     

    Case 2:

    SysCtlMOSCConfigSet (SYSCTL_MOSC_PWR_DIS);

    Case 3:

    SysCtlClockFreqSet(SYSCTL_OSC_INT | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480, 120000000);

     

    Case 4:

    SysCtlClockFreqSet(SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480, 120000000);

    Case 5:

    if am not adding any of those coding in my program. Running by default configuration of EVM board.

     

    This is my main code. where i am using SSI0 for SPI-DMA transfer.

    int main(void)

    {

    /* Eval board initialization functions */
    Board_initGeneral();

    /* Clock Source Set. This is the place where i have tried different combination*/

    SysCtlClockFreqSet(SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN| SYSCTL_USE_PLL |SYSCTL_CFG_VCO_480, 120000000);
    SysCtlMOSCConfigSet (SYSCTL_MOSC_PWR_DIS);

    Board_initGPIO();
    Board_initI2C();
    Board_initUART();
    Board_initSPI();
    UARTUtils_systemInit(0);
    Board_initEMAC();

    /* LED ON for Indication of BIOS start */
    GPIO_write(Board_LED0, Board_LED_ON);

    /* Start BIOS */
    BIOS_start();

    return (0);

    }



    Am i missing something here?

    Regards

    Bala

  • Hi Bala,
    Looking at the TivaWare Ethernet examples I see the below clock configuration. Can you do the same and see if you see any difference by adding the SysCtlMOSCConfigSet(SYSCTL_MOSC_HIGHFREQ)?


    //
    // Make sure the main oscillator is enabled because this is required by
    // the PHY. The system must have a 25MHz crystal attached to the OSC
    // pins. The SYSCTL_MOSC_HIGHFREQ parameter is used when the crystal
    // frequency is 10MHz or higher.
    //
    SysCtlMOSCConfigSet(SYSCTL_MOSC_HIGHFREQ);

    //
    // Run from the PLL at 120 MHz.
    //
    g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
    SYSCTL_OSC_MAIN |
    SYSCTL_USE_PLL |
    SYSCTL_CFG_VCO_480), 120000000);
  • Hi Charles,

    i have tried setting the clock as you suggested but my DMA-SPI issue is not yet solved.

    the below clock setting i have done it in the main code.

    g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
    SYSCTL_OSC_MAIN |
    SYSCTL_USE_PLL |
    SYSCTL_CFG_VCO_480), 120000000);
    SysCtlMOSCConfigSet(SYSCTL_MOSC_HIGHFREQ);

    what could be the reason for making power down to the external clock is affecting DMA operation which is running on system clock with internal clock frequency? especially the below code
    SysCtlMOSCConfigSet (SYSCTL_MOSC_PWR_DIS);


    Regards
    Bala
  • Hi Bala,
    I don't have an answer. Did you still try to include SysCtlMOSCConfigSet (SYSCTL_MOSC_PWR_DIS) in your code? You should not disable the MOSC if you are using MOSC as the clock source for the PLL.

    I don't see anything wrong with the clock setting as you have shown above (with the SysCtlMOSCConfigSet (SYSCTL_MOSC_PWR_DIS removed). You can keep the same clock setting and write a simple DMA-SPI testcase without the ethernet and prove that it should work. If not, we can then investigate what happened.

    When you said the DMA-SPI is not working, can you be specific? Do you see any activities on the SPICLK and SIMO and SOMI pins? Check the SSI control/status register and uDMA control/status registers and are they properly set?
  • Hi Charles,

    My DMA-SPI code is alone is working fine with default clock set by EVM board. the problem only with when we enable Board_initEMAC() in my main function.

    DMA bus error flag is raised when enabling emac init function.

    i didn't setup any of the above mentioned source clock in my SPI DMA code.

    i am also setting up my SPI clock source as defined below for DMA -SPI salve operation.

    /* Configure the SSI communication parameters. */
    SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(),
    SSI_FRF_MOTO_MODE_0,
    SSI_MODE_SLAVE, 4000000, 8);
    SSIClockSourceSet(SSI0_BASE, SSI_CLOCK_SYSTEM);

    Does this is making any impact on DMA-SPI data transfer while ethernet mac is enabled?

    Regards
    Bala
  • Hi Charles,

    hereby I am attaching the both SSI0 and uDMA register details while uDMA bus error occurs in SPI-DMA slave mode operation.

     

    the following parameters are used for Configure the SysClk.

    SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);

    SysCtlMOSCConfigSet(SYSCTL_MOSC_HIGHFREQ);

     

    the return value of SysCtlClockFreqSet() is 120000000. i.e. 120 MHz.

     

    the following parameters are used for Configure the SSI0 communication. 


     SSIConfigSetExpClk(SSI0_BASE, 120000000 , SSI_FRF_MOTO_MODE_0,  SSI_MODE_SLAVE, 4000000, 8);

     SSIClockSourceSet(SSI0_BASE, SSI_CLOCK_SYSTEM);

    awaiting for the solution ASAP.

    Regards

    Bala

  • Hi Bala,
    Which TivaWare version are you using?
  • Hi Charles,

    I am using TivaWare_C_Series-2.1.1.71b.

    Regards
    Bala
  • Hi Bala,

     Can you try the latest TivaWare version 2.1.4.178. You can download from here . I wonder if you are hitting the SYSCTL#22 errata. 

  • Hi Charles,

    I have tried running with latest TivaWare version 2.1.4.178 and nothing is working-out to solve my issue. the problem still continues as uDMA bus error.

    I am getting the same set of register values with latest TivaWare version 2.1.4.178 as I shared earlier.

    Regards

    Bala

     

  • Hi Charles,

    finally i found the issue, the default EK_TM4C1294XL_initDMA(); function is defined the control table size is 32 i.e. static tDMAControlTable dmaControlTable[32]; so this control table allocates only primary control structure for all the channel.

    i am using SPI-DMA in ping pong mode, it DMA does not find alternate control structure and it leads to DMA error. so i have increased the DMA control table size 64 to hold alternate control structure also. its working good now.

    Thanks for your support.

    Regards
    Bala
  • Hi Bala,
    That is wonderful from your side. Thanks for providing the update. It will be a valuable tip to the forum community. I remembered in a different thread from your colleague I suggested him to try non ping-pong mode to simplify the debug. Anyway, glad that your problem is solved.