Skip to content

Conversation

@kurtjd
Copy link
Contributor

@kurtjd kurtjd commented Jan 20, 2026

This PR does a few things:

  • Adds serial as a Source, which allows the app to talk directly to a dev platform in user-space (over a COM port for example). Can be useful for testing services without needing to worry about FFA and whatnot.
  • Fixes some clippy warnings introduced from needing to bump MSRV
  • Some minor refactoring to use the message structs defined by the crates in embedded-services

Tested this on the dev-imxrt platform and works pretty well. I was running into some issues where I occasionally receive bytes that shouldn't be coming in for reasons I haven't been able to figure out yet, but if we drain the incoming bytes and just return an error it leaves things in a good state for the next attempt and we quickly recover.

@kurtjd kurtjd self-assigned this Jan 20, 2026
@kurtjd kurtjd added the enhancement New feature or request label Jan 20, 2026
@kurtjd kurtjd moved this to In review in Embedded Controller Jan 20, 2026
philgweber
philgweber previously approved these changes Jan 20, 2026
Copy link
Collaborator

@philgweber philgweber left a comment

Choose a reason for hiding this comment

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

Will have to think about the transport and integrating with FFA and secure world so we have the ability to redirect messages through either path.

@kurtjd
Copy link
Contributor Author

kurtjd commented Jan 20, 2026

Will have to think about the transport and integrating with FFA and secure world so we have the ability to redirect messages through either path.

So I was thinking this can be used as an alternative to going through FFA when someone jsut wants to quickly connect to a board and do some testing of the services. In my mind I imagined this app will just select the acpi source if it wants to talk to FFA, and whether FFA goes through uart or eSPI from the apps perspective shouldn't matter. Does that seem similar to what you were thinking?

@kurtjd kurtjd changed the title Add serial source ec-test-app: Add serial source Jan 20, 2026
@kurtjd kurtjd force-pushed the add-serial-source branch from 72c2645 to 75bdfa4 Compare January 20, 2026 19:24
@kurtjd kurtjd marked this pull request as ready for review January 20, 2026 19:25
@kurtjd kurtjd requested a review from a team as a code owner January 20, 2026 19:25
@kurtjd kurtjd force-pushed the add-serial-source branch from 75bdfa4 to 00a491e Compare January 20, 2026 19:39
Comment on lines +37 to +41
fn charge_state_as_str(state: BatteryState) -> &'static str {
if state.contains(BatteryState::DISCHARGING) {
"Discharging"
} else {
"Charging"
Copy link
Contributor

Choose a reason for hiding this comment

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

impl Display for BatteryState?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BatteryState is a foreign type and Display is a foreign trait so orphan rule wouldn't allow that, right? But can give it a try.

Copy link
Contributor

Choose a reason for hiding this comment

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

Where is battery state defined? Could impl Display on that crate and just rely on it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's defined by the embedded-batteries crate which is reexported by the battery-service-messages crate. Was also missing a couple TryFrom<u32>s in there which I opened a PR for so I can do that for these as well. However, initial attempts to update embedded-batteries throughout caused a lot of issues so ideally would like this to get in first then can take the time to fix everything that an embedded-batteries update will cause.

Copy link
Collaborator

@williampMSFT williampMSFT left a comment

Choose a reason for hiding this comment

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

:shipit:

@kurtjd
Copy link
Contributor Author

kurtjd commented Jan 29, 2026

Will wait for #41 to merge, then update this PR to implement RtcSource for serial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

4 participants