Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 217141

Forum Post: TMS570LS3137: EMAC_BUF_DESC_EOQ and TXHDP0 bit blocked

$
0
0
Part Number: TMS570LS3137 Hi it seems in particular bad luck situations, the estif_transmit function remain looped forever finding EMAC_BUF_DESC_EOQ and TXHDP0 .... I'm speaking about this static void estif_transmit(struct estif *estif, struct pbuf *pbuf) { struct pbuf *q; struct txch *txch; volatile struct emac_tx_bd *curr_bd, *active_head, *bd_end; if(pbuf->type == PBUF_EST) { q=q; } txch = &(estif->txch); /* Get the buffer descriptor which is free to transmit */ curr_bd = txch->free_head; active_head = curr_bd; /* Update the total packet length */ curr_bd->flags_pktlen = 0; curr_bd->flags_pktlen |= pbuf->tot_len; /* Indicate the start of the packet */ curr_bd->flags_pktlen |= (EMAC_BUF_DESC_SOP | EMAC_BUF_DESC_OWNER); /* Copy pbuf information into TX buffer descriptors */ for(q = pbuf; q != NULL; q = q->next) { /* Intialize the buffer pointer and length */ curr_bd->bufptr = (u32_t)(q->payload); curr_bd->bufoff_len = (q->len) & 0xFFFF; bd_end = curr_bd; curr_bd->pbuf = pbuf; curr_bd = curr_bd->next; curr_bd->flags_pktlen = 0; } /* Indicate the end of the packet */ bd_end->next = NULL; bd_end->flags_pktlen |= EMAC_BUF_DESC_EOP; txch->free_head = curr_bd; /* For the first time, write the HDP with the filled bd */ if(txch->active_tail == NULL) { EMACTxHdrDescPtrWrite(estif->emac_base, (unsigned int)(active_head), EMAC_TX_CH); } /* * Chain the bd's. If the DMA engine, already reached the end of the chain, * the EOQ will be set. In that case, the HDP shall be written again. */ else { curr_bd = txch->active_tail; /* TODO: (This is a workaround) Wait for the EOQ bit is set */ eth_cnt1=500; while (EMAC_BUF_DESC_EOQ != (curr_bd->flags_pktlen & EMAC_BUF_DESC_EOQ))//; { if(eth_cnt1){eth_cnt1--;} if(eth_cnt1 == 0){consolle_sci_print("\nETH TX timeout wait EOQ"); break;} }; /* TODO: (This is a workaround) Don't write to TXHDP0 until it turns to zero */ //while (0 != *((u32_t *)0xFCF78600)); eth_cnt2=500; while (0 != *((u32_t *)(estif->emac_base + EMAC_TXHDP(EMAC_TX_CH))))//; //inst_num=0 { if(eth_cnt2){eth_cnt2--;} if(eth_cnt2==0){consolle_sci_print("\nETH TX timeout wait HDP=0"); break;} }; curr_bd->next = active_head; /* Write the Header Descriptor Pointer and start DMA */ EMACTxHdrDescPtrWrite(estif->emac_base, (unsigned int)(active_head), EMAC_TX_CH); } t xch->active_tail = bd_end; } In that situation it is necessary to give a microcontroller reset to solve .... Is there any workaround software to avoid this problem? Thanks Fabio

Viewing all articles
Browse latest Browse all 217141

Trending Articles



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