Skip to content

Very experimental and for testing only#5201

Draft
JurajSadel wants to merge 3 commits intoesp-rs:mainfrom
JurajSadel:wifi-hil
Draft

Very experimental and for testing only#5201
JurajSadel wants to merge 3 commits intoesp-rs:mainfrom
JurajSadel:wifi-hil

Conversation

@JurajSadel
Copy link
Copy Markdown
Contributor

I want to use this PR as a playground for Radio HIL. It’s very rough and messy, but I mainly want to test the infrastructure here with the simplest possible POC.

@JurajSadel JurajSadel closed this Mar 17, 2026
@JurajSadel JurajSadel reopened this Mar 17, 2026
@JurajSadel JurajSadel force-pushed the wifi-hil branch 9 times, most recently from 16ec989 to 4816b6f Compare March 17, 2026 16:21
@JurajSadel JurajSadel force-pushed the wifi-hil branch 2 times, most recently from 2368b8e to 2cbecd3 Compare March 25, 2026 09:48
@JurajSadel
Copy link
Copy Markdown
Contributor Author

/hil quick

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 25, 2026

Triggered quick HIL run for #5201.

Run: https://github.com/esp-rs/esp-hal/actions/runs/23534885428

Status update: ❌ HIL (quick) run failed (conclusion: failure).

@github-actions github-actions Bot added the merge-conflict Merge conflict detected. Automatically added/removed by CI. label Mar 25, 2026
@github-actions
Copy link
Copy Markdown

New commits in main has made this PR unmergable. Please resolve the conflicts.

@github-actions github-actions Bot added merge-conflict Merge conflict detected. Automatically added/removed by CI. and removed merge-conflict Merge conflict detected. Automatically added/removed by CI. labels Mar 26, 2026
@github-actions
Copy link
Copy Markdown

New commits in main has made this PR unmergable. Please resolve the conflicts.

@github-actions github-actions Bot added merge-conflict Merge conflict detected. Automatically added/removed by CI. and removed merge-conflict Merge conflict detected. Automatically added/removed by CI. labels Mar 27, 2026
@github-actions
Copy link
Copy Markdown

New commits in main has made this PR unmergable. Please resolve the conflicts.

@github-actions github-actions Bot removed the merge-conflict Merge conflict detected. Automatically added/removed by CI. label Mar 27, 2026
@github-actions github-actions Bot added the merge-conflict Merge conflict detected. Automatically added/removed by CI. label Mar 27, 2026
@github-actions
Copy link
Copy Markdown

New commits in main has made this PR unmergable. Please resolve the conflicts.

Copy link
Copy Markdown
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

I don't think this is quite the direction I would go with.

I think its okay to have a radio-hil package. I think the testing mechanism will be sufficiently different that trying to shoe-horn it into our current hil suite will cause headaches.

As my other comment alludes to, we shouldn't be invoking binaries - let's use probe-rs directly.

Comment thread xtask/src/radio_hil_runner.rs Outdated
@github-actions github-actions Bot removed the merge-conflict Merge conflict detected. Automatically added/removed by CI. label Apr 2, 2026
@JurajSadel
Copy link
Copy Markdown
Contributor Author

/hil quick

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

Triggered quick HIL run for #5201.

Run: https://github.com/esp-rs/esp-hal/actions/runs/23892282626

Status update: ❌ HIL (quick) run failed (conclusion: failure).

Copy link
Copy Markdown
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

Not at the point of critiquing code, my review is still conceptual and architectural at this point.

@@ -0,0 +1,222 @@
#[embedded_test::tests(default_timeout = 45, executor = esp_rtos::embassy::Executor::new())]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The directory structure is a bit odd to me, I feel like mod esp_radio will have all the tests in it, so what's the point of the mod?

We should probably split these into catagories, wifi, ble etc.

}

#[test]
async fn wifi_ap_test(p: Peripherals) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we plan on adding more test configurations here? If we do, how will that work regarding test synchronization to the other board? I.e the other board might be running tests whilst this test finishes causing the other side to fail when there is no AP available?

If this will always be one test (which doesn't really test anything, note the lack of asserts here), then I think we should write these differently. The goal of testing is to isolate and test discrete variables, therefore we should only testing on one side at any given time. If we want to test the dhcp side with this AP, this AP should be a fixed function firmware.

General rule of thumb: If we're testing STA, AP should be a fixed. If we're testing AP, then the STA firmware should be fixed, or a set of fixed firmwares to try.

}

/// Run a radio test on 2 devices (AP and STA)
pub fn run_radio_test(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Based on my other comments above, I think if we make changes so that we're only testing one variable at a time, we can use the current xtask tooling for running tests, with a few modifications.

When we run xtask test with a test name, in this case wifi_dhcp (imo should be wifi_sta), our test runner should be able to find the test, then we can add metadata at the top of the file to indicate what firmware needs to run on the other side.

//% HARNESS_FIRMWARE(wifi_ap)

Something like this, so that the xtask knows how to setup the other device for this test series.

@github-actions github-actions Bot added the merge-conflict Merge conflict detected. Automatically added/removed by CI. label Apr 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

New commits in main has made this PR unmergable. Please resolve the conflicts.

@github-actions github-actions Bot removed the merge-conflict Merge conflict detected. Automatically added/removed by CI. label Apr 13, 2026
Comment thread xtask/src/firmware.rs
pub fn load(path: &Path) -> Result<Vec<Metadata>> {
let mut examples = Vec::new();

println!("Loading examples from {}", path.display());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we probably should use log instead

Comment thread xtask/src/firmware.rs
relevant_metadata.apply(|meta| meta.tag = Some(meta_line.value.to_string()));
}
// Optional support firmware binary that must run on another target.
"HARNESS_FIRMWARE" => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe we don't want to mix usage of _ and -


#[cfg(soc_has_wifi)]
#[path = "esp_radio/wifi_dhcp.rs"]
mod wifi_dhcp;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we can probably find a better name - also for the executable since esp_radio is very generic and we will need more (since different tests need a different support FW)

@bjoernQ
Copy link
Copy Markdown
Contributor

bjoernQ commented Apr 27, 2026

I wonder if we always want the support-fw and the test-fw to target the same chip - but I guess that assumption should be fine

Copy link
Copy Markdown
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

Overall, this is taking shape nicely, but needs some more thought on how we setup the tests and hand off the running, and then some more general polish.

@@ -0,0 +1,557 @@
#[embedded_test::tests(default_timeout = 45, executor = esp_rtos::embassy::Executor::new())]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the parent dir should be tests, not esp_radio.

defmt::info!("[STA] TEST_DONE: PASS");
}

// #[test]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please don't leave wads of uncommented code in a PR. If it's something to add later, pull it out into a gist and re-add closer to merge.

@@ -0,0 +1,198 @@
//% CHIPS(has_wifi_ble): esp32c6
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should go in a support dir, adjacent to the test dir.

Comment thread hil-test-radio/Cargo.toml
harness = false
required-features = ["esp-alloc"]

[dependencies]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think many of these deps need to be bumped to match hil-test before we merge.

Comment thread xtask/src/commands/mod.rs
pub timings: bool,

/// "hil-test" or "hil-test-radio"
pub package: Option<String>,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should leverage claps default here, instead of the unwrap_or later.

Comment thread xtask/src/firmware.rs
.apply(|meta| meta.harness_firmware = Some(meta_line.value.to_string()));
}
// Mark this artifact as support firmware (not a DUT test).
"SUPPORT_FIRMWARE" => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why two keys for the same thing?

Comment thread xtask/src/firmware.rs

fn parse_bool(value: &str) -> Result<bool> {
match value.trim().to_ascii_lowercase().as_str() {
"true" | "1" | "yes" | "y" | "on" => Ok(true),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's just support true or false please.

Comment thread xtask/src/commands/mod.rs
let no_batch = is_radio_package && matches!(action, CargoAction::Run);
let built_commands = commands.build(no_batch);

if is_radio_package && matches!(action, CargoAction::Run) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This whole section here feels quite hacky tbh - I think we should rethink this part.

I would like it so that run_radio_test just takes the name of the test binary we want to run, then behind the scenes we compile and flash the support runner, then hand back to a normal test running flow.

These new test are not any different the other hil tests, the only difference is that we have a pre step to do, which is running fw on a support device first.

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