lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] NETCONN_NOCOPY not sending


From: Nikolas Karakotas
Subject: Re: [lwip-users] NETCONN_NOCOPY not sending
Date: Fri, 17 May 2013 23:26:48 +1000

Hi,

Well I after investigating the driver I had some issue:

1. The tx descriptors were memory aligned and only the Rx stat should be
2. Also the copy wasn’t done correctly

I changed it to this:

Inside low_level_output:


static err_t low_level_output( struct netif *netif, struct pbuf *p )
{
...

/* Get free TX buffer index */
idx = LPC_EMAC->TxProduceIndex;
emac_write_packet(p,idx);

idx++;
if (idx >= eMAC_NUM_TX_FRAG)
   idx = 0;

LPC_EMAC->TxProduceIndex = idx;

....

}

And the write_packet function:

void emac_write_packet(struct pbuf *p, uint32_t idx)
{
   struct pbuf *q;
   uint8_t *dst;
   uint32_t sz = 0;

   dst = (uint8_t *)Tx_Desc[idx].Packet;
    for(q = p; q != NULL; q = q->next) {
      MEMCPY(dst, (u8_t *) q->payload, q->len);
      dst += q->len;
     sz += q->len;
   }

Tx_Desc[idx].Ctrl = (sz - 1) | (EMAC_TCTRL_INT | EMAC_TCTRL_LAST | EMAC_TCTRL_CRC);
}

-----Original Message----- From: Bill Auerbach
Sent: Friday, May 17, 2013 10:47 PM
To: 'Mailing list for lwIP users'
Subject: Re: [lwip-users] NETCONN_NOCOPY not sending

Nick,

What was the problem exactly.  It very well could help others who run into
the same issue.

Thanks,
Bill

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf
Of Nikolas Karakotas
Sent: Thursday, May 16, 2013 11:34 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] NETCONN_NOCOPY not sending

Hi,

I finally found the problem. It was a bug in the ethernet driver as you
mentioned. I fixed it up and in now works.
Thank you for pointing it out.

Regards,
Nick

-----Original Message-----
From: Bill Auerbach
Sent: Thursday, May 16, 2013 10:42 PM
To: 'Mailing list for lwIP users'
Subject: Re: [lwip-users] NETCONN_NOCOPY not sending

Hi,

It could also be that the memory is getting reused (overwritten) in the time
from the tcp_write to the time it's actually sent by the Ethernet driver.

Bill

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf
Of Martin Velek
Sent: Thursday, May 16, 2013 5:08 AM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] NETCONN_NOCOPY not sending

Hi,

my crystal ball is telling me that you are using NOCOPY to pass data e.g.
from ROM, STACK, SRAM but the EMAC driver does not provide send buffer (zero
copy) and thus cannot access the ROM, STACK, SRAM area.
This is e.g. case of LPC1788. With NETCONN_COPY, the lwip creates buffers in
the right memory regions.

Could you provide a detailed description of your configuration, like lwip
version, type of  drivers, system, etc?

Best
Martin

On Sun, May 5, 2013 at 10:41 AM, Nikolas Karakotas <address@hidden>
wrote:
Hi,

Im trying to send data with NETCONN_NOCOPY but I cant get it to work
only with NETCONN_COPY.
What could be causing this problem?

Regards,
Nick

_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users

_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users



reply via email to

[Prev in Thread] Current Thread [Next in Thread]