AnsweredAssumed Answered

MCF52259  FEC  buffer descriptors help

Question asked by Francois Bouchard on Jun 19, 2009
Latest reply on Jul 2, 2010 by Srkn Trn

Hi all,

I'm struggling to find the bug in my FEC routines.  The bug is that my Rx buffer descriptors (BD) never get updated by the FEC.  They all stay at their initial value. It's like if the FEC does'nt access the right spot in the memory.    Anyways here's some code.  I declare 4 Rx BD as follow:


/* The DMA descriptors.  This is a char array to allow us to align it correctly. */
static uint8 xFECTxDescriptors_unaligned[ ( configNUM_FEC_TX_BUFFERS * sizeof( FECBD ) ) + 16 ];
static uint8 xFECRxDescriptors_unaligned[ ( configNUM_FEC_RX_BUFFERS * sizeof( FECBD ) ) + 16 ];
static FECBD *xFECTxDescriptors;
static FECBD *xFECRxDescriptors;

/* The DMA buffers.  These are char arrays to allow them to be alligned correctly. */
static uint8 ucFECTxBuffers[ ( configNUM_FEC_TX_BUFFERS * configFEC_BUFFER_SIZE ) + 16 ];
static uint8 ucFECRxBuffers[ ( configNUM_FEC_RX_BUFFERS * configFEC_BUFFER_SIZE ) + 16 ];
static uint32 uxNextRxBuffer = 0;
static uint32 uxNextTxBuffer = 0;

The pointers to the BD rings are set here:

 

    /* Point to the start of the circular Rx buffer descriptor queue */
    MCF_FEC_ERDSR = ( volatile uint32 ) &( xFECRxDescriptors[ 0 ] );

    /* Point to the start of the circular Tx buffer descriptor queue */
    MCF_FEC_ETSDR = ( volatile uint32 ) &( xFECTxDescriptors[ 0 ] );

 

My "Rxed Frame" ISR routine is called for each new incoming frames, so I know its getting frames.   

 

My project is based on the MCF52259EVB with CodeWarrior 7.1.1a   (the patch for 52259)

 

Thanks for any suggestions.

FB

Outcomes