AnsweredAssumed Answered

LPC4357 Ethernet only working during Debug

Question asked by Ray Harker on May 18, 2017
Latest reply on May 26, 2017 by Ray Harker

I'm working with a custom LPC4357 board and the MAC only functions properly during a debug session.  I'm using an LPC-Link2 with the LPCXpresso software, if that matters.  I'll program the flash using the debugger, and when it begins the debug session everything works fine.  I respond to ARP packets and receive data from my PC.  When I detach the debugger and reset the board, suddenly the Ethernet no longer responds. Even if I attach the debugger while the program is running (attach-only option set to TRUE) it still doesn't work, which makes me think it's not a hardware issue (at least not pull-ups or ISP).  The only other post I've seen with this issue is this one.  The answer there seems to suggest moving the descriptors and buffers into RAM2 or the AHB section.  I currently have my main program in the AHB RAM sector (combined the 3 contiguous RAM banks into one large one), but I do have all my descriptors and buffers in RAM2.  There is nothing else that I've specifically placed into this bank.


Upon attaching a debugger to the running program, I don't see any issues with the MAC or DMA registers.  The only error I get from DMA_STAT is a TXBUFFER not available, which makes sense because I don't have any of the TX OWN bits set.  The PHY itself is programmed properly via the RMII interface, and all other registers seem to be exactly as they are during a standard debugging session.  My entire Main loop runs perfectly, but I never step into the Ethernet IRQ.  


I can attach my code if anyone believes it may help, but I'm more inclined to believe that I'm missing some tiny, one sentence blurb somewhere that explains these issues.


EDIT:  I've also come across THIS post which is very similar to the problem I'm seeing.  They also fixed the problem by changing the memory location of the DMA buffers.  I'm confused as to why memory location isn't a factor during a debug session, but becomes problematic when standalone.