02-06-2020 11:09 PM - edited 02-06-2020 11:19 PM
In SDK I have created 'Zynq MP DRAM Test' template project to test DDR4 memory present in the UltraZed SOM.
So I have created a 100 MB buffer as below ...
#define MAX_SIZE_100MB (100*1024*1024)
char __attribute__((section(".DDRMemSection"))) buffer[MAX_SIZE_100MB];
buffer[i][j] = 0x00;
So for this I have created the section in the linker file (lsscript.ld) as below...( marked in yellow)
After doing all the chages said above if I try to debug the code , SDK will hang at 99% as below
But after removed all the above changes I can debug/Run the code.
Please help me how to solve the above said problem. Thanks in Advance. !!
Data sheet of the Ultrascale + MPSoC : https://www.xilinx.com/support/documentation/data_sheets/ds891-zynq-ultrascale-plus-overview.pdf
02-07-2020 02:36 AM
Is there any reason why you are adding that code in the DRAM test? I mean, the template application is already enough for testing the DRAM...
Anyway the issue is just you placed a buffer as global variable, which is a segment that is loaded by the debugger into the memory. So if the debugger tries to load something into DDR that has not been already initialized then it would fail and hang as in your case.
02-07-2020 03:03 AM
Hi @ibaie Thanks for the reply.
I want to access the DDR4 memory which is present from the address 0x00000000 to 0x7FFFFFFF ( 2GB ) which is already initialized.
So I created the 'DDRSection' in the linker file and used the attribute with the buffer variable.
But as you suggested when I used buffer as local varialb am seeing the following error message.
Waiting for you kind reply it helps me a lot.!!
02-07-2020 03:07 AM
Are you sure that is already initialized? Can you show your debug configuration settings when you launch the debug session?
BTW, I'm not suggesting you should use the buffer as local variable, local variables are placed in the stack so you cannot use the section attribute to place somewhere else! I was just explaining that global variables are loaded by the debugger to their memory location so if you place in a wrong address or a memory that is not really available then the download process fails.
02-07-2020 03:21 AM
02-07-2020 03:35 AM
In theory your DDR is already initialized as you have selected to run the psu_init script on your debug configuration. However if you think on the use case, you would notice that it does not really take too much sense your approach.
You application needs to write into DDR for testing purposes but the way you should perform that operation is using a pointer rather than placing data into DDR in your data segments.
02-07-2020 03:42 AM