putusb
Table of Contents
putusb
putusb is a utility by Ilya Petrov (muromec) for low-level communication with some Motorola smartphones and also Tegra devices. putusb runs on a host PC and communicates with the Tegra system (the AC100 in our case) through a dedicated USB port (the mini USB port on the AC100).
Unlike nvflash (which is distributed by nvidia as a binary only), putusb is a python script and should run on any system supported by PyUSB.
Installing putusb
Prerequisitives
- Python intepreter (2.7 is known to work)
- PyUSB (the old 0.x branch is known to work)
Installation
$ git clone git://github.com/muromec/putusb.git
Usage
If you have Qt4 installed, you can use
$ ./qt-putusb.py
If you want full control of the operations, you can use it either from a python interactive command line or from a script. This example will let you to make a backup of your device:
import putusb dev = putusb.NvidiaUsb() dev.boot("bin/tegra_pre_boot.bin", "bin/fastboot.stock.bin") print 'LOADED' print 'Current partition table:' print dev.parts() for i in range(2, 14): f = open("part"+str(i), 'wb') f.truncate() map(f.write, dev.read_part(i) ) f.close()
On my 32Gb ac100-116 the partition table looks like this:
[Part(num=2, name='BCT\x00', typ=18, start_sectors=0, size_sectors=1536, sector=2048) Part(num=3, name='PT\x00\x00', typ=18, start_sectors=1536, size_sectors=256, sector=2048) Part(num=4, name='EBT\x00', typ=18, start_sectors=1792, size_sectors=1024, sector=2048) Part(num=5, name='SOS\x00', typ=18, start_sectors=2816, size_sectors=2560, sector=2048) Part(num=6, name='LNX\x00', typ=18, start_sectors=5376, size_sectors=4096, sector=2048) Part(num=7, name='MBR\x00', typ=18, start_sectors=9472, size_sectors=512, sector=2048) Part(num=8, name='APP\x00', typ=18, start_sectors=9984, size_sectors=153600, sector=2048) Part(num=9, name='CAC\x00', typ=18, start_sectors=163584, size_sectors=204800, sector=2048) Part(num=10, name='MSC\x00', typ=18, start_sectors=368384, size_sectors=1024, sector=2048) Part(num=11, name='EM1\x00', typ=18, start_sectors=369408, size_sectors=256, sector=2048) Part(num=12, name='UDA\x00', typ=18, start_sectors=369664, size_sectors=632320, sector=2048) Part(num=13, name='EM2\x00', typ=18, start_sectors=1001984, size_sectors=256, sector=2048) Part(num=14, name='UDB\x00', typ=18, start_sectors=1002240, size_sectors=14628096, sector=2048)]
Another useful function is
dev.flash_part(<partno>, <filename>)
putusb.txt · Last modified: 2012/01/02 21:20 by paulf