FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [February 2010 Threads] lwip port for STM32F107 repeats tx packetsPosted by Joerg Hermann on February 1, 2010 I just started to work with the freeRTOS port including the lwIP stack for the STM32 communication line devices. Everything works fine, but I found that every packet is sent twice. Diving deeper into the code I found that this is obviously done intentionally: a field 'SendCount' is maintained with the Tx descriptor, which is evaluated in the Tx interrupt processing to repeat the last sent packet. Has anyone an idea, why this is implemented that way? - Joerg
RE: lwip port for STM32F107 repeats tx packetsPosted by Richard on February 1, 2010 I would guess the Ethernet driver was copied from a uIP demo. It is quite common in uIP to send packets twice as a technique to speed up the ACK coming back from the other end of the link.
Regards.
RE: lwip port for STM32F107 repeats tx packetsPosted by Stefano Oliveri on February 2, 2010 Hi Joerg, I observer this behavior and more over I found that the Ethernet driver is configured to work in promiscuous mode. I propose a fix to both this bugs. You find more information at the following web page http://developers.stf12.net/just-another-eclipse-demo-str91x. See the bug report #B3.3 and #B3.4 Regards, Stefano
RE: lwip port for STM32F107 repeats tx packetsPosted by Joerg Hermann on February 2, 2010 Hi Stefano, thanks a lot for your reply. For some reasons I didn't look up the project page.... I'm not sure id the fix you have described there is sufficient. I modified the source at thres positions: (1) in xEthInitialise(): /* SendCount must be initialized to 2 to ensure the Tx descriptor looks as if its available (as if it has already been sent twice. */
xTxDescriptor.SendCount = 2; xTxDescriptor.SendCount = 1;
(2) in vMAC_ISR() if (xTxDescriptor.SendCount == 0) { /* Send again! */ (xTxDescriptor.SendCount)++;
xTxDescriptor.Status = ETH_DMATxDesc_OWN | ETH_DMATxDesc_LS | ETH_DMATxDesc_FS | ETH_DMATxDesc_TER | ETH_DMATxDesc_TCH | ETH_DMATxDesc_IC; ETH->DMASR = ETH_DMASR_TBUS; ETH->DMATPDR = 0;
vReturnBuffer((unsigned char *) xTxDescriptor.Buffer1Addr); } else {
(3) in vSendMACData()
while ((xTxDescriptor.SendCount < 2) && (xTxDescriptor.Status & ETH_DMATxDesc_OWN) == ETH_DMATxDesc_OWN) { while ((xTxDescriptor.SendCount < 1) && (xTxDescriptor.Status & ETH_DMATxDesc_OWN) == ETH_DMATxDesc_OWN) {
At least it seems to work and my peer server application is not longer confused about the duplicated packets ;-) I will also try the patch to turn off the promiscuous mode; thanks again for the hint. best regards, Joerg
RE: lwip port for STM32F107 repeats tx packetsPosted by Joerg Hermann on February 2, 2010 ....Sorry, the text got messed up a little bit, since the [ s] tags do not work within [ code]. Read as follows: delete text within [ s] ... [ /s] and replace by the following line(s). - Joerg
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|