Crates.io | mediatek-brom |
lib.rs | mediatek-brom |
version | 0.1.0 |
source | src |
created_at | 2024-11-10 21:03:24.945366 |
updated_at | 2024-11-10 21:03:24.945366 |
description | Mediatek bootrom protocol implementation |
homepage | https://github.com/boardswarm/mediatek-brom |
repository | https://github.com/boardswarm/mediatek-brom |
max_upload_size | |
id | 1443213 |
size | 57,151 |
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);
To understand the protocol the following open source implementations were studied: