TCP/IP crash at init dma for init Ip

Hello, everybody,

I have successfully integrated the FreeRTOS kernel and a Hello World program is also running successfully. After that I have integrated the FreeRTOS-Plus-TCP into my project.

Now to my problem:
When I run the IPInit() function and it tries to set up the DMA for Ethernet communication and initialize the uncached memory, I end up in the FreeRTOS_abort and the program gets stuck.

I am using a Zynq UltraScale+ with the cortexR5 processor

Does anyone have any idea what this could be due to?

Thanks in advance
Philipp

Hi Philipp, I have only seen FreeRTOS+TCP running on MicroZed and on a Zybo board. Both had a cortex A9. I’m not sure what the differences will be with your cortex R5.

Did you use the existing driver, found here ?

Hello Hein,

thank you for your quick response.

Yes I use the drivers

void Xil_DataAbortHandler(void *CallBackRef){
(void) CallBackRef;

while(1) {
	; ---- at this point my code stuck. 
}

}

Any idea at which point in the this exception occurs?
And why? Invalid memory? Memory not suitable for DMA? Bad alignment?

Are you also using the source file uncached_memory.c? Doesn’t that module need some adaption for you CPU? Is it returning valid, uncached memory?

In the past there were some FreeRTOS posts about Xil_DataAbortHandler(): here and here.

Not sure if that is of any use.

Any idea at which point in the this exception occurs?

in x_emacpsif_dma.c the function init_dma() calls:

  • xemacpsif->rxSegments = ( struct xBD_TYPE * )( pucGetUncachedMemory ( xRxSize ) );

  • in uncached_memory.c the function *pucGetUncachedMemory( ulSize ) calls:
    vInitialiseUncachedMemory();

  • and there he jump into the memset( pucStartofMemory, ‘\0’, uncMEMOORY_SIZE);

and there it happend

i changed in the C-file uncached_memory.c

  • #define DDR_MEMORY_END (XPAR_PS7_DDR_0_S_AXI_HIGHADDR+1)

to

  • #define DDR_MEMORY_END (XPAR_PSU_R5_DDR_0_S_AXI_HIGHADDR+1)

So I guess that you can solve it now? Later we can make some #ifdef to set the correct memory addresses.

Unfortunately, no.

I don’t know what it could be.

and there he jump into the memset( pucStartofMemory, ‘\0’, uncMEMOORY_SIZE);

Could you look up the value of the pointer pucStartofMemory ?
Check if that memory location indeed exists and if there are at least uncMEMOORY_SIZE bytes?

Could you look up the value of the pointer pucStartofMemory ?

  • The value of pucStartofMemory is Hex: 00200000, Dec: 2097152

Check if that memory location indeed exists and if there are at least uncMEMOORY_SIZE bytes?

  • When I look at the memory range from 0x00200000 to 0x00300000, there are now ‘?’
    with #define uncMEMORY_SIZE 0x100000uL

Can you check the memory map of your CPU? Does it have DRAM installed had mentioned addresses?

Can you check the memory map of your CPU? Does it have DRAM installed had mentioned addresses?

  • I am not sure, where i can find that, i’m sorry.

I use a module from trenz electronics te0820 + carrier board te0701 REV06

maybe this is helpful.

Hi, I was just reading your post, until it got withdrawn “by the author”. Next time please just write a new post, saying that the problem is solved.
Also I’m curious how you solved it. Thanks!

Hi Hein,

Sorry for that, but it’s not solved at this time.

I still have the same problem.

The programmers reference for the SOC used on that board is located here:
https://www.xilinx.com/support/documentation/user_guides/ug1085-zynq-ultrascale-trm.pdf

Also, Xilinx SDK can create a FreeRTOS enabled project for that part. You might want to try generating a shell FreeRTOS system using SDK to see what it sets all of the memory defines to.

I have successfully solved the problem.

the following change must be made to uncached_memory.c:

the defined size of

“UNCACHED_MEMORY_SIZE”

must be changed from 1MB to 2MB, because the minimum block size in MMU is 2MB.

from: #define UNCACHED_MEMORY_SIZE 0x100000ul
on: #define UNCACHED_MEMORY_SIZE 0x200000ul

and as a further point the attribute must be changed.

from: Xil_SetTlbAttributes( ( uint32_t )pucStartOfMemory, 0x1c02);
to: Xil_SetTlbAttributes( ( uint32_t )pucStartOfMemory, 0x409UL );

But now I have another problem.
He won’t boot up the network.