cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cachente
Observer
Observer
11,044 Views
Registered: ‎02-16-2011

program flash

Hi everybody, 

 

I'm working with SP605 evaluation board and need to boot from the flash memory my sdk design. Now, firt i program the fpga with de .bit and .bmm file. , and then run de .elf file. I want that this process was automatic when i turn my board, running from flash memory.

 

Previously i worked with a virtex5 custom board with and eprom memory and i use impact to prepare a .mcs file to program that memory.

 

I've been looking for tutorials or documentation for that pourpose (imagine it would be very simple) but i found nothing. Please if someone knows where to find documentation or could write me a quick tutorial.

 

Thanks in advance!

0 Kudos
39 Replies
10,847 Views
Registered: ‎02-18-2011

Hi,

 

I'm looking for some material about this also... 

I created my bsp with the xilflash library and correctly programmed the flash with my system.bit previously created at EDK using 

 

Now I'm trying running the srec_bootloader C project or the basic hello_world but I don't know how exactly to program this at the flash...

I do need to convert the .elf to bootloadalbe SREC format and program, right? 

 

I would appreciate any help!

 

Regards,

0 Kudos
10,841 Views
Registered: ‎02-18-2011

Just to clarify, my steps were:

1 - Program FPGA with the HW plataform created at EDK (download.bit) by xsdk cliking at Xilinx Tools -> Program FPGA
2 - Program FLASH at memory position 0x01500000 the hello_world.elf (converted to SREC)
3 - Modified the srec_bootloader to read the memory add 0x01500000 and run it from xsdk

I expected that the hello_wolrd was executed by my serial output has:

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

What could be the problem?
And how can I record all of this into flash to execute when I power ON or reset (CPU_RST or SW6) ?
Thank again!
0 Kudos
10,834 Views
Registered: ‎02-18-2011

My mistake!!! 

I was changing the memory offset!

 

I was reading the wrong initial address... the Program FLASH write the srec converted from .elf file at 0x42000000.

 

Now after programming the fpga and running the srec_booloader I see the hello_word beeing read and executed!! 

 

I'm now still trying to figure out how to record steps 1 and 2 to FLASH in order to be execute when the board power on... 

 

Any tips?

 

Regards

0 Kudos
cachente
Observer
Observer
10,808 Views
Registered: ‎02-16-2011

Could you detail a little more your precess steps?? I'm trying this but it seems i only can download the hardware in flash memory. There is no sign of life about the elf....

 

Thanks!

0 Kudos
irati
Visitor
Visitor
10,799 Views
Registered: ‎03-11-2011

Hi,

I think you can find the answer in the following post:

http://forums.xilinx.com/t5/EDK-and-Platform-Studio/Flash-Binary-generation-problems/td-p/134930

I wrote there the process I follow to program the download.bit and the .elf in flash.

The problem I have is that I have to generate a unique binary file. I do it in 2 steps, the .elf first and the .bit later and it is ok but doing it to generate a unique file doesn´t work. any ideas?

Thanks,

 

 

0 Kudos
cachente
Observer
Observer
10,783 Views
Registered: ‎02-16-2011

Hi Irati,

 

In the link you told me there  is the next step:

 

3. With impact I generate the binary file from the download.bit bitstream. Then I take the generated binary file and I do the Program Flash Memory: I select the binary generated and I program it at flash offset 0 (I put the scratch memory: bram).

 

I don´t understand what do you mean. I understand i have to make the .mcs file with impact but i don't know what to do later. If i come back to he "program flash memory" menu in xps now i have the .elf file and the .srec file but there is no option about the .mcs...

 

I think i'm quite lost! :(  i'll be very grateful if you could explain where is my mistake.

 

Thanks in advance!

0 Kudos
10,778 Views
Registered: ‎02-18-2011

Hi Irati,

 

I created a hardware plataform at EDK and imported it at SDK. (I'm using ISE 13.1)

After that I created a board support package and 2 C projects: hello_world and srec_bootloader.

 

I recorded the hello_world in flash, use the Xilinx Tools -> Program Flash.

It will record the hello_world at position 0x42000000 (as an SREC image) with offset 0x00000000.

 

After that you need to modify the srec_bootloader to donwload the srec image from 0x42000000 position.

 

The next steps are programming the FLASH (xilinx tools -> program flash) with the hardware plataform and then Run the srec_bootloader at the board.

It will read the flash memory, download the hello_world app and run it.

 

I'm still looking for doing all of this from flash... 

Unfortunatelly I will look at this only next week!

 

Regards,

 

 

0 Kudos
irati
Visitor
Visitor
10,764 Views
Registered: ‎03-11-2011

Hi,

 

I don´t generate a .mcs file with impact, I select the option of binary file format, so I generate a .bin file. Then, in the Program Flash memory tool , I select the generated binary file in " File To Program" and that's all.

 

Best Regards,

0 Kudos
cachente
Observer
Observer
10,756 Views
Registered: ‎02-16-2011

Thanks Irati,

 

I think that now i'me very close to the end... i took these steps:

 

1. Program flash with the .elf with 0x00800000 offset. (Check Auto-convert file to bootloadable and Create flash bootloader application options selected).

2. Mark to initialize BRAMS and build de project.

3. Generate the binary file with impact and program it on flash with 0x00000000 offset.

 

After that i restart the board and i can see that the hardware works correctly but the software doesn't run. I think i'm doing something wrong between steps 2 and 3. Do i have to regenerate de .bit file before making de binary file?? I think it's necesary because the .bit which i generate de bin file with is the same that before adding de bootloader application.

 

Thanks for your advices!

0 Kudos
irati
Visitor
Visitor
9,786 Views
Registered: ‎03-11-2011

Hi,

After doing the second step, you have to update the bitstream by BRAM init button. And then, you have to generate the binary file with the download.bit generated after doing the BRAM init.

Regards,

0 Kudos
cachente
Observer
Observer
9,782 Views
Registered: ‎02-16-2011

Hi,

 

When i do that after step 2, i receive the following error message:

 

 

********************************************************************************
At Local date and time: Wed Mar 16 12:52:24 2011
 make -f system.make init_bram started...
This project has been instantiated in Xilinx ISE Project Navigator. Please use ProjNav to generate the bitstream.
cp: cannot stat `implementation/system_bd.bmm': No such file or directory
make: *** [implementation/download.bit] Error 1
Done!

********************************************************************************

0 Kudos
irati
Visitor
Visitor
9,767 Views
Registered: ‎03-11-2011

Hi,

I had a similar error once, it was because I opened the .xmp design file with ISE and then, when I opened it again by xps  I had a similar error. could be?

 

 

0 Kudos
cachente
Observer
Observer
9,763 Views
Registered: ‎02-16-2011

Hi irati,

 

Finally it worked!!!! :)

 

It seems that was a structure directory problem because of my system.xmp was instiated by an ISE proyect... After solving that i could update the bitstream with the bootloadr and follow the steps you told me in previous messages.

 

Thank you soo much, your replies were a great help for me!

 

bye!

0 Kudos
irati
Visitor
Visitor
9,759 Views
Registered: ‎03-11-2011

ok, so everything solved.

I haven´t solved the problem I had yet (so you are more lucky than me :smileywink:).

I have to generate a unique binary file with the download.bit and the .srec file but I don´t achieve it.

If some day you start with it...

Good luck!

 

0 Kudos
cachente
Observer
Observer
9,745 Views
Registered: ‎02-16-2011

Hi Irati,

 

Have you tried to generate an .ACE file? I know it is not what you are looking for but it's a way to have booth .elf and .bit in a unique file...

 

My solution is enough for me but if i had some free time i would try to solve your problem and post it.

 

Good luck!!

0 Kudos
irati
Visitor
Visitor
9,740 Views
Registered: ‎03-11-2011

Hi,

 

I haven´t tried to generate an .ace file, I don´t know how to do it. Now I can´t try it but I will look for information and will try it. As you say, it is not what I am looking for, but if it is possible to generate an .ace file and then convert it in a binary file (¿? I don´t know if it is possible).

Thanks!

Best Regards

 

0 Kudos
cachente
Observer
Observer
9,726 Views
Registered: ‎02-16-2011

You can make it from impact, but it only can have the .bit so it doesn't work for you.

 

Instead of that, you can make ir from the EDK shell with the genace.tcl script with something like that:

 

xmd -jprog -tcl genace.tcl -target mdm - board SP605 -hw download.bit -elf executable.elf -ace out.ace

 

You can read more about genace.tcl in chapter 13  of: http://www.xilinx.com/support/documentation/sw_manuals/edk10_est_rm.pdf

 

After that you have to set the apropiate directory structure in the flash and save the out.ace.

 

With this operation you load your system form flash memory...

 

I hope this help you!

 

 

0 Kudos
irati
Visitor
Visitor
9,704 Views
Registered: ‎03-11-2011

Hi,

 

Thanks for your help. I will try it tomorrow.

Best Regards,

 

0 Kudos
9,688 Views
Registered: ‎02-18-2011

Hi cachente,

 

Are you using the EDK to program the FLASH?

 

I'm using the EDK 13.1 and there is NO option "Program Flash Memory" at Device Configuration... there is only "Update Bitstream" and "Download Bitstream" 

 

What is your EDK version ?  

Looks like this option was removed from the last ISE release...

 

Do you know how can I do it?

 

Regards,

0 Kudos
cachente
Observer
Observer
11,224 Views
Registered: ‎02-16-2011

Hi raphael,

 

I'm programming flash from XPS. My EDK version is 12.3 and this option is also avaible in SDK... In my  "device configuration" menu i also have the "program flash option", try it with SDK.

 

I have not used your EDK version so i don't know how to solve your problem but i have an idea, maybe you choose a board without flash memory when making the EDK project  (for example i use SP605) and if your board does not have flash memory EDK may automaticaly disable that option. I don't know.

 

Good luck!

0 Kudos
11,214 Views
Registered: ‎02-18-2011

Hi cachente,

 

I'm using the SP605 kit also!! 

I do have a "Program Flash" interface at SDK, but I can record only one file per time...

 

I'm talking with my Xilinx resseller about this and he was also surprised with this difference at the 13.1 edk version... He asked for a tutorial about how doing this with the new edk software and as soon as I get it, I will post it here...

 

First I was using the 12.2 version, but he strongly recommended the 13.1, mainly because Microblaze now has a different and more efficient bus, called AXI (instead of PLB). As my work is Microblaze based, I decided to follow his advice and update the ISE version. 

 

Regards,

0 Kudos
cachente
Observer
Observer
11,192 Views
Registered: ‎02-16-2011

Hi Raphael,

 

I know that you can only program one file per time so you have to make two programs, one for the .elf (or .srec) file ,and another one for de .bin file.... If you want i could detail a little more the process that worked for me. Maybe it helps you:

 

I follow the steps in this post:

 

http://forums.xilinx.com/t5/EDK-and-Platform-Studi​o/Flash-Binary-generation-problems/td-p/134930

 

When you do steps 1 and 2, your software is saved in flash memory. After that you have to update your bitstream file with the bootloader information, so go to XPS and click on "update bitstream".  The result of that is a file called download.bit.

 

Go to IMPACT and prepare a PROM file (you have to choose .bin) using your download.bit file.

 

Use the generated .bin file to make the second flash program.

 

It's important to know that in your first step you are saving in flash the software for your project. You use a offset of 0x00800000, for example. In last step you are programming the hardware for your project so you put a different offset 0x00000000.

 

When you power on the board it goes to flash_base_addr +  0x00000000 address and load the hardware (.bin file). Bin file contains the bootloader where you set that software you want to run it's in flash_base_addr + 0x00800000 address.

 

That's the way i understand the process and it worked for me.

 

I hope you could program your flash succesfully!!!

 

Bye! 

0 Kudos
11,184 Views
Registered: ‎02-18-2011

Hi cachente,

 

Thank you a lot for you explanation!!!

The problem is that my "Program Flash" window which is available only at SDK do not have a "Create flash bootloader application"!!! 

 

I'm waiting for an answer from my Xilinx reseller about this and in meantime I'm trying to figure out if I need to use a specific bootloader program, like the example C project from SDK (srec_bootloader)... and how to record everything correctly at flash... 

 

Bye!!

0 Kudos
11,167 Views
Registered: ‎02-18-2011

Hi Cachente, 

 

I received the solution and probably it will help Irati also!!

 

In order to record the system.bit and a bootloader program ( the srec_bootloader created at SDK), I had to create a final .bit file with both files using the the data2mem program, for example:

 

data2mem -bm system_bd.bmm -bt system.bit -bd ../srec_bootloader_0/Release/srec_bootloader_0.elf -ob final.bit

 

After that I had to use iMPACT to create a .mcs file from this final.bit  (using the option prepare a PROM file) and recorded the final.bit on the flash.

My final application is recorded using SDK at the memory position I set at srec_bootloader.

 

Now it is working fine!!


I need to study it a little  more, but probably this data2mem can generate a unique .bit file with my application also!!

 

Bye!! 

0 Kudos
xiaochh
Observer
Observer
11,148 Views
Registered: ‎05-06-2008

 

@raphael.barbieri wrote:
Just to clarify, my steps were:

1 - Program FPGA with the HW plataform created at EDK (download.bit) by xsdk cliking at Xilinx Tools -> Program FPGA
2 - Program FLASH at memory position 0x01500000 the hello_world.elf (converted to SREC)
3 - Modified the srec_bootloader to read the memory add 0x01500000 and run it from xsdk

I expected that the hello_wolrd was executed by my serial output has:

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

What could be the problem?
And how can I record all of this into flash to execute when I power ON or reset (CPU_RST or SW6) ?
Thank again!

 

Hello,raphael.barbieri

I has the same problem with you,   but my my serial output has:

 

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

 

my start address of flash is 0x82000000,and the offset of programming flash is 0x00800000.

I checked the srec_bootloader application, and the memory address defined in blconfig.h is (0x82000000 + 0x00800000) , the same with what i set.

 

But why has this error? Is there other setting need to be noticed.

 

And then , I changed the offset to 0x01000000, the serial output has another error, different from the former,as:

@Loading SREC image from flash @ address: 83000000
ERROR in SREC line: 00000001SREC line is corrupted

 

Could help me ?  I think Iam quite lost!

 

Thanks!


 

0 Kudos
11,124 Views
Registered: ‎02-18-2011

Hi xiaochh,

 

My problem was that I was not paying attention to the Flash initial address which in my case (SP605) is 0x42000000.

I'm running now using the an offset of 0x00A00000, so my srec_booloader application has the start position at 0x42A00000.

 

Record a hello_world aplication at this memory position and Run the srec_bootloader to test it.

 

Just be sure that you are really recording at the exact position... that was my fault first...

If you record your app in a different position, the srec_bootloader returns that same message!! 

 

Regards,

0 Kudos
chris007
Observer
Observer
11,070 Views
Registered: ‎10-20-2010

Hi,

as you seem to be true experts in booting from FLASH, I'd like to ask you for help in exactly the same issue.

I've got a ML605 board and my microblaze Design consists of 64k BRAM and 32M FLASH Memory.

I've implemented the XPS design and created a SDK projekt based on the hardware information.

Besides the hw_platform and the standalone_bsp, I've got two C projects:
The SREC Bootloader, which linker file is configure to use BRAM for all three options, and a hello world project, which linker file is to use the FLASH for all three options (but the fixed section assignments such as .vectors.reset and so on are set to be in BRAM)

 

I performed the workflow as written below several times (Except my FLASH base adress is 0x86000000 and my offset ist 00A00000):

 

====================================================

raphael.barbieri wrote:

 

Just to clarify, my steps were:

1 - Program FPGA with the HW plataform created at EDK (download.bit) by xsdk cliking at Xilinx Tools -> Program FPGA
2 - Program FLASH at memory position 0x01500000 the hello_world.elf (converted to SREC)
3 - Modified the srec_bootloader to read the memory add 0x01500000 and run it from xsdk

I expected that the hello_wolrd was executed by my serial output has:

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

What could be the problem?
And how can I record all of this into flash to execute when I power ON or reset (CPU_RST or SW6) ?
Thank again!

 

=================================================

 

But when executing the srec-bootloader, the UART interface states me the following:

...........................

<\n>SREC Bootloader<\r>
<\n>Loading SREC image from flash @ address: 86a00000<\r>
<\n><\r>
Bootloader: Processed (0x)00000001 S-records<\r>
Bootloader: Processed (0x)00000002 S-records<\r>
Bootloader: Processed (0x)00000003 S-records<\r>
Bootloader: Processed (0x)00000004 S-records<\r>
Bootloader: Processed (0x)00000005 S-records<\r>
Bootloader: Processed (0x)00000006 S-recordsERROR: Error while reading an SREC line from flash

............................

 

So I think it starts reading the program but does not finish...

Are there any Jumper settings on the board I have to look for?

Or do I have to do additional steps in the XPS, before working with SDK? I already thought about it, but because I'm using the ISE flow, I can't perform Init BRAM with the bootloader inside XPS.

 

I would appreciate any hints!

 

Cheers

 

0 Kudos
11,067 Views
Registered: ‎02-18-2011

chris007,

 

Have tried with a small offset? Like 0x00100000, for example?

It really looks like it cannot complete reading the memory...

I know that hello_world is a very small program, but maybe... 

 

Just to confirm I'm recoding the hello_world app in Flash using the following configuration:

 

Check 'Convert ELF to bootloadalbe SREC..'

 

Flah Memory Settings :

        Linear_Flash 

        Check the 'Target Flash Device is a Xilinx Plataform Device'

 

Working Memory Settings:

        Controller: MCB_DDR3

 

I was using the same 64k and 32M flash... 

 

Regards,

0 Kudos
chris007
Observer
Observer
11,049 Views
Registered: ‎10-20-2010

raphael,

 

I've tried several different offsets, including 0x0, but none of them worked.

The "convert to srec" and "target platform is a xilinx platform device" were checked.

 

Indeed, I do not have the DDR3 RAM in my Microblaze because I need it with another part of my design - so perhaps the system lacks working memory.

To which space does the bootloader load the code found in the flash? Perhaps instantiating another BRAM in XPS would help?

0 Kudos