Mark Lakata
2012-09-12 22:35:49 UTC
I've got my STM32F407 port for FreeRTOS 7.2 and lwIP1.40 running now,
with ping and HTTP working well (I started with the ST's demo which was
based on FreeRTOS6.1.0 and lwIP1.3.2, and merged it into the latest code).
However, if I stop the program momentarily with the debugger, or hit a
breakpoint, the lwIP stack slows down a lot. The ping time goes from
<1ms to 300-500 ms typically, sometimes > 2000 ms. It is easy to
reproduce, including the original ST demo code:
1. run demo code
2. count to 5
3. do a ping from another computer
4. hit 'break' in the debugger from IAR EWARM
5. hit 'run' right away
6. do another ping
I think it is related to this problem, discusses in an earlier thread:
http://lists.nongnu.org/archive/html/lwip-users/2012-05/msg00111.html
It seems that once you stop the CPU, the DMA engine gets tied up in
knots and doesn't recover, until a reset. It is related to the RBUS
interrupt flag (Receive Buffer unavailable) in the ETH_DMASR status
register. I see this bit go high forever once the problem occurs. It
does not self clear with the existing code.
I'm sure this can be fixed with a software workaround, but I haven't
found it or figured it out. I'm just starting out on lwIP and the
STM32F4x7 (first week).
Any ideas?
thanks,
Mark Lakata
with ping and HTTP working well (I started with the ST's demo which was
based on FreeRTOS6.1.0 and lwIP1.3.2, and merged it into the latest code).
However, if I stop the program momentarily with the debugger, or hit a
breakpoint, the lwIP stack slows down a lot. The ping time goes from
<1ms to 300-500 ms typically, sometimes > 2000 ms. It is easy to
reproduce, including the original ST demo code:
1. run demo code
2. count to 5
3. do a ping from another computer
4. hit 'break' in the debugger from IAR EWARM
5. hit 'run' right away
6. do another ping
I think it is related to this problem, discusses in an earlier thread:
http://lists.nongnu.org/archive/html/lwip-users/2012-05/msg00111.html
It seems that once you stop the CPU, the DMA engine gets tied up in
knots and doesn't recover, until a reset. It is related to the RBUS
interrupt flag (Receive Buffer unavailable) in the ETH_DMASR status
register. I see this bit go high forever once the problem occurs. It
does not self clear with the existing code.
I'm sure this can be fixed with a software workaround, but I haven't
found it or figured it out. I'm just starting out on lwIP and the
STM32F4x7 (first week).
Any ideas?
thanks,
Mark Lakata