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: 
Visitor dcorreia
Visitor
11,232 Views
Registered: ‎02-10-2014

Nexys 3 running Code in Flash memory

Jump to solution

Hello All, 

 

I need some help. I want to run my code that I generated using the SDK without having to reprogram the baord every time. So I need to place the code and FPGA configuration into flash memory. 

 

What I have done so far:

  1. Created a bootloader using the correct ofset for my code
  2. Created "download.bit" using FPGA programmer which has the bootloop and the hardware configuration
  3. I created a hello_world application which is a elf file
  4. Tested this by just running it on the FPGA by using "Program FPGA" 

But I need to place the download.bit and the hello_world.elf into flash memory. I tried using the "Program Flash" within the SDK but the SDK cannot seem to find the flash memory. I think this is because Digilent Nexys 3 board use a custom MUX for the memory controller. 

 

I need some serious help I've been doing this for the past 2 days 8 hours a day with no luck.

 

Please anything would be helpful. 

 

Thanks

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Visitor dcorreia
Visitor
17,135 Views
Registered: ‎02-10-2014

Re: Nexys 3 running Code in Flash memory

Jump to solution

So I figured it out. 

 

The problem was that the orginal .elf file that was compiled when the project first ran was not getting over writen with the new compiled file. 

 

What I did was 

  1. Delete the DEBUG folder (Release folder if you're using that 1)
  2. Delete the download.bit and all the cache and temp folder founds within the EDK_hardware folder
  3. remove any other OLD .elf
  4. Compile the project from scratch
  5. and perform the steps listed in the tutorial above keeping in mind that that tutorial the person has 32MB flash so you have to choose your offset not to run over your flash

In order to figure out how big my download.bit was when placed in flash I used iMPACT tool and choose a smaller flash device and saw how much bytes exceed the flash and did the math to calculate the size of my download.bit and the I placed my .elf a little below that. 

 

Cheers

View solution in original post

0 Kudos
5 Replies
Observer andrewsi
Observer
11,222 Views
Registered: ‎02-05-2012

Re: Nexys 3 running Code in Flash memory

Jump to solution
As far as I know there is no simple or preconfigured way to accomplish this using the Xilinx tools, as you have discovered, the flash mux is custom and also the flash memory being used is not one of the types natively supported by the ISE/EDK where the tool uploads its own FPGA bitfile for purposes of flashing and then resets. I think the only real option is to write your own flashing utility- focus on writing an app you can upload manually to write to the flash successfully, and once you've got that then add in some transfer capability to get the bitfile over a serial or JTAG connection and write it. It sucks, but that's about the only option with this board. It was really designed for college classes, I think, and the design isn't great for real practical uses. Some of their more expensive boards with onboard DRAM and such are more useful.
0 Kudos
Xilinx Employee
Xilinx Employee
11,216 Views
Registered: ‎08-02-2007

Re: Nexys 3 running Code in Flash memory

Jump to solution

Hi,

 

I believe using Digilent Adept software might have a solution. This was a suggestion based off this post.

 

http://forums.xilinx.com/t5/3rd-Party-Other-Boards-and-Kits/SDK-flash-program-with-shared-memory-bus-multiplexer/td-p/356493

 

--Hem

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
Visitor dcorreia
Visitor
11,212 Views
Registered: ‎02-10-2014

Re: Nexys 3 running Code in Flash memory

Jump to solution

Hello, 

 

Thanks for the reply fellas. 

 

I have tried using the Digilent Software but the problem is I can't write to specific memory locations in flash. Does anyone know how I can merge the "download.bit" (which has the bootloop and hardware) with the ".elf" which has the code to run file. 

The ".elf" has to start at a specific location. I can convert the ".elf" to a "SREC". But I do not know how to combine the "download.bit" and ".elf" so that the ".elf" starts at 0x42100000. Which is the memory location the boot loop starts at.

0 Kudos
Visitor dcorreia
Visitor
11,195 Views
Registered: ‎02-10-2014

Re: Nexys 3 running Code in Flash memory

Jump to solution

Hello, 

 

So I got the flash programmer to work with the PLB bus. 


But now I am having another problem. The bootLoop always reads from 0xf8000000. That address reside in RAM but in the bootloop code i specifically told it to read from a flash address.  I have a feeling the SDK it not merging the bootloop that I want with the system.bit. Instead it is merge another bootloop. I even specified the correct bootloop to merge with the system.bit. The download .bit is suppose to have the correct bootloop

 

I am running a microblaze RAM address starts at 0x80000000 with a size of 16Mb and flash address starts at 0x82000000 and has a size of 16Mb. 

 

Ouput of bootloop


SREC Bootloader
Loading SREC image from flash @ address: f8000000
ERROR: Error while reading an SREC line from flash

 

I use this tutorial 

0 Kudos
Highlighted
Visitor dcorreia
Visitor
17,136 Views
Registered: ‎02-10-2014

Re: Nexys 3 running Code in Flash memory

Jump to solution

So I figured it out. 

 

The problem was that the orginal .elf file that was compiled when the project first ran was not getting over writen with the new compiled file. 

 

What I did was 

  1. Delete the DEBUG folder (Release folder if you're using that 1)
  2. Delete the download.bit and all the cache and temp folder founds within the EDK_hardware folder
  3. remove any other OLD .elf
  4. Compile the project from scratch
  5. and perform the steps listed in the tutorial above keeping in mind that that tutorial the person has 32MB flash so you have to choose your offset not to run over your flash

In order to figure out how big my download.bit was when placed in flash I used iMPACT tool and choose a smaller flash device and saw how much bytes exceed the flash and did the math to calculate the size of my download.bit and the I placed my .elf a little below that. 

 

Cheers

View solution in original post

0 Kudos