MCF5485 FEC DMA problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCF5485 FEC DMA problem

1,936 Views
admin
Specialist II
Hello all!
I testing my own FEC driver for RTEMS and has a following problem:

Sometimes program hangs on MCD_continDma( sc->dma_tx_channel ); (RTEMS multitasking turned off at this moment)
dma_tx_channel is right.
DMA interrupt handler is normal too: { printk( "TX\n" ); }
DMA API version: Alpha v0.3 (2004-04-26)
There is part of TX initialization code:
dma_res = MCD_startDma(
    sc->dma_tx_channel,
    (s8*)sc->txdesc,
    0,
    (s8*)&( MCF548X_FEC_FECTFDR( ifp-
    0,
    FEC_MAX_TX_FRM_SIZE,
    0,
    sc->dma_initiator_tx,
    FEC_TX_DMA_PRI,
    ( 0
    | MCD_FECTX_DMA
    | MCD_INTERRUPT
    | MCD_TT_FLAGS_CW
    | MCD_TT_FLAGS_RL
    | MCD_TT_FLAGS_SP
    ),
    MCD_NO_CSUM | MCD_NO_BYTE_SWAP );
Any ideas, why is such thing happening? Can TX DMA cause a system hang?

Thanks!
Labels (1)
0 Kudos
Reply
1 Reply

870 Views
admin
Specialist II
Hello again!

1)
Here is additional info on my problem: see attachment (or http://www.wikiupload.com/download_page.php?id=92929).
It's sources of very simple testing standalone application, that trying to send packets (42 bytes each) via the FEC0 and FEC1 periodically.
You can find this loop in the fec_test() function (fec_test.c). The problem is, program causes exception 119 (interrupt source 55) during the first (or sometimes third) packet sending (function fec_sendpacket() in fec_test.c). But interrupt 55 can't be called by CPU, because it masked (and has level 0 priority 0)! :smileysad:  I think, that reason is some strange behaviour of the TX DMA.
And one more note: after removing m68k_disable_interrupts() and m68k_enable_interrupts() functions from the fec_sendpacket(), program works fine!

2)
Another problem with FEC: sometimes TX packets lost. I send packet -> got DMA (48) interrupt -> got FEC0 (39) interrupt with TXF flag in EIR register. All fine, no any errors. But a receiver (another ColdFire board or PC) not receive this packet.

Full CPU name: MCF5485CVR200 L14S QDA0808.

Please, help!

Thanks!
0 Kudos
Reply