Flashing Jetson TX1 with tegraflash.py

Hello, I am trying to put Android on the Jetson TX1 using Jedroid 2.0. The command I am using is

sudo ./tegraflash.py --bct bct.cfg --bl fastboot.bin --odmdata 0x6009C000 --bldtb tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb --applet nvtboot_recovery.bin --chip 0x21 --cfg flash.cfg

After entering the tegraflash tool, I type

flash

, but the tool fails with :

Input cfg: flash.cfg
[   0.0000 ] Generating RCM messages
[   0.0028 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 --download rcm nvtboot_recovery.bin 0 0
[   0.0052 ] RCM 0 is saved as rcm_0.rcm
[   0.0072 ] RCM 1 is saved as rcm_1.rcm
[   0.0087 ] List of rcm files are saved in rcm_list.xml
[   0.0087 ] 
[   0.0088 ] Signing RCM messages
[   0.0102 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.hash
[   0.0117 ] Assuming zero filled SBK key
[   0.0212 ] 
[   0.0213 ] Copying signature to RCM mesages
[   0.0220 ] tegrarcm --chip 0x21 --updatesig rcm_list_signed.xml
[   0.0240 ] 
[   0.0241 ] Parsing partition layout
[   0.0247 ] tegraparser --pt flash.cfg
[   0.0255 ] 
Error: Return value 4
Command tegraparser --pt flash.cfg

Does anyone know what the return value 4 is? The tools are all from JetPackTX1-2.0 under the Linux4Tegra TX1 version. Namely, the tools that I copy-pasted to the Jedroid directly from Linux_for_Tegra_tx1 are: tegraflash.py, tegrahost, tegraparser, tegrarcm, tegrasign, tegraflash_internal.pyc, and tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb.

The complete Jedroid source files can be downloaded here:
https://www.dropbox.com/s/5kt8wmc0i1aj2cn/Jedroid_v2.0.1.tar.bz2?dl=0

I too am interested in flashing the TX1 to use a different OS. I can’t find literature on how to flash except for the automatic L4T flash instructions. Can anyone help point me in the right direction?

If I’m correct, you can use the same flashing tools included in Linux_For_Tegra_tx1/bootloader. By looking at the flash.sh shell script, I can determine that the tools used primarily include tegraflash.py. tegraflash.py itself uses tegraflash_internal_pyc, and tegraparser. If you try to run tegraflash.py with:

./tegraflash.py

It should guide you along the flashing process. From the command-line it gives you, you can type ‘?’ to get help from there.

Files that are required to flash using this tool are: a bootloader config table (specified with --bct), a bootloader (specified with --bl), odmdata (specified with --odmdata), etc. See my post about the arguments that I feed into the flash tool (they’re all there). You can look at the provided L4T files for examples on what you need and how to configure the flashing tool. The flash.sh script is open-sourced, so you can read it and determine what you need to do from there.

UPDATE:

I converted flash.cfg to an xml file “flash.xml” using the L4T xml file as a guideline. Now when I run the tegraflash.py tool, I get this output:

tegraflash~> flash
[   0.0000 ] Generating RCM messages
[   0.0019 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 --download rcm nvtboot_recovery.bin 0 0
[   0.0034 ] RCM 0 is saved as rcm_0.rcm
[   0.0043 ] RCM 1 is saved as rcm_1.rcm
[   0.0054 ] List of rcm files are saved in rcm_list.xml
[   0.0054 ] 
[   0.0054 ] Signing RCM messages
[   0.0069 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.hash
[   0.0084 ] Assuming zero filled SBK key
[   0.0195 ] 
[   0.0195 ] Copying signature to RCM mesages
[   0.0210 ] tegrarcm --chip 0x21 --updatesig rcm_list_signed.xml
[   0.0231 ] 
[   0.0231 ] Parsing partition layout
[   0.0240 ] tegraparser --pt flash.xml
[   0.0252 ] 
[   0.0252 ] Creating list of images to be signed
[   0.0261 ] tegrahost --chip 0x21 --partitionlayout flash.bin --list images_list.xml
[   0.0293 ] 
[   0.0293 ] Generating signatures
[   0.0305 ] tegrasign --key None --list images_list.xml --pubkeyhash pub_key.hash
[   0.0315 ] Assuming zero filled SBK key
[   0.0466 ] 
[   0.0466 ] Parsing BCT
[   0.0473 ] tegrabct --bct bct.cfg --chip 0x21
[   0.0481 ] Copying Sdram info from 0 to 1 set
[   0.0486 ] Copying Sdram info from 1 to 2 set
[   0.0486 ] Copying Sdram info from 2 to 3 set
[   0.0487 ] 
[   0.0487 ] Updating boot device parameters
[   0.0494 ] tegrabct --bct bct.bct --chip 0x21 --updatedevparam flash.bin
[   0.0502 ] Warning: No sdram params
[   0.0504 ] 
[   0.0504 ] Updating bl info
[   0.0511 ] tegrabct --bct bct.bct --chip 0x21 --updateblinfo flash.bin --updatesig images_list_signed.xml
[   0.0520 ] 
[   0.0521 ] Updating secondary storage information into bct
[   0.0527 ] tegraparser --pt flash.bin --chip 0x21 --updatecustinfo bct.bct
[   0.0535 ] 
[   0.0536 ] Updating Odmdata
[   0.0542 ] tegrabct --bct bct.bct --chip 0x21 --updatefields Odmdata = 0x6009C000
[   0.0549 ] Warning: No sdram params
[   0.0550 ] 
[   0.0550 ] Get Signed section bct
[   0.0557 ] tegrabct --bct bct.bct --chip 0x21 --listbct bct_list.xml
[   0.0565 ] 
[   0.0565 ] Signing BCT
[   0.0571 ] tegrasign --key None --list bct_list.xml --pubkeyhash pub_key.hash
[   0.0578 ] Assuming zero filled SBK key
[   0.0585 ] 
[   0.0585 ] Updating BCT with signature
[   0.0594 ] tegrabct --bct bct.bct --chip 0x21 --updatesig bct_list_signed.xml
[   0.0604 ] 
[   0.0605 ] Copying signatures
[   0.0613 ] tegrahost --chip 0x21 --partitionlayout flash.bin --updatesig images_list_signed.xml
[   0.0639 ] 
[   0.0639 ] Boot Rom communication
[   0.0645 ] tegrarcm --rcm rcm_list_signed.xml
[   0.0652 ] BR_CID: 0x321010015c6600030000000003018200
[   0.0742 ] RCM version 0X210001
[   0.0861 ] Boot Rom communication completed
[   1.0926 ] 
[   1.0926 ] Sending BCT and pre-requisite binaries
[   1.0935 ] tegrarcm --download bct bct.bct
[   1.0949 ] Applet version 00.01.0000
[   1.1081 ] Sending bct
[   1.1082 ] [................................................] 100%

Annnnd the application hangs. I’ve waited up to 30 minutes for it to get past this state, but it still has not advanced. Does anyone have any ideas?

John, did you run into any problems with the BCT as you were doing this? The bct.cfg file that came in the Jedroid files is throwing an error for me. Did you replace this file? I replaced it with Linux_for_Tegra_tx1/bootloader/tegrabct, and I got to the same output as you, minus the final line.

Here’s what I have done so far:

  • copied tegra* and nvtboot* files from Linux_for_Tegra_tx1/bootloader to my Jedroid_v2.0.1/ directory.
  • created Jedroid_v2.0.1/flash.xml based on flash.cfg

Run “sudo ./tegraflash.py --bct bct.cfg --bl fastboot.bin --odmdata 0x6009C000 --bldtb tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb --applet nvtboot_recovery.bin --chip 0x21 --cfg flash.xml”

  • then run “flash” within tegraflash.
~/Jedroid_v2.0.1 
> sudo ./tegraflash.py --bct bct.cfg --bl fastboot.bin --odmdata 0x6009C000 --bldtb tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb --applet nvtboot_recovery.bin --chip 0x21 --cfg flash.xml
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
 
tegraflash~> flash
[   0.0000 ] Generating RCM messages
[   0.0008 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 --download rcm nvtboot_recovery.bin 0 0
[   0.0014 ] RCM 0 is saved as rcm_0.rcm
[   0.0017 ] RCM 1 is saved as rcm_1.rcm
[   0.0017 ] List of rcm files are saved in rcm_list.xml
[   0.0018 ] 
[   0.0018 ] Signing RCM messages
[   0.0024 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.hash
[   0.0030 ] Assuming zero filled SBK key
[   0.0083 ] 
[   0.0083 ] Copying signature to RCM mesages
[   0.0089 ] tegrarcm --chip 0x21 --updatesig rcm_list_signed.xml
[   0.0099 ] 
[   0.0100 ] Parsing partition layout
[   0.0106 ] tegraparser --pt flash.xml
[   0.0115 ] 
[   0.0115 ] Creating list of images to be signed
[   0.0122 ] tegrahost --chip 0x21 --partitionlayout flash.bin --list images_list.xml
[   0.0135 ] 
[   0.0136 ] Generating signatures
[   0.0144 ] tegrasign --key None --list images_list.xml --pubkeyhash pub_key.hash
[   0.0149 ] Assuming zero filled SBK key
[   0.0252 ] 
[   0.0252 ] Parsing BCT
[   0.0258 ] tegrabct --bct bct.cfg --chip 0x21
[   0.0262 ] Invalid field PllMSelectDiv2
[   0.0263 ] 
Error: Return value 4
Command tegrabct --bct bct.cfg --chip 0x21
tegraflash~>

Then I tried the tegrabct file that came with the Tegra files, and that got me to line 67 of your output. It’s still running…I think. I’m going to leave it for a while and see what it does. Here is that output:

~/Jedroid_v2.0.1 
> sudo ./tegraflash.py --bct tegrabct.bct --bl fastboot.bin --odmdata 0x6009C000 --bldtb tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb --applet nvtboot_recovery.bin --chip 0x21 --cfg flash.xml
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
 
tegraflash~> flash
[   0.0000 ] Generating RCM messages
[   0.0006 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 --download rcm nvtboot_recovery.bin 0 0
[   0.0011 ] RCM 0 is saved as rcm_0.rcm
[   0.0013 ] RCM 1 is saved as rcm_1.rcm
[   0.0013 ] List of rcm files are saved in rcm_list.xml
[   0.0013 ] 
[   0.0014 ] Signing RCM messages
[   0.0018 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.hash
[   0.0022 ] Assuming zero filled SBK key
[   0.0058 ] 
[   0.0058 ] Copying signature to RCM mesages
[   0.0063 ] tegrarcm --chip 0x21 --updatesig rcm_list_signed.xml
[   0.0070 ] 
[   0.0070 ] Parsing partition layout
[   0.0074 ] tegraparser --pt flash.xml
[   0.0079 ] 
[   0.0080 ] Creating list of images to be signed
[   0.0084 ] tegrahost --chip 0x21 --partitionlayout flash.bin --list images_list.xml
[   0.0092 ] 
[   0.0093 ] Generating signatures
[   0.0097 ] tegrasign --key None --list images_list.xml --pubkeyhash pub_key.hash
[   0.0101 ] Assuming zero filled SBK key
[   0.0189 ] 
[   0.0189 ] Parsing BCT
[   0.0196 ] tegrabct --bct tegrabct.bct --chip 0x21
[   0.0207 ] 
[   0.0207 ] Updating boot device parameters
[   0.0213 ] tegrabct --bct tegrabct.bct --chip 0x21 --updatedevparam flash.bin
[   0.0242 ] 
[   0.0243 ] Updating bl info
[   0.0256 ] tegrabct --bct tegrabct.bct --chip 0x21 --updateblinfo flash.bin --updatesig images_list_signed.xml
[   0.0288 ] 
[   0.0288 ] Updating secondary storage information into bct
[   0.0296 ] tegraparser --pt flash.bin --chip 0x21 --updatecustinfo tegrabct.bct
[   0.0314 ] 
[   0.0314 ] Updating Odmdata
[   0.0321 ] tegrabct --bct tegrabct.bct --chip 0x21 --updatefields Odmdata = 0x6009C000
[   0.0325 ] Warning: No sdram params
[   0.0336 ] 
[   0.0337 ] Get Signed section bct
[   0.0346 ] tegrabct --bct tegrabct.bct --chip 0x21 --listbct bct_list.xml
[   0.0357 ] 
[   0.0357 ] Signing BCT
[   0.0362 ] tegrasign --key None --list bct_list.xml --pubkeyhash pub_key.hash
[   0.0367 ] Assuming zero filled SBK key
[   0.0376 ] 
[   0.0376 ] Updating BCT with signature
[   0.0381 ] tegrabct --bct tegrabct.bct --chip 0x21 --updatesig bct_list_signed.xml
[   0.0398 ] 
[   0.0398 ] Copying signatures
[   0.0404 ] tegrahost --chip 0x21 --partitionlayout flash.bin --updatesig images_list_signed.xml
[   0.0435 ] 
[   0.0436 ] Boot Rom communication
[   0.0451 ] tegrarcm --rcm rcm_list_signed.xml
[   0.0473 ] BR_CID: 0x321010015c66000220000000120181c0
[   0.2885 ] RCM version 0X210001
[   0.4085 ] Boot Rom communication completed
[   1.4150 ] 
[   1.4150 ] Sending BCT and pre-requisite binaries
[   1.4160 ] tegrarcm --download bct tegrabct.bct
[   1.4169 ] Applet version 00.01.0000
[   1.6579 ] Sending bct

I have let the program run for an hour, it looks like it was hung.

Jack, yes, I ran into issues with the bct provided by Jedroid. What I did was try running the flash script, then I would see where it raised an exception. Delete that line from bct.cfg. Rinse. Repeat.
I deleted a lot of lines like

SDRAM[0].PllMSelectDiv2 = 0x00000000;
SDRAM[0].PllMPDLshiftPh45 = 0x00000001;
SDRAM[0].PllMPDLshiftPh90 = 0x00000001;
SDRAM[0].PllMPDLshiftPh135 = 0x00000001;

I’ll put my final result here: http://pastebin.com/MkmFzUUr
Also, here is my flash.xml file: http://pastebin.com/qvGpnJmY

Also, I edited the tegraflash_internal.py to where it found the --bct argument. (lines 794 - 798)

def tegraflash_send_bct():
    info_print('Sending BCT and pre-requisite binaries')
    command = exec_file('tegrarcm')
    command.extend(['--download', 'bct', 'bct.cfg']) #tegrabct_values['--bct']])
    run_command(command)

I then hardcoded the string “bct.cfg” into the python script (I think it was getting the wrong file from the tegraparser binary). I also manually ran “tegraparser --pt flash.xml --chip 0x21 --updatecustinfo bct.bct” to make sure that the flash.bin file that was generated was correct and fresh (I also tried tegraflash.py without doing this and it didn’t work).

As a side note, I tried to manually run “tegrarcm --download bct bct.bct”, but it still hangs.

It seems my programs always hang on tegrarcm, whether it’s ran from the python script or manually.

One hard lesson that I’ve learned through this is: On the TX1, holding the force-recovery button and then pressing reset does not seem to put it into recovery mode. I get errors along the lines of “device not in Cboot mode”. You actually have to unplug the TX1 and then hold the force-recovery button while you turn it on.

Even so, the tegradevflash binary hangs when trying to flash. Here is my latest output:

tegraflash~> flash
[   0.0000 ] Generating RCM messages
[   0.0010 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 --download rcm nvtboot_recovery.bin 0 0
[   0.0017 ] RCM 0 is saved as rcm_0.rcm
[   0.0021 ] RCM 1 is saved as rcm_1.rcm
[   0.0026 ] List of rcm files are saved in rcm_list.xml
[   0.0026 ] 
[   0.0026 ] Signing RCM messages
[   0.0033 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.hash
[   0.0041 ] Assuming zero filled SBK key
[   0.0087 ] 
[   0.0087 ] Copying signature to RCM mesages
[   0.0094 ] tegrarcm --chip 0x21 --updatesig rcm_list_signed.xml
[   0.0108 ] 
[   0.0109 ] Parsing partition layout
[   0.0116 ] tegraparser --pt flash.xml
[   0.0148 ] 
[   0.0149 ] Creating list of images to be signed
[   0.0173 ] tegrahost --chip 0x21 --partitionlayout flash.bin --list images_list.xml
[   0.0242 ] 
[   0.0242 ] Generating signatures
[   0.0250 ] tegrasign --key None --list images_list.xml --pubkeyhash pub_key.hash
[   0.0258 ] Assuming zero filled SBK key
[   0.0371 ] 
[   0.0371 ] Parsing BCT
[   0.0379 ] tegrabct --bct bct.cfg --chip 0x21
[   0.0387 ] Copying Sdram info from 0 to 1 set
[   0.0392 ] Copying Sdram info from 1 to 2 set
[   0.0393 ] Copying Sdram info from 2 to 3 set
[   0.0393 ] 
[   0.0393 ] Updating boot device parameters
[   0.0400 ] tegrabct --bct bct.bct --chip 0x21 --updatedevparam flash.bin
[   0.0408 ] Warning: No sdram params
[   0.0410 ] 
[   0.0410 ] Updating bl info
[   0.0419 ] tegrabct --bct bct.bct --chip 0x21 --updateblinfo flash.bin --updatesig images_list_signed.xml
[   0.0429 ] 
[   0.0429 ] Updating secondary storage information into bct
[   0.0438 ] tegraparser --pt flash.bin --chip 0x21 --updatecustinfo bct.bct
[   0.0450 ] 
[   0.0451 ] Updating Odmdata
[   0.0460 ] tegrabct --bct bct.bct --chip 0x21 --updatefields Odmdata = 0x6009C000
[   0.0469 ] Warning: No sdram params
[   0.0470 ] 
[   0.0470 ] Get Signed section bct
[   0.0478 ] tegrabct --bct bct.bct --chip 0x21 --listbct bct_list.xml
[   0.0497 ] 
[   0.0497 ] Signing BCT
[   0.0512 ] tegrasign --key None --list bct_list.xml --pubkeyhash pub_key.hash
[   0.0528 ] Assuming zero filled SBK key
[   0.0539 ] 
[   0.0540 ] Updating BCT with signature
[   0.0554 ] tegrabct --bct bct.bct --chip 0x21 --updatesig bct_list_signed.xml
[   0.0573 ] 
[   0.0574 ] Copying signatures
[   0.0588 ] tegrahost --chip 0x21 --partitionlayout flash.bin --updatesig images_list_signed.xml
[   0.0642 ] 
[   0.0642 ] Boot Rom communication
[   0.0654 ] tegrarcm --rcm rcm_list_signed.xml
[   0.0665 ] BR_CID: 0x321010015c6600030000000003018200
[   0.0768 ] RCM version 0X210001
[   0.0885 ] Boot Rom communication completed
[   1.0955 ] 
[   1.0956 ] Sending BCT and pre-requisite binaries
[   1.0986 ] tegrarcm --download bct bct.cfg
[   1.1010 ] Applet version 00.01.0000
[   1.1142 ] Sending bct
[   1.1143 ] [................................................] 100%
[   1.1215 ] 
[   1.1216 ] Retrieving storage infomation
[   1.1242 ] tegrarcm --oem platformdetails storage storage_info.bin
[   1.1266 ] Applet version 00.01.0000
[   1.1378 ] Saved platform info in storage_info.bin
[   1.1753 ] 
[   1.1753 ] Sending bootloader and pre-requisite binaries
[   1.1777 ] tegrarcm --download rp1 tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb 0 --download ebt fastboot.bin 0 0
[   1.1798 ] Applet version 00.01.0000
[   1.1944 ] Sending rp1
[   1.1973 ] [................................................] 100%
[   1.4460 ] Sending ebt
[   1.4572 ] [................................................] 100%
[   1.6564 ] 
[   1.6589 ] tegrarcm --boot recovery
[   1.6611 ] Applet version 00.01.0000
[   1.6752 ] 
[   1.6753 ] Flashing the device
[   1.6795 ] tegradevflash --pt flash.bin --create --storageinfo storage_info.bin

I’m surprised to head that the entering force-recovery is not working for you. It works 100% of the time for me:

  • hold down force-recovery button
  • press and release reset
  • release force-recovery button

After a failed flash attempt I have to reset into force-recovery mode again.

Our flash.xml files are identical, so that’s good.

I notice you keep referencing “bct.bct” - is that a typo? Do you mean bct.cfg?

“tegraparser --pt flash.xml --chip 0x21 --updatecustinfo bct.bct” didn’t work for me. “Can’t find bct.bct.” I tried bct.cfg instead of bct.bct, and it told me bct.cfg needed to be a binary file. Weird.

“tegrarcm --download bct bct.cfg” told me that my device was not connected or in recovery mode. It was definitely both of those things

I did change tegraflash_internal.py as well, as per your instructions.

With all of these changes, it looks like we are at the same place:

~/Jedroid_v2.0.1 
> sudo ./tegraflash.py --bct bct.cfg --bl fastboot.bin --odmdata 0x6009C000 --bldtb tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb --applet nvtboot_recovery.bin --chip 0x21 --cfg flash.xml
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands

tegraflash~> flash
[   0.0000 ] Generating RCM messages
[   0.0027 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 --download rcm nvtboot_recovery.bin 0 0
[   0.0032 ] RCM 0 is saved as rcm_0.rcm
[   0.0051 ] RCM 1 is saved as rcm_1.rcm
[   0.0051 ] List of rcm files are saved in rcm_list.xml
[   0.0051 ] 
[   0.0051 ] Signing RCM messages
[   0.0062 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.hash
[   0.0066 ] Assuming zero filled SBK key
[   0.0113 ] 
[   0.0113 ] Copying signature to RCM mesages
[   0.0119 ] tegrarcm --chip 0x21 --updatesig rcm_list_signed.xml
[   0.0126 ] 
[   0.0126 ] Parsing partition layout
[   0.0131 ] tegraparser --pt flash.xml
[   0.0138 ] 
[   0.0138 ] Creating list of images to be signed
[   0.0151 ] tegrahost --chip 0x21 --partitionlayout flash.bin --list images_list.xml
[   0.0185 ] 
[   0.0185 ] Generating signatures
[   0.0190 ] tegrasign --key None --list images_list.xml --pubkeyhash pub_key.hash
[   0.0195 ] Assuming zero filled SBK key
[   0.0296 ] 
[   0.0296 ] Parsing BCT
[   0.0317 ] tegrabct --bct bct.cfg --chip 0x21
[   0.0324 ] Copying Sdram info from 0 to 1 set
[   0.0351 ] Copying Sdram info from 1 to 2 set
[   0.0351 ] Copying Sdram info from 2 to 3 set
[   0.0351 ] 
[   0.0351 ] Updating boot device parameters
[   0.0356 ] tegrabct --bct bct.bct --chip 0x21 --updatedevparam flash.bin
[   0.0361 ] Warning: No sdram params
[   0.0362 ] 
[   0.0363 ] Updating bl info
[   0.0367 ] tegrabct --bct bct.bct --chip 0x21 --updateblinfo flash.bin --updatesig images_list_signed.xml[   0.0375 ] 
[   0.0375 ] Updating secondary storage information into bct
[   0.0381 ] tegraparser --pt flash.bin --chip 0x21 --updatecustinfo bct.bct
[   0.0388 ] 
[   0.0388 ] Updating Odmdata
[   0.0394 ] tegrabct --bct bct.bct --chip 0x21 --updatefields Odmdata = 0x6009C000
[   0.0401 ] Warning: No sdram params
[   0.0401 ] 
[   0.0401 ] Get Signed section bct
[   0.0407 ] tegrabct --bct bct.bct --chip 0x21 --listbct bct_list.xml
[   0.0412 ] 
[   0.0412 ] Signing BCT
[   0.0417 ] tegrasign --key None --list bct_list.xml --pubkeyhash pub_key.hash
[   0.0421 ] Assuming zero filled SBK key
[   0.0425 ] 
[   0.0425 ] Updating BCT with signature
[   0.0444 ] tegrabct --bct bct.bct --chip 0x21 --updatesig bct_list_signed.xml
[   0.0457 ] 
[   0.0457 ] Copying signatures
[   0.0467 ] tegrahost --chip 0x21 --partitionlayout flash.bin --updatesig images_list_signed.xml
[   0.0484 ] 
[   0.0485 ] Boot Rom communication
[   0.0494 ] tegrarcm --rcm rcm_list_signed.xml
[   0.0499 ] BR_CID: 0x321010015c66000220000000120181c0
[   0.3790 ] RCM version 0X210001
[   0.4984 ] Boot Rom communication completed
[   1.5048 ] 
[   1.5048 ] Sending BCT and pre-requisite binaries
[   1.5054 ] tegrarcm --download bct bct.cfg[   1.5058 ] Applet version 00.01.0000
[   1.7482 ] Sending bct
[   1.7482 ] [................................................] 100%
[   1.7541 ] 
[   1.7541 ] Retrieving storage infomation
[   1.7548 ] tegrarcm --oem platformdetails storage storage_info.bin
[   1.7552 ] Applet version 00.01.0000
[   1.9964 ] Saved platform info in storage_info.bin
[   2.0954 ] 
[   2.0954 ] Sending bootloader and pre-requisite binaries
[   2.0960 ] tegrarcm --download rp1 tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb 0 --download ebt fastboot.bin 0 0
[   2.0964 ] Applet version 00.01.0000
[   2.3365 ] Sending rp1
[   2.3390 ] [................................................] 100%
[   2.5868 ] Sending ebt
[   2.5961 ] [................................................] 100%
[   2.7933 ] 
[   2.7940 ] tegrarcm --boot recovery
[   2.7944 ] Applet version 00.01.0000
[   3.0371 ] 
[   3.0371 ] Flashing the device
[   3.0397 ] tegradevflash --pt flash.bin --storageinfo storage_info.bin --create

I just tried running “tegradevflash --pt flash.bin --storageinfo storage_info.bin --create” - the last command from the output. It keeps reporting that the USB device is not connected. I tried getting into recovery mode by holding the button when plugging it in - still no luck. Do you see the same, John?

For me, the quick way to enter force-recovery mode seems to not be 100%. I get errors such as you got:
“‘tegrarcm --download bct bct.cfg’ told me that my device was not connected or in recovery mode.
It was definitely both of those things”

Therefore I am doing the long way (unplugging the TX1 and holding down recovery as it first turns on) as a way to eliminate variables. I am no longer getting any “device not in recovery mode” errors.

I am referencing bct.bct because “bct.bct” seems to be the binary file generated/downloaded from “bct.cfg”. I believe it is generated during the “tegrarcm --download bct bct.cfg” command. The binary file “bct.bct” is then needed for the “tegrabct --bct bct.bct --chip 0x21 --updatedevparam flash.bin” command.

We are in the same place now, and the output of the “dmesg” linux command shows that “tegradevflash” stops responding after a short time.

Jack, it seems that running “sudo ./tegradevflash --pt flash.bin --storageinfo storage_info.bin --create” after previously trying to run the “tegraflash.py” triggers the error "Cannot Open USB
". However, if I try running “sudo ./tegradevflash --pt flash.bin --storageinfo storage_info.bin --create” on a fresh reboot into force-recovery mode, the application does not output the “Cannot Open USB” error. It seems that tegraflash.py locks up the USB use for itself and that exiting the command manually with Ctrl+C (because the application hangs) exits the python script but the USB is still claimed by the python script.

Here is the output of dmesg after running “sudo ./tegradevflash --pt flash.bin --storageinfo storage_info.bin --create” and having it hang:

<-------snip--------->
[ 2759.179695] INFO: task tegradevflash:5626 blocked for more than 120 seconds.
[ 2759.179703]       Tainted: G           OE 3.16.0-55-generic #74~14.04.1-Ubuntu
[ 2759.179705] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 2759.179709] tegradevflash   D ffff880466d930c0     0  5626   5625 0x20020000
[ 2759.179716]  ffff880401cdfc50 0000000000000082 ffff880412049460 ffff880401cdffd8
[ 2759.179722]  00000000000130c0 00000000000130c0 ffff8804506c4750 ffff880401cdfd88
[ 2759.179728]  7fffffffffffffff ffff880401cdfd90 ffff880412049460 0000000000000000
[ 2759.179733] Call Trace:
[ 2759.179746]  [<ffffffff8176bc39>] schedule+0x29/0x70
[ 2759.179752]  [<ffffffff8176b019>] schedule_timeout+0x229/0x2a0
[ 2759.179759]  [<ffffffff8109ed25>] ? check_preempt_curr+0x75/0xa0
[ 2759.179764]  [<ffffffff8109ed69>] ? ttwu_do_wakeup+0x19/0xc0
[ 2759.179769]  [<ffffffff8109eebd>] ? ttwu_do_activate.constprop.85+0x5d/0x70
[ 2759.179775]  [<ffffffff8176cb96>] wait_for_completion_timeout+0xa6/0x170
[ 2759.179781]  [<ffffffff810a1bb0>] ? wake_up_state+0x20/0x20
[ 2759.179788]  [<ffffffff8156cbad>] usb_start_wait_urb+0x7d/0x150
[ 2759.179794]  [<ffffffff81095cbc>] ? notifier_call_chain+0x4c/0x70
[ 2759.179799]  [<ffffffff8156d111>] usb_bulk_msg+0xc1/0x180
[ 2759.179804]  [<ffffffff8157857b>] proc_bulk+0x20b/0x390
[ 2759.179810]  [<ffffffff8157905b>] usbdev_do_ioctl+0x95b/0x10a0
[ 2759.179816]  [<ffffffff811d650e>] ? ____fput+0xe/0x10
[ 2759.179821]  [<ffffffff815797b0>] usbdev_compat_ioctl+0x10/0x20
[ 2759.179827]  [<ffffffff8122612a>] compat_SyS_ioctl+0xba/0x2f0
[ 2759.179833]  [<ffffffff81772909>] ia32_do_call+0x13/0x13

It might be worth a note that I cannot exit the tegradevflash program once it gets into a stalled state. Ctrl+C does nothing (I don’t think it was intended to be used manually or to fail) and the only way to exit is to close the command shell.

Here is some more output of dmesg (I don’t know if this will be useful or not). The following is taken from when I started up the TX1 with a USB cable plugged into my computer and trying to run the “tegraflash.py” python script until it hangs on “tegradevflash”.

[ 2377.357085] usb 3-2: USB disconnect, device number 8
[ 2443.653796] usb 3-6: new high-speed USB device number 9 using xhci_hcd
[ 2443.782429] usb 3-6: New USB device found, idVendor=0955, idProduct=7721
[ 2443.782437] usb 3-6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2443.782442] usb 3-6: Product: APX
[ 2443.782446] usb 3-6: Manufacturer: NVIDIA Corp.
[ 2485.189343] wlan0: authenticate with e0:3f:49:99:ee:bc
[ 2485.192646] wlan0: send auth to e0:3f:49:99:ee:bc (try 1/3)
[ 2485.193771] wlan0: authenticated
[ 2485.193939] cfg80211: Calling CRDA to update world regulatory domain
[ 2485.194729] wlan0: associate with e0:3f:49:99:ee:bc (try 1/3)
[ 2485.195691] wlan0: RX AssocResp from e0:3f:49:99:ee:bc (capab=0x11 status=0 aid=13)
[ 2485.196758] wlan0: associated
[ 2485.197673] cfg80211: World regulatory domain updated:
[ 2485.197677] cfg80211:  DFS Master region: unset
[ 2485.197679] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 2485.197682] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[ 2485.197684] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[ 2485.197686] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm), (N/A)
[ 2485.197688] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[ 2485.197690] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[ 2555.892108] usb 3-6: USB disconnect, device number 9
[ 2564.881885] usb 3-6: new high-speed USB device number 10 using xhci_hcd
[ 2565.010611] usb 3-6: New USB device found, idVendor=0955, idProduct=7721
[ 2565.010618] usb 3-6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2565.010623] usb 3-6: Product: APX
[ 2565.010627] usb 3-6: Manufacturer: NVIDIA Corp.
[ 2571.418915] usb 3-6: USB disconnect, device number 10
[ 2579.744545] usb 3-6: new high-speed USB device number 11 using xhci_hcd
[ 2579.873221] usb 3-6: New USB device found, idVendor=0955, idProduct=7721
[ 2579.873230] usb 3-6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2579.873234] usb 3-6: Product: APX
[ 2579.873238] usb 3-6: Manufacturer: NVIDIA Corp.
[ 2604.948760] wlan0: authenticate with e0:3f:49:99:ee:b8
[ 2604.949812] wlan0: send auth to e0:3f:49:99:ee:b8 (try 1/3)
[ 2604.950919] cfg80211: Calling CRDA to update world regulatory domain
[ 2604.951610] wlan0: authenticated
[ 2604.955347] wlan0: associate with e0:3f:49:99:ee:b8 (try 1/3)
[ 2604.958210] cfg80211: World regulatory domain updated:
[ 2604.958214] cfg80211:  DFS Master region: unset
[ 2604.958216] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 2604.958219] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[ 2604.958222] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[ 2604.958224] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm), (N/A)
[ 2604.958225] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[ 2604.958227] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[ 2604.959841] wlan0: RX AssocResp from e0:3f:49:99:ee:b8 (capab=0x411 status=0 aid=11)
[ 2604.964531] wlan0: associated
[ 2759.179695] INFO: task tegradevflash:5626 blocked for more than 120 seconds.
[ 2759.179703]       Tainted: G           OE 3.16.0-55-generic #74~14.04.1-Ubuntu
<-------snip------->

The output after “<-------snip------->” is continued by my post above.

Argh. Without being able to look inside tegradevflash, I’m not sure how to see what is blocking this.

Did you ever get past this? I am in a similar spot where it is stalling on “tegradevflash --pt flash.bin --storageinfo storage_info.bin --create”

Well I got past this by using ‘-bl cboot.bin’ though I am not using the same android build as you so seeing a different error.