betrusted-io / betrusted-ec

Betrusted embedded controller (UP5K)
Other
44 stars 6 forks source link

tools/README: peek example seems to have wrong address in this repo (0x20000000 instead of 0x20000008) #15

Closed ewenmcneill closed 2 years ago

ewenmcneill commented 2 years ago

According to https://github.com/betrusted-io/betrusted-wiki/wiki/Updating-Your-Device#installing-the-usb-updater-usb_updatepy, the betrusted-ec/tools/README.md is the authoritative version, and should be used if the two disagree. However the address used for testing "peek" (to confirm interaction with the Precursor over USB) in the "authoritative" version (0x20000000):

https://github.com/betrusted-io/betrusted-ec/blob/cbb8a02cc216860d23f8049c495d71ddbe101843/tools/README.md?plain=1#L84-L91

seems just to return an "all 1s" value, whereas the address given in the "non-authoritative" version (0x20000008):

https://github.com/betrusted-io/betrusted-wiki/wiki/Updating-Your-Device#debugging

seems to work as described, at least with a "factory shipped" Precursor.

Possibly those two files could be synchronised on the correct address to use? (I found this because I was trying to verify that usb_updater.py could talk to the Precursor without root privileges before trying to do a factory update, and thus following links to find the "authoritative" documentation to verify that.)

(Fortunately it looks like the page referenced in the "getting started" documentation is more up to date than the version claimed to be the original definitive version.)

Ewen

(precursor-updater-venv) ewen@parthenon:/src/precursor$ xous-core/tools/usb_update.py --peek 0x20000000
0xffffffff
(precursor-updater-venv) ewen@parthenon:/src/precursor$ xous-core/tools/usb_update.py --peek 0x20000008
0x665599aa
(precursor-updater-venv) ewen@parthenon:/src/precursor$ 
bunnie commented 2 years ago

That's now fixed. 8 bytes of padding was inserted on the FPGA bitstream to help some AES block alignments to work out better, and that change didn't get propagated here.