iqlusioninc / usbarmory.rs

Bare metal Rust support for USB armory MkII devices
Apache License 2.0
58 stars 4 forks source link

remove `imx_usb` dependency #60

Closed japaric closed 4 years ago

japaric commented 4 years ago

Right now this only implements command line replacement for imx_usb. You can try it out with:

NOTE the device must be in USB Serial Downloader mode -- this is the "development mode" where the 15a2:0080 device appears under lsusb

$ cd host/usd
$ cargo run --bin load -- /path/to/u-boot-dtb.imx
Ivt {
    header: Header {
        tag: 209,
        length: 32,
        version: 64,
    },
    self: 0x877ff400,
    boot: 0x877ff420,
    dcd: 0x877ff42c,
    csf: 0x87881000,
    entry: 0x87800000,
}
dcd_write(address=0x00910000, count=480)
.
DCD_WRITE ACK-ed
clearing DCD pointer (0x877ff42c)
write_file(address=0x877ff400, count=531456)
.........................................................................
WRITE_FILE ACK-ed
jump_address(address=0x877ff400)
JUMP_ADDRESS ACK-ed
DONE

This will load u-boot into RAM. Once loaded you can use minicom to access the u-boot console.

TODOs

japaric commented 4 years ago

This has been successfully tested on macOS.

I have removed the hardcoded x86_64-unknown-linux target triple from the .cargo/config and replaced it with usd-runner (the name of the runner binary). The docs have been updated as it is now necessary to install the usd-runner binary to get cargo run to work.