cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
2,232 Views
Registered: ‎09-29-2009

Writing to memory with Microblaze

Hi!

I am working on a project in which I want to save a large amount of data into DDR-Ram with Microblaze.

My code is the following:

 

 

Xuint32 Index = 0;
while (Index < 500)
{
  *Buffer = pic[Index];
  xil_printf("\rAddress = %x\t Value = %d\n",Buffer,*Buffer);
  Buffer++;
}

 

 

--It is very simple, I have an array of data (pic) which I want to store in memory. I am using an integer pointer to memory. I write to memory and increment the pointer. 

The code listed previously should save 500 item from my array in memory. I have 64MB, so space is not an issue.

The problem is that I can not do that.

 

Looking at the terminal this is what is shown:

 

 

Address = 44000180       Value = 16777215

Address = 44000184       Value = 16777215

Address = 44000188       Value = 16777215

Address = 4400018C       Value = 16777215

Address = 44000190       Value = -1240530936

Address = 44000194       Value = 539033620

Address = 44000198       Value = 807534548

Address = 4400019C       Value = -102694912

Address = 440001A0       Value = -94306264

Address = 440001A4       Value = 308346880

 

Green = Rigth

Red= Wrong

Max data saved into memory correctly = 396

 

 

Anyone can help me with that?

 

Best regrads

 

Juan carlos

0 Kudos
1 Reply
Highlighted
Adventurer
Adventurer
2,207 Views
Registered: ‎09-30-2009

Hi

 

Try this

 

Xuint32 Index = 0;
while (Index < 500)
{
  *Buffer = pic[Index];
  xil_printf("\rAddress = %x\t Value = %d\n",Buffer,*Buffer);
  Buffer++;
  index++;
 }

 

max

0 Kudos