Skip to content

Conversation

@P-Storm
Copy link
Contributor

@P-Storm P-Storm commented Jul 29, 2025

Adding more information for command bmputil-cli target power:

[2025-07-29T13:38:30Z INFO  bmputil_cli] Device target power state: false
[2025-07-29T13:38:30Z INFO  bmputil_cli] Target voltage: 0V

Also made Device target power state a warning if the version is too low.

Added preparation for REMOTE_SRST and REMOTE_PWR

@semanticdiff-com
Copy link

semanticdiff-com bot commented Jul 29, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  src/bin/bmputil-cli.rs  42% smaller
  src/serial/remote/mod.rs  35% smaller
  src/serial/remote/protocol_v4.rs  30% smaller
  src/serial/bmd_rsp.rs  27% smaller
  src/serial/remote/protocol_v0.rs  0% smaller
  src/serial/remote/protocol_v1.rs  0% smaller
  src/serial/remote/protocol_v2.rs  0% smaller
  src/serial/remote/protocol_v3.rs  0% smaller

Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done an initial review, though not particularly thorough - hopefully these notes help direct the evolution of this PR though as it would be great to get this in, but we do need to make sure it's done right.

fn supported_families(&self) -> Result<Option<TargetFamily>>;
fn get_target_power_state(&self) -> Result<bool>;
fn get_target_voltage(&self) -> Result<f32>;
fn get_srst_val(&self) -> Result<bool>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be nrst, otherwise this is just plain confusing as srst means Software Reset in a pile of places, but this refers to the nRST pin state (ARM trying to make it mean System Reset does not help things.. it just overloads the initialism)

pub const JTAG_INIT: &'static str = "!JS#";
pub const NRST_GET: &'static str = "!Gz#";
pub const NRST_SET: &'static str = "!GZ#";
pub const PWR_GET: &'static str = "!Gp#";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicates the first constant, and the SET variant should be named the same way - ie SET_TARGET_POWER_STATE.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good catch, removed the duplicate and renamed :)

Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Started to try and re-review however hit some things that make further review a little pointless for the moment - we'll let you address these three items and then get back to you with another round once they're addressed so we can more usefully review things for you.

Comment on lines +55 to +57
/// This is the max possible size of a remote protocol packet which a hard limitation of the
/// firmware on the probe - 1KiB is all the buffer that could be spared.
pub const MAX_MSG_SIZE: usize = 1024;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB: this constant is not specific to the response - it sets the request max length too.

pub const HL_CHECK: &str = "!HC#";
/// This command asks the probe to initialise JTAG comms to any connected targets
pub const JTAG_INIT: &str = "!JS#";
pub const NRST_TARGET_VOLTAGE: &str = "!GV#";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure what happened here, but this one isn't documented now and the constant is misnamed for what it does - this retrieves the target voltage.

/// Probe found an error with a request parameter
pub const RESP_PARERR: u8 = b'P';
/// Start of message marker for the protocol
pub const SOM: u8 = b'!';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is part of the request not response - same for EOM above. It's the RESP marker that indicates the start of a response.

@dragonmux dragonmux added this to the v1.1 release milestone Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants