1 unstable release
0.1.0 | Nov 10, 2024 |
---|
#954 in Hardware support
393 downloads per month
19KB
507 lines
Mediatek bootrom protocol implementation
Mediatek bootroms implement a simple protocol that can be used over e.g. uart to, among other things, load a Download Agent (DA). This crate contains a sans-io protocol implementation and some small helper traits to build on top of sync or async io implementations.
For example to get the hardware code and version the following can be used over e.g. a sync serial transport implementation:
use mediatek_brom::{io::BromExecute, Brom};
# let mut transport = std::io::Cursor::new([0u8; 16]);
let brom = transport.execute(Brom::handshake(0x201000)).unwrap();
let hwcode = transport.execute(brom.hwcode()).unwrap();
println!("Hwcode: {:x?}", hwcode);
Credits
To understand the protocol the following open source implementations were studied:
Dependencies
~0.2–6MB
~37K SLoC