found it. DMA can obviously not handle fragmented pbufs to receive packets. -> debug cleanup needed

This commit is contained in:
2024-08-22 18:14:51 +02:00
parent 497e380860
commit ae47ca8291
5 changed files with 37 additions and 3 deletions

View File

@ -115,6 +115,17 @@ volatile u32_t notifyinfo[4*XLWIP_CONFIG_N_TX_DESC];
* for BDs. The rest 768 KB of memory is just unused.
*********************************************************************************/
void printInt(int i) {
outbyte(i / 100 + 0x30);
i = i % 100;
outbyte(i / 10 + 0x30);
i = i %10;
outbyte(i + 0x30);
outbyte(10);
}
#if defined __aarch64__
u8_t emac_bd_space[0x200000] __attribute__ ((aligned (0x200000)));
#else
@ -291,6 +302,7 @@ void xemacps_process_sent_bds(xemacpsif_s *xemacpsif, XEmacPs_BdRing *txring)
void emacps_send_handler(void *arg)
{
outbyte('t');
struct xemac_s *xemac;
xemacpsif_s *xemacpsif;
XEmacPs_BdRing *txringptr;
@ -498,6 +510,7 @@ void setup_rx_bds(xemacpsif_s *xemacpsif, XEmacPs_BdRing *rxring)
void emacps_recv_handler(void *arg)
{
outbyte('r');
struct pbuf *p;
XEmacPs_Bd *rxbdset, *curbdptr;
struct xemac_s *xemac;
@ -538,10 +551,13 @@ void emacps_recv_handler(void *arg)
}
for (k = 0, curbdptr=rxbdset; k < bd_processed; k++) {
outbyte('p');
bdindex = XEMACPS_BD_TO_INDEX(rxring, curbdptr);
p = (struct pbuf *)rx_pbufs_storage[index + bdindex];
xil_printf("reading bd index %i bdindex %i p %p payload %p\n", index, bdindex, p, p->payload);
/*
* Adjust the buffer size to the actual number of bytes received.
*/
@ -550,6 +566,7 @@ void emacps_recv_handler(void *arg)
#else
rx_bytes = XEmacPs_BdGetLength(curbdptr);
#endif
printInt(rx_bytes);
pbuf_realloc(p, rx_bytes);
/* Invalidate RX frame before queuing to handle
@ -775,6 +792,8 @@ XStatus init_dma(struct xemac_s *xemac)
#endif
XEmacPs_BdSetAddressRx(rxbd, (UINTPTR)p->payload);
xil_printf("setting bd index %i bdindex %i p %p payload %p\n", index, bdindex, p, p->payload);
rx_pbufs_storage[index + bdindex] = (UINTPTR)p;
}
XEmacPs_SetQueuePtr(&(xemacpsif->emacps), xemacpsif->emacps.RxBdRing.BaseBdAddr, 0, XEMACPS_RECV);