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: 
Explorer
Explorer
9,332 Views
Registered: ‎05-28-2014

create bin file with additional binary file

Jump to solution

Hello,

 

I use data2mem to combine the elf with fpga configuration.

I wanted to add some additional file in specific address in flash.

Can it be done using data2mem .

This is the current data2mem script I use:

data2mem -bm system_bd.bmm -bd xxx.elf -bt system.bit -o b xxx.bit

I need to merge myfile.bin too into address 0x400000 in flash.

 

 

 

Thank you,

Ran

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Explorer
Explorer
16,290 Views
Registered: ‎05-28-2014

Re: how to combine with additional binary file

Jump to solution

Hi,

 

Ok , I've solved the issue.

It relate to progmem swapping of bit order.

this post help me understand the issue:

http://forums.xilinx.com/t5/Embedded-Processor-System-Design/A-merged-MCS-file-not-work/td-p/146208

 

After "twice" swaping it works fine:

c:\Xilinx\14.7\ISE_DS\ISE\bin\nt64\promgen.exe -w -p bin -o images.bin -data_file up 0 images
c:\Xilinx\14.7\ISE_DS\ISE\bin\nt64\promgen.exe -o CZ5C2010A_uBlaze_POD.mcs -u 0 CZ5C2010A_uBlaze_POD.bit -data_file up 0x200000 images.bin -p mcs -w -bpi_dc parallel -data_width 16

 

Regards,

Ran

0 Kudos
5 Replies
Xilinx Employee
Xilinx Employee
9,315 Views
Registered: ‎08-02-2007

Re: data2mem - how to combine with additional binary file

Jump to solution

hi,

 

is this binary file will be programmed from a bpi/spi flash? if that is the case, you have to generate the updated bitstream with data2mem and use promgen to add the bin file and merge it into a single mcs

 

 promgen -spi -w -p mcs -u 0 download.bit -data_file up b40000 app1.bin -data_file up b40400 app2.bin

 

if this does not help, explain your use-case.

 

--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.
----------------------------------------------------------------------------------------------
0 Kudos
Explorer
Explorer
9,290 Views
Registered: ‎05-28-2014

Re: data2mem - how to combine with additional binary file

Jump to solution

Hi,

 

I don't understnad why it works if I program the file with "flash programming", but does not when it is part of the .mcs/bin file.

This is what I do:

 

@echo on

c:\Xilinx\14.7\ISE_DS\ISE\bin\nt64\data2mem -bm system_bd.bmm -bd CZ5C2010A_uBlaze_POD.elf -bt system.bit -o b CZ5C2010A_uBlaze_POD.bit

c:\Xilinx\14.7\ISE_DS\ISE\bin\nt64\promgen.exe -o CZ5C2010A_uBlaze_POD.mcs -u 0 CZ5C2010A_uBlaze_POD.bit -data_file up 0x200000 images -p mcs -w -bpi_dc parallel -data_width 16

c:\Xilinx\14.7\ISE_DS\ISE\bin\nt64\promgen.exe -o CZ5C2010A_uBlaze_POD.bin -u 0 CZ5C2010A_uBlaze_POD.bit -data_file up 0x200000 images -p bin -w -bpi_dc parallel -data_width 16

 

pause

 

Another thing I don't understand is why the command interpres the file offset as double the value given above:

 

D:\MicroBlaze\App\programming>c:\Xilinx\14.7\ISE_DS\ISE\bin\nt64\promgen.exe -o

CZ5C2010A_uBlaze_POD.mcs -u 0 CZ5C2010A_uBlaze_POD.bit -data_file up 0x200000 im

ages -p mcs -w -bpi_dc parallel -data_width 16

Release 14.7 - Promgen P.20131013 (nt64)

Copyright (c) 1995-2013 Xilinx, Inc.  All rights reserved.

INFO:Bitstream:181 - The start address provided has been multiplied by a factor

   of 2 due to the use of the x16 data width

INFO:Bitstream:181 - The start address provided has been multiplied by a factor

   of 2 due to the use of the x16 data width

0x16a78c (1484684) bytes loaded up from 0x0

0xa8900 (690432) bytes loaded up from 0x400000

Using generated prom size of 8192K

Writing file "CZ5C2010A_uBlaze_POD.mcs".

Writing file "CZ5C2010A_uBlaze_POD.prm".

Writing file "CZ5C2010A_uBlaze_POD.cfi".

 

The file need to be set in assress 0x400000, so I put 0x200000. I wander why.

 

Any suggestion why this does not work with the combined file ?

 

Thanks,

Ran

0 Kudos
Explorer
Explorer
9,276 Views
Registered: ‎11-13-2009

Re: data2mem - how to combine with additional binary file

Jump to solution
Ran, the address differences by 2 are explained by the fact that the Flash is a 16-bit device and you are using bytes to ensure the location. This has been written about before in the Flash programming guides.
TomT...
0 Kudos
Explorer
Explorer
9,268 Views
Registered: ‎05-28-2014

Re: how to combine with additional binary file

Jump to solution

Hi,

 

Thanks for the that. It explaint the offset multiplication.

Is there any idea why the information is not written OK when using the MCS unified file with iMPACT, but works when using "flash programming" tool inside SDK ?

 Maybe it is related to Endiannes differences betweeen these 2 different writing options ?

Thanks,

Ran

0 Kudos
Highlighted
Explorer
Explorer
16,291 Views
Registered: ‎05-28-2014

Re: how to combine with additional binary file

Jump to solution

Hi,

 

Ok , I've solved the issue.

It relate to progmem swapping of bit order.

this post help me understand the issue:

http://forums.xilinx.com/t5/Embedded-Processor-System-Design/A-merged-MCS-file-not-work/td-p/146208

 

After "twice" swaping it works fine:

c:\Xilinx\14.7\ISE_DS\ISE\bin\nt64\promgen.exe -w -p bin -o images.bin -data_file up 0 images
c:\Xilinx\14.7\ISE_DS\ISE\bin\nt64\promgen.exe -o CZ5C2010A_uBlaze_POD.mcs -u 0 CZ5C2010A_uBlaze_POD.bit -data_file up 0x200000 images.bin -p mcs -w -bpi_dc parallel -data_width 16

 

Regards,

Ran

0 Kudos