UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor arsenek
Visitor
5,641 Views
Registered: ‎02-08-2011

EDK13.1 Debug problem with DDR

Hi,all

 

         I have a project with microblaze and DDR2. And there are two different types boards , one works well, and another's DDR have some problems(almost all the boards of that type).

         Two different types board have the same DDR circuit, I think there is little possibility that have a hardware error.

 

         Then I try to make a DDR test to locate where problems happens.But I've got another strange problem either.

 

         My test enviroment : EDK13.1, two types' board(Let's call them type A and type B), a minimum FPGA project in ISE(just have a test led and microblaze system) ,microblaze system(just have a DDR and a UART peripherals).

         First I tried "memory_test" project built in EDK, in this case , type A works well,type B failed.

         Then I wrote a very simple test code as below:

 

#include <stdio.h>
#include "xparameters.h"
#include "xutil.h"
#include "xio.h"


#define BASEADDR XPAR_MCB_DDR2_MPMC_BASEADDR


int i,j,error_count;

 

int main()
{
    i = 0;
    j = 0;
    error_count = 0;

    xil_printf("start\r\n");

    xil_printf("&i = 0x%x\r\n", &i );
    for(i = 0; i < 40;){
        XIo_Out32((BASEADDR+i),0xAAAA5555);

        j = XIo_In32((BASEADDR+i));

        xil_printf("readback data : %d",j);
        xil_printf("!\r\n");
        if(j != 0xAAAA5555){
            xil_printf("error!\r\n");
            error_count++;
        }
        i += 4;
    }
    xil_printf("error_count : %d\r\n",error_count);
    xil_printf("--Memory Test Application Complete--\r\n");

    return 0;
}

 

 in this case , type A works well too, and type B have a problem that never occurs:

      when I use the debug mode ,step over to the line "XIo_Out32((BASEADDR+i),0xAAAA5555);"

EDK told errors : cannot access memory at address 0x230

                              cannot access memory at address 0x234

                              cannot access memory at address 0x238

In my opinion , address 0x230 0x234 0x238 should be the address storing variable i,j,error_count.

I don't know how this problem happens.

 

Then I made a test, change the BASEADDR to the microblaze bram address which didn't used by the code.

No problem happens, works well.

 

I don't know why this happens.Any idea is thankful and welcome.

 

PS. when I use debug mode in EDK, there always have a warning : .gdbinit: No such file or directory.

 

what's the meaning about that?

 

thank you!

Tags (1)
0 Kudos
6 Replies
Voyager
Voyager
5,635 Views
Registered: ‎05-09-2008

Re: EDK13.1 Debug problem with DDR

Hi,

 

You have tried to do the RAM test ? 

 

You have tried with "memory_test" generated by the SDK ?

 

You have tried with "memory_test" generated by the SDK on full memory range ?

 

After these tests successfully you can proceed to write your program.

 

- ".gdbinit" is init file for GDB, create this file in root of directory :

 

set download-write-size 4096
set remote memory-write-packet-size 16384
set remote memory-write-packet-size fixed
set remote memory-read-packet-size 4096
set remote memory-read-packet-size fixed

 

If you have an Hardware problem, fix this first ...

 

secureasm

 

0 Kudos
Visitor arsenek
Visitor
5,631 Views
Registered: ‎02-08-2011

Re: EDK13.1 Debug problem with DDR

Hi secureasm:

 

        thanks for your answer. I just add the .gdbinit file and there is no more warning like that.

 

And I have tried to do the RAM test with "memory_test" generated by the SDK ,but it cannot excute completely, I use debug tools find the problem:

 

when code runs to  function  XUtil_MemoryTest32() and execute the INCREMENT test ,SDK is crashed and gives following

info :

 

"Execution is suspend because of error : Cannot access memory at address 0xd50"

 

it looks similar to the problems occurs above, I don't know why I write / read the DDR but the SDK tells me I can't access memory at address of BRAM. Something makes my codes crashed?

0 Kudos
Voyager
Voyager
5,615 Views
Registered: ‎05-09-2008

Re: EDK13.1 Debug problem with DDR

Hi,

 

The board is "custom board" or "development board" ?

 

Have you tried lowering the main clock speed ?

 

Have you tried lowering the JTAG clock speed (24 Mhz we advise not to use) ?

 

secureasm.

0 Kudos
Visitor arsenek
Visitor
5,604 Views
Registered: ‎02-08-2011

Re: EDK13.1 Debug problem with DDR

Hi,secureasm

 

Thank you for answer.

 

The board is "custom borad", main clock is 50MHz and JTAG clock is 6MHz . In the same configuration, the other boards with little hardware circuit difference(peripherals) work well.

 

What has comfused me is why SDK report a error "Execution is suspend because of error : Cannot access memory at address 0xd50" when I write to DDR no matter that I use SDK built-in "memory test" or not.

 

Maybe writing DDR make the FPGA program crashed ? I'll take off the DDR chip and make a test

0 Kudos
Voyager
Voyager
5,599 Views
Registered: ‎05-09-2008

Re: EDK13.1 Debug problem with DDR

Hi arsenek,

 

I'm sorry if I insist, but before proceeding to write software requires the hardware is working perfectly.
> The board is "custom borad", main clock is 50MHz and JTAG clock is 6MHz .
Ok, but DDR frequency is ? You use SDRAM, DDR or DDR2 ?
I would focus on this part before proceeding with others.
Can you try with other Xilinx software, example 10.1 SP3, or later if the device is not supported in this version.
secureasm


0 Kudos
Visitor arsenek
Visitor
5,593 Views
Registered: ‎02-08-2011

Re: EDK13.1 Debug problem with DDR

Hi secureasm,

 

It's very kind of you, :)

 

I use DDR2, and DDR2 frequency is 300MHz.

ISE/EDK software version is 13.1.

 

With same DDR2 and FPGA, but a different type board, DDR2 works well, and SDK never report that kind of error.

 

And today, I take the DDR2 chip off the board. Then run the built-in "Memory Test" program, SDK still crashed and report the same error infomation.

 

I don't know what I have post yet is clear or not , if anything you want to know ,please tell me.

 

Thank you very much.

0 Kudos