Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN,
This for TMS570LS3137 using HALCoGen generated code and lwip 1.4.1 example code.
I've had an issue when using the lwip stack in the provided example code. Everything works as intended 99% of the time. When receiving multiple packets in quick succession (on the order of 10-20 within a few mS), it will cause the stack to get stuck. It sounds like this issue. The buffer descriptor points in the linked list in the rx interrupt handler gets corrupt showing a nonsensical packet length. I tried to increase my buffers to a large number, 30. This seems to resolve the interrupt being stuck/corrupted link list, however I have a system watchdog which times out. The amount of time spent processing all of those packets is too much. I have some questions towards finding a resolution:
1. The provided lwip documentation mentions that the stack uses DMA in the CPPI RAM for the buffer descriptors. I don't see where this actually occurs in the code. There is no init for the DMA called anywhere. In addition, there a bunch of functions in emac.c which relate to init, and rx/tx interrupts but none of them are used. It seems a parallel set of functions was created in hdkif, and I'm not sure why... It seems like these functions may be more comprehensive then the ones provide in the hdkif file. The emac.c function also does an init call for the DMA. Is the hdkif provided in the example code actually using DMA? Why are the functions in emac.c not used? should they be?
2. I tried to enable RX pacing to help with the watchdog timeout. I was hoping it would stagger the interrupts a bit more to allow the watchdog to be kicked. When trying to enable this via INTCONTROL and the C0RXPACEEN, I ended up making the rx/tx break in lwip. Is there a specific way to enable that?
3. I have considered having the RX poll, which was mentioned here. I have tried that in the past and it did not work correctly. Is all that is required is to disable the RX interrupt and poll as mentioned?
I have modified the watchdog to trigger the ESM and I've checked the stack when that is triggered and it's either in the rx handler or one of my lwip callbacks. Is there something else I might be missing? Is there a more methodical way to debug why the hdkif rx linked list gets corrupt? I've noticed that I can reproduce it if I send 10 packets, wait a second, and then send another 10 packets. The second 10 packets is always what causes the watchdog timeout, not the first 10.