zynq at 1000Mbps link speed with FreeRTOS+TCP

wzengerle wrote on Friday, June 15, 2018:

Is there a way to get the link speed on the zynq to work at 1000Mbps with FreeRTOS+TCP? I saw in a 2015 post that the +TCP demo had only been tested at 100Mbps. I’m using a MicroZed board, I have my own HW and BSP projects - they have been working on lwip (raw) at 1000Mbps. I downloaded the labs 160919 package and have the demo working at 100Mbps. After looking at the driver source code, I changed ipconfigNIC_LINKSPEED100 to ipconfigNIC_LINKSPEED1000, but then it doesn’t work at all (nothing crashes, but no logging comes out and it does not ping). Is there another setting that has to change as well? I notice that the zynq support files in 160919 are behind FreeRTOS10.0.1 - should I update them? I’m using v2018.1 of the Xilinx SDK.

heinbali01 wrote on Friday, June 15, 2018:

Have you tried the option ipconfigNIC_LINKSPEED_AUTODETECT? That worked for me, Zynq got a 1 Gbps connection.
I’ll attach the latest +TCP driver for Zynq, just to make sure it will also work for you.

wzengerle wrote on Saturday, June 16, 2018:

I haven’t tried that one. I’ll check it out Monday. Thanks!

wzengerle wrote on Monday, June 18, 2018:

ipconfigNIC_LINKSPEED_AUTODETECT did the trick, thanks for your help.

I also merged in the code you attached and it seems to work (well, connects at 1000Mbps and logs; I haven’t tried the other functions at this point). I had to make a couple of changes to get it to compile & link:

  • def’d out lines 213 to 219 of NetworkInterface.c (the function xCheckLoopback() isn’t included in my project)
  • in x_emacpsif_dma.c, I commented out the line #include “eventLogging.h” and the 2 calls to eventLogAdd() on lines 382 & 647 - looks like some debug code; I don’t have an eventLogging.h in my FreeRTOSlabs based project.
  • also in x_emacpsif_dma.c, on line 480 I changed passEthMessages(); to passEthMessages(ethMsg); the code wasn’t consistent and wouldn’t compile (older versions using file scope variable instead of passing the ptr).

I’m also curious why the allocation for the uncached memory is done the way it is. Putting something after the linker’s ‘end’ marker seems like asking for trouble. Why not just use a static buffer and mark it with the align directive?

Like so:
static uint8_t uncached_mem[UNCACHED_MEMORY_SIZE] attribute ((aligned (UNCACHED_MEMORY_SIZE)));
pucStartOfMemory = &uncached_mem[0];

Instead of:
/* At the end of program’s space… */
pucStartOfMemory = (uint8_t ) &_end;

* Align the start address to 1 MB boundary.
pucStartOfMemory = (uint8_t *)( ( ( uint32_t )pucStartOfMemory + UNCACHED_MEMORY_SIZE ) & ( ~( UNCACHED_MEMORY_SIZE - 1 ) ) );

Lastly, something that will cause issues with anyone trying to use C++:
There is one place left that I can see where a function declaration is in the .c files rather than including Networkinterface.h. x_emacpsif_hw.c line 143 (xNetworkInterfaceInitialise).