Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ num_enum = "0.7.4"
half = "2.6.0"
env_logger = "0.11.8"
anyhow = "1.0"
crazyflie-link = { version = "0.4.2", default-features = false }
crazyflie-lib = { version = "0.7.1", default-features = false }
crazyradio = { version = "0.6.0", features = ["async"] }
crazyflie-link = { version = "0.5.0", default-features = false }
crazyflie-lib = { version = "0.8.0", default-features = false }
crazyradio = { version = "0.7.0", features = ["async"] }
rusb = "0.9"
cfloader = "0.1.0"
clap = { version = "4.5.46", features = ["derive"] }
Expand Down Expand Up @@ -87,8 +87,8 @@ hex = "0.4.3"
chrono = "0.4.44"

[target.'cfg(unix)'.dependencies]
crazyflie-link = { version = "0.4.2", default-features = false, features = ["packet_capture"] }
crazyradio = { version = "0.6.0", features = ["async", "packet_capture"] }
crazyflie-link = { version = "0.5.0", default-features = false, features = ["packet_capture"] }
crazyradio = { version = "0.7.0", features = ["async", "packet_capture"] }

# Used by build.rs to generate shell-completion scripts from the same clap
# command tree as the binary (src/cli.rs is shared via include!).
Expand Down
34 changes: 1 addition & 33 deletions src/modules/bootloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,38 +513,6 @@ pub async fn flash(link_context: &crazyflie_link::LinkContext, uri: &str, toc_ca

let memories = cf.memory.get_memories(Some(MemoryType::DeckMemory));
if !memories.is_empty() {
// Write the new-fw-size to the deck's command region before the
// bulk write so the deck-side driver can erase the right region
// up front. The DeckMemorySection abstraction doesn't expose the
// command/info addresses, so do this via RawMemory: parse the
// info section to locate the protocol section index by name,
// then write 4 LE bytes at 0x1000 + idx*0x20.
let raw = match cf.memory.open_memory::<RawMemory>(memories[0].clone()).await {
Some(Ok(r)) => r,
Some(Err(e)) => return Err(anyhow!("Open DeckMemory as raw: {:?}", e)),
None => return Err(anyhow!("DeckMemory not found")),
};
let mut proto_idx: Option<usize> = None;
for i in 0..8usize {
let data = raw.read(1 + i * 0x20, 0x20).await?;
if data.len() < 0x20 { break; }
if (data[0] & 0x01) == 0 { continue; }
let name: String = data[14..32].iter()
.take_while(|&&b| b != 0)
.map(|&b| b as char)
.collect();
if name == firmware.target {
proto_idx = Some(i);
break;
}
}
if let Some(idx) = proto_idx {
let cmd_addr = 0x1000 + idx * 0x20;
let size_bytes = (firmware.data.len() as u32).to_le_bytes();
raw.write(cmd_addr, &size_bytes).await?;
}
cf.memory.close_memory(raw).await?;

let deck_memory = match cf.memory.open_memory::<DeckMemory>(memories[0].clone()).await {
Some(Ok(deck)) => deck,
Some(Err(e)) => {
Expand Down Expand Up @@ -584,7 +552,7 @@ pub async fn flash(link_context: &crazyflie_link::LinkContext, uri: &str, toc_ca
let progress_callback = move |bytes_written: usize, _total_bytes: usize| {
pb.set_position(bytes_written as u64);
};
section.write_with_progress(0, &firmware.data, progress_callback).await?;
section.flash_firmware_with_progress(&firmware.data, progress_callback).await?;
finish_progress(&progress_bar, "Deck firmware flashed successfully!");
}

Expand Down
Loading