LPC4357 Ethernet only working during Debug

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC4357 Ethernet only working during Debug

759 Views
xenthan
Contributor I

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.

Labels (1)
3 Replies

521 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Regarding the descriptor and buffers, please notice that for the LPC40xx the descriptors and buffers must be located only in peripheral RAM or external memory. This is because the Ethernet DMA is connected to the peripheral SRAM, but not connected to the main SRAM.

Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos

521 Views
xenthan
Contributor I

After tinkering with it for a bit, I found that moving the memory location of my descriptors and buffers, as well as setting the Software Reset bit in the DMA Bus Mode Register on startup has let me use the device without the debugger.  Thank you for the help.

521 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Ray,

Have you made sure you are not using the semihosting libraries? When you have linked with the semihosting library, your application will no longer work standalone - it will only work when connected to the debugger.

Thanks in advance for your response.

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos