I was using TMS570LS3173 for SCI RX. I used the DMA for SCI1 and SCI2(LIN). I have two size of pkts: 25B and 546B. I don't know when these pkts coming in.
g_dmaCtrPkt.DADD = pBuff;
g_dmaCtrPkt.FRCNT = 768;
g_dmaCtrPkt.ELCNT = 1U;
g_dmaCtrPkt.CHCTRL = 0U; /* channel control */
g_dmaCtrPkt.ELDOFFSET = 0U;
g_dmaCtrPkt.ELSOFFSET = 0U;
g_dmaCtrPkt.FRDOFFSET = 1U; /* frame destination offset */
g_dmaCtrPkt.FRSOFFSET = 0U; /* frame destination offset */
g_dmaCtrPkt.PORTASGN = 4U;/*PortB*/
g_dmaCtrPkt.RDSIZE = ACCESS_8_BIT;/*8bit read*/
g_dmaCtrPkt.WRSIZE = ACCESS_8_BIT;/*8bit read*/
g_dmaCtrPkt.TTYPE = FRAME_TRANSFER;
g_dmaCtrPkt.ADDMODERD = ADDR_FIXED;
g_dmaCtrPkt.ADDMODEWR = ADDR_INC1;
g_dmaCtrPkt.AUTOINIT = AUTOINIT_OFF;
I want to use polling the Buf to rx pkts. In the firtst 2 bytes, there are flags indicate the pkt length.
I check the CTCOUNT, if CTCOUNT==pkt length copy all bytes.
But I found that CTCOUNT can not update correctly. Could some one help me, how to update CTCOUNT val.
Many Thanks!