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 westocl
Visitor
2,749 Views
Registered: ‎11-07-2010

Nexys2 Microblaze External Ram Flash Example

Can someone give me some help on getting a simple microblaze progrogram running on a nexys2 from external memory.

 

I am stuck even getting a "hello world" running from flash.  I can get things to run when all of the code (is small enough and) is initilzed in bram with the bitstream, but I am trying to get larger programs to run from external Flash/Ram.

 

What i am currently doing is generating a simple program such as

 

#include<stdio.h>

int main{

while(1)

printf("hello world");

return 0;}

 

and trying to locate the instruction portion of the code in the flash and execute it from there as that portion will be read only. My method is as follows.

 

 

1)I first inistruct the linker script in sdk/xps to locate the code section (.text) portion of the code in external Flash and build the executable .elf.

2) then i use mb-objcopy -O binary  -j .text -j .init -j -.fini executable.elf executable.bin.

 

3) i burn the executable.bin into the flash using digilent adept flash tab at location 0 in the flash which maps to some 0x8xxxxxxx. in microblaze.

 

4) i initilze the bram with the elf file and download the download.bit. to the  Nexyx2.

 

 

I expect to see hello woldhello world..... keep repeating.  I get nothing.

 

Can someone give me some pointers.

 

after that i would like to create a bootloader to place that flash code to Ram and pretty much do the same thing.

 

Am i doing somthing wrong?

 

 

0 Kudos
1 Reply
Explorer
Explorer
2,682 Views
Registered: ‎08-02-2007

Re: Nexys2 Microblaze External Ram Flash Example

I am confused with this portion of your design statement:

 

"i burn the executable.bin into the flash using digilent adept flash tab at location 0".  I am confused because next you state that "4) i initilze the bram with the elf file and download the download.bit. to the  Nexyx2".

 

So are you downloading the bit file to the fpga from impact, or xps?  Or are you programing the bit file into the flash and booting from the flash on startup?

 

Also, have you tried reading back the contents of the flash starting at flash offset '0' to verify that the contents match what you would expect to see in the .text section of your executable? You could verify this by doing a dump of the elf file and comparing this to the actual contents you read back from the external flash when the application is downloaded.

0 Kudos