pxUDPPayloadBuffer_to_NetworkBuffer returns invalid memory address on LPC1758

andre-h wrote on Monday, November 05, 2018:

I am working on a LPC1758 using the GCC compiler with the MCUXpresso IDE. I want to setup a TCP/IP stack using FreeRTOS+TCP 2.0.7 and FreeRTOS v10.1.1.

I have written a ethernet driver that has been tested prior to adding it to to the stack. I have also written the port layer functions xNetworkInterfaceInitialise, xNetworkInterfaceOutput and vNetworkInterfaceAllocateRAMToBuffers. I have included BufferAllocation_1 so that I can use zero copy drivers.

I followed the FreeRTOS tutorial in creating sockets, binding them to a port and sending UDP packets. Unfortunately all of this has been to no avail. I have not managed to send a UDP packet. The execution kept ending up in the hard fault handler, so I traced the execution of FreeRTOS. I found that on line 826 of FreeRTOS_sockets.c, the function pxUDPPayloadBuffer_to_NetworkBuffer( ) returns a pointer to a memory address that is not a valid address on the on the LPC1758, according to its datasheet.

I am would really appreciate any help in debugging this!

Hello andre, hello everyone,

firstly, I’m sorry to popup this old posting. I am currently working on a project using the STM32H743 and I’m facing the same problem… I wondered if anyone has already found a solution to this?

I just updated the +TCP stack and the interface drivers to the latest version from Github. Networking is actually working (ping is working, I can transmit data – Thanks to @htibosch for the great work! Your contributions and examples were really helpful! ). The problem occurs only after starting to transmit larger amounts of data periodically.

When debugging I can see, that pxUDPPayloadBuffer_to_NetworkBuffer() takes “0x30040e34” as input (which I think is a valid buffer address) but returns “0x19032800” – and that is not a memory address as far as I can see…

Am I missing or overlooking something?

I am grateful for any feedback!