Do some research on the MCU protocol

This commit is contained in:
Michael Mikovsky
2026-05-03 11:43:22 -06:00
parent 8257b14b55
commit 2a005416cd
4 changed files with 327 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
[package]
name = "serial-test"
version = "0.1.0"
edition = "2024"
[dependencies]
anyhow = "1.0.102"
serialport = "4.9.0"
+2
View File
@@ -0,0 +1,2 @@
cross build --release --target armv7-unknown-linux-musleabihf
sshpass -p MTY4ODE2 scp ./target/armv7-unknown-linux-musleabihf/release/serial-test root@192.168.0.86:/root/
+17
View File
@@ -0,0 +1,17 @@
use std::fs::OpenOptions;
use std::io::{Read, Write};
use std::time::Duration;
fn main() -> anyhow::Result<()> {
let mut dev = OpenOptions::new()
.read(true)
.write(true)
.open("/dev/rpmsg1")?;
let mut buf = [0u8; 4096];
loop {
let n = dev.read(&mut buf)?;
println!("rpmsg read {n} bytes: {:02x?}", &buf[..n]);
}
}