Quantcast
Channel: Infineon Forums
Viewing all articles
Browse latest Browse all 9892

[Ethernet] iLLD driver issue on TC29x

$
0
0
Quote:

Originally Posted by vitorroriz View Post
I debugged the code once again with the help of my Master Thesis Mentor here in Toyota Motorsport.

The problem was that the DMA was receiving the local addresses of the Descriptor Lists (for Tx and Rx), addresses starting with 0xD......
However, these addresses are in the RAM of core0. Therefore we should pass the global addresses of the lists. I don't know how this demo was working for other people without the fix, maybe some specific setting on the compiler/linker to work with global addresses only, I am not sure.

Anyway, my fix was to change the functions which return the baseRxDescriptor and baseTxDescriptor to return the global address of the lists, instead of the local ones. In the case of the TC297, the local RAM addresses start with 0xD... and the global RAM addresses start with 0x7.... instead. However, there is a macro which already makes the conversion. If you observe, this macro was already being used to set the addresses of the buffers, but for some reason it was not being used to set the addresses of the descriptor lists.

For the buffer addresses, in the IfxEth.c the iLLD does:
Code:

#if !IFXETH_TX_BUFFER_BY_USER
        IfxEth_TxDescr_setBuffer(descr, &(IfxEth_txBuffer[i][0]));
#endif

With:
Code:

IFX_INLINE void IfxEth_TxDescr_setBuffer(IfxEth_TxDescr *descr, void *buffer)
{
    descr->TDES2.U = (uint32)IFXCPU_GLB_ADDR_DSPR(IfxCpu_getCoreId(), buffer);
}

Therefore, I modified the functions which return the addresses of the descriptors lists, as I mentioned:
Code:

IFX_INLINE IfxEth_RxDescr *IfxEth_getBaseRxDescriptor(IfxEth *eth)
{
    return (IfxEth_RxDescr*) IFXCPU_GLB_ADDR_DSPR(IfxCpu_getCoreId(), eth->rxDescr->items);
    //return eth->rxDescr->items;
}


IFX_INLINE IfxEth_TxDescr *IfxEth_getBaseTxDescriptor(IfxEth *eth)
{
 return (IfxEth_TxDescr*) IFXCPU_GLB_ADDR_DSPR(IfxCpu_getCoreId(), eth->txDescr->items);
    //return eth->txDescr->items;
}

I still haven't tested with loopbackmode disabled.

I hope it helps.

Kind regards,
Vitor Roriz


Thank you for posting this. I found the same problem and was able to move forward with this fix

Viewing all articles
Browse latest Browse all 9892

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>