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: 
Scholar mrbietola
Scholar
1,420 Views
Registered: ‎05-31-2012

read flash part with tcl command

Jump to solution

Hi, i see that Vivado read the flash part when i program it, is there a command i can use to retrieve the flash part and so i can able to program the correct file?

1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
1,374 Views
Registered: ‎01-10-2012

Re: read flash part with tcl command

Jump to solution

Hi @mrbietola

 

Well there is no direct command to read the Flash part, but if you just arbitrarily assign a Flash part and try to program, Vivado will Fail during IDCODE check for the flash if it doesn't match the part selected, so you can use the IDCODE  info to figure out what Flash is on board !

 

9 Replies
Xilinx Employee
Xilinx Employee
1,375 Views
Registered: ‎01-10-2012

Re: read flash part with tcl command

Jump to solution

Hi @mrbietola

 

Well there is no direct command to read the Flash part, but if you just arbitrarily assign a Flash part and try to program, Vivado will Fail during IDCODE check for the flash if it doesn't match the part selected, so you can use the IDCODE  info to figure out what Flash is on board !

 

Scholar mrbietola
Scholar
1,368 Views
Registered: ‎05-31-2012

Re: read flash part with tcl command

Jump to solution

thanks for the reply, i suspected that @gurupra.

 

Then i have to prepare all the object for flashing the part, try to program, intercept the wrong programming with "catch" then prepare all the objects again for the other flash part and program right?

 

i don't know how to extract the IDCODE as you suggest

0 Kudos
Xilinx Employee
Xilinx Employee
1,364 Views
Registered: ‎01-10-2012

Re: read flash part with tcl command

Jump to solution

Hi @mrbietola

 

Yes, Retrying with alternate flash part assignment until the programming passes might be an option.

 

The idcode i meant is the Flash id, Vivado will show like this when you program, if the ID it expected doesnt match it will stop at this stage indicating expected vs read ID.

 

program_hw_cfgmem -hw_cfgmem [get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices] 0 ]]
Mfg ID : c2 Memory Type : 25 Memory Capacity : 3a Device ID 1 : 0 Device ID 2 : 0
Performing Erase Operation...
Erase Operation successful.

Moderator
Moderator
1,351 Views
Registered: ‎06-05-2013

Re: read flash part with tcl command

Jump to solution

You can use the following command to see the flash part when hardware manager is running with flash attached to device.

 

Capture_1.JPG

TCL command:

 

report_property -all [get_property PROGRAM.HW_CFGMEM [current_hw_device] ]

 

Outcome:

 

Capture.JPG

 

Thanks,

Harshit

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Scholar mrbietola
Scholar
1,286 Views
Registered: ‎05-31-2012

Re: read flash part with tcl command

Jump to solution

@harshit  with the command you mentioned i retrieve only the informations that I set in Vivado, not the actual flash part.

I tried to add a fake configuration memory ( a flash part that is not mounted on the board) and with your command it list the fake part, it doesn't check if it's correct.

So i think Vivado can't read the flash part unless you use the program_cfg command

Visitor hallwal
Visitor
275 Views
Registered: ‎01-09-2019

Re: read flash part with tcl command

Jump to solution

It appears that this issue was never solved.  I have the same problem.  I have two possible flash parts, and my one TCL script needs to account for either possibility.  (They are s25fl164k and s25fl064l.)  Is there a way to make the TCL script try the first flash part ID, and then automatically try the second flash part ID if the first one fails?  Thanks!

0 Kudos
Scholar mrbietola
Scholar
246 Views
Registered: ‎05-31-2012

Re: read flash part with tcl command

Jump to solution

I didn't find a solution, as a workaround i use a script that tries to program a bunch of flash memories. The programmer can read the flash part and if it's not correct tries to program the next one.

If you would like to experiment you could take as input the flash part retrieved by the programmer and integrate in your script, but i think is hard

Visitor hallwal
Visitor
232 Views
Registered: ‎01-09-2019

Re: read flash part with tcl command

Jump to solution

Thanks mrbietola!  Would you be willing to share the details of this solution, or at least the main commands used?  Thank you!

0 Kudos
Highlighted
Scholar mrbietola
Scholar
206 Views
Registered: ‎05-31-2012

Re: read flash part with tcl command

Jump to solution

The commands are copied from Vivado, i only enclosed them in tcl proc to manage multiple programming sequence. I have 3 different flash parts and i try to program until one of them is right. 

set cfgmem_part mt25ql01g-spi-x1_x2_x4
set other_cfgmem_part mt25ql512-spi-x1_x2_x4
set eng_cfgmem_part mt25ql256-spi-x1_x2_x4



proc configflash { arg1 } {
current_hw_device [get_hw_devices xc7a200t_0]
refresh_hw_device -update_hw_probes false [lindex [get_hw_devices xc7a200t_0] 0]

#create_hw_cfgmem -hw_device [lindex [get_hw_devices xc7a200t_0] 0] [lindex [get_cfgmem_parts {mt25ql01g-spi-x1_x2_x4}] 0]
create_hw_cfgmem -hw_device [lindex [get_hw_devices xc7a200t_0] 0] [lindex [get_cfgmem_parts $arg1] 0]
set_property PROGRAM.BLANK_CHECK  0 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]
set_property PROGRAM.ERASE  1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]
set_property PROGRAM.CFG_PROGRAM  1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]
set_property PROGRAM.VERIFY  1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]
set_property PROGRAM.CHECKSUM  0 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]
refresh_hw_device [lindex [get_hw_devices xc7a200t_0] 0]

set_property PROGRAM.ADDRESS_RANGE  {use_file} [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]
set_property PROGRAM.FILES [list "./GOLDEN_IMAGE/download_initial.mcs" ] [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]
set_property PROGRAM.PRM_FILE {} [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]
set_property PROGRAM.UNUSED_PIN_TERMINATION {pull-none} [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]
set_property PROGRAM.BLANK_CHECK  1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]
set_property PROGRAM.ERASE  1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]
set_property PROGRAM.CFG_PROGRAM  1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]
set_property PROGRAM.VERIFY  1 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]
set_property PROGRAM.CHECKSUM  0 [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]
}


proc programflash {  } {

if {![string equal [get_property PROGRAM.HW_CFGMEM_TYPE  [lindex [get_hw_devices xc7a200t_0] 0]] [get_property MEM_TYPE [get_property CFGMEM_PART [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]]]] }  { create_hw_bitstream -hw_device [lindex [get_hw_devices xc7a200t_0] 0] [get_property PROGRAM.HW_CFGMEM_BITFILE [ lindex [get_hw_devices xc7a200t_0] 0]]; program_hw_devices [lindex [get_hw_devices xc7a200t_0] 0]; }; 

return [catch {program_hw_cfgmem  -hw_cfgmem [ get_property PROGRAM.HW_CFGMEM [lindex [get_hw_devices xc7a200t_0] 0]]}]

}


open_hw
connect_hw_server


open_hw_target




startgroup 


configflash $cfgmem_part

puts "Configuring $cfgmem_part"


if  [programflash ] {

	puts "Configuring $other_cfgmem_part"
	configflash $other_cfgmem_part
	if [programflash ] {
		puts "Configuring $eng_cfgmem_part"
		configflash $eng_cfgmem_part
		if [programflash ] {
			puts "Wrong flash part"
		}
	
	}
}
	
	



endgroup


close_hw

quit
0 Kudos