AnsweredAssumed Answered

eDMA bus error ext. sdram

Question asked by Martin Madron on Oct 29, 2015
Latest reply on Nov 9, 2015 by Martin Madron

Hello,

 

i have a bus error when i try to write/read data with edma from/to external SDRAM. Every time i get source or destination bus error. For data transfers in internal RAM or flash to internal RAM it works fine.

I can also write and read data manualy to/from SDRAM with no problem.

 

Can it be somehow related to PACR and MPR registers?

 

platform :TWR-K65, MQX, KSDK 1.3

 

Buffers (buffram is external memory section)

uint8_t destinationBuff[1000];
 __attribute__((section(".buffram"))) uint8_t sourceBuff[1000] = {1,1,2,3,4,5,6,7,8,9};

 

 

Init function

void trasferInitEdma( void)
{
    edma_status_t initStatus;
    edma_chn_state_type_t channelT;

    //  OSA_InstallIntHandler(UART0_RX_TX_IRQn, uartCom1_IRQHandler);
    OSA_InstallIntHandler(DMA0_DMA16_IRQn,  dmaController1_Chn0IRQHandler);
    OSA_InstallIntHandler(DMA_Error_IRQn,  dmaController1_Chn0ErrorIRQHandler);

    // initialiye edma drive
    //--------------------------
    initStatus = EDMA_DRV_Init(&dmaController1_State,&dmaController1_InitConfig0);
    if ( initStatus != kStatus_EDMA_Success )
    {
          __BKPT(3);
    }

    // request edma channel
    channelT = EDMA_DRV_RequestChannel(kEDMAAnyChannel, kDmaRequestMux0AlwaysOn60, &dmaController1_ChnState0);

    initStatus = EDMA_DRV_InstallCallback(&dmaController1_ChnState0, dmaController1_Callback0, NULL);
    if ( initStatus != kStatus_EDMA_Success )
          {
              __BKPT(6);
          }
}

 

transfer fnc

void tranferDataEdma(uint8_t * source, uint8_t * destination, size_t size )
{
    myTransferStatus = transferInProgress;
    edma_software_tcd_t transferDescriptor __attribute__((aligned (32)));
    edma_transfer_config_t edmaTransferConfig;

    edmaTransferConfig.srcAddr            = (uint32_t)source;
    edmaTransferConfig.destAddr           = (uint32_t)destination;
    edmaTransferConfig.srcTransferSize    = kEDMATransferSize_1Bytes;
    edmaTransferConfig.destTransferSize   = kEDMATransferSize_1Bytes;
    edmaTransferConfig.srcOffset          = 1U;
    edmaTransferConfig.destOffset         = 1U;
    edmaTransferConfig.srcLastAddrAdjust  = 0U;
    edmaTransferConfig.destLastAddrAdjust = 0U;
    edmaTransferConfig.srcModulo          = kEDMAModuloDisable;
    edmaTransferConfig.destModulo         = kEDMAModuloDisable;
    edmaTransferConfig.minorLoopCount     = 1U;
    edmaTransferConfig.majorLoopCount     = size;

    memset(&transferDescriptor, 0, sizeof(edma_software_tcd_t));

    EDMA_DRV_PrepareDescriptorTransfer(&dmaController1_ChnState0,
                                       &transferDescriptor,
                                       &edmaTransferConfig,
                                       true,
                                       true);


    /* Copies the software TCD configuration to the hardware TCD */
    EDMA_DRV_PushDescriptorToReg(&dmaController1_ChnState0, &transferDescriptor);

    /* Start DMA channel */
    EDMA_DRV_StartChannel(&dmaController1_ChnState0);

EDMA_DRV_PushDescriptorToReg(&dmaController1_ChnState0, &transferDescriptor);



/* Start DMA channel */

    EDMA_DRV_StartChannel(&dmaController1_ChnState0);
}

Outcomes