cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
265 Views
Registered: ‎11-21-2019

SDK Hangs on System Degugger.

Hi,

    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[15][MAX_SIZE_100MB];

          void ddr4_memory_test()
       {

        uint32_t i;
        uint8_t j;
         for(j=0;j<=14;j++)
         {
            for(i=0;i<=MAX_SIZE_100MB;i++)
            buffer[i][j] = 0x00;
         }

      }

So for this  I have created the section in the linker file (lsscript.ld) as below...( marked in yellow)scriptfile.JPG

After doing all the chages said above if I try to debug the code , SDK will hang at 99% as belowSDK.JPG

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

0 Kudos
6 Replies
Highlighted
Moderator
Moderator
233 Views
Registered: ‎10-06-2016

Re: SDK Hangs on System Degugger.

Hi @kiran.jaragappala 

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.

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.
Highlighted
Contributor
Contributor
223 Views
Registered: ‎11-21-2019

Re: SDK Hangs on System Degugger.

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.

 

DDR4_attribute.JPG

Waiting for you kind reply it helps me a lot.!!

0 Kudos
Highlighted
Moderator
Moderator
220 Views
Registered: ‎10-06-2016

Re: SDK Hangs on System Degugger.

Hi @kiran.jaragappala 

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.

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.
Highlighted
Contributor
Contributor
207 Views
Registered: ‎11-21-2019

Re: SDK Hangs on System Degugger.

Hi @ibaie 

Following is the linker file image

Linker_File.JPG

Folllowing is the Debig Configuration image

Debug_Config.JPG

Is this usefull to say DDR4 is initialized.? if not is there any other ways to find out ?

0 Kudos
Highlighted
Moderator
Moderator
193 Views
Registered: ‎10-06-2016

Re: SDK Hangs on System Degugger.

Hi @kiran.jaragappala 

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.

  1. You are building a DDR test application (in theory to test if you DDR is working OK)
  2. You are downloading data to DDR as part of your global variable (prior testing DDR is working OK)

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.

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.
Contributor
Contributor
187 Views
Registered: ‎11-21-2019

Re: SDK Hangs on System Degugger.

Hi @ibaie 

         Then I will try to use pointer to write into DDR4 memory location.

         Thanks for your time and reply. It is much appreciated.!!

0 Kudos