From d124d60577798d7dd7c17d47ca411248cfa1d63d Mon Sep 17 00:00:00 2001 From: bunnie Date: Sat, 22 Nov 2025 13:43:41 +0800 Subject: [PATCH] ensure that baremetal on baosec sets up USB pin; pass through redteam flag --- baremetal/Cargo.toml | 3 ++- baremetal/src/platform/bao1x/bao1x.rs | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/baremetal/Cargo.toml b/baremetal/Cargo.toml index 7458496e5..5b741d971 100644 --- a/baremetal/Cargo.toml +++ b/baremetal/Cargo.toml @@ -79,6 +79,7 @@ dabao-selftest = [ ] ci-security = [] spim-tests = [] +redteam = ["bao1x-hal/redteam"] verilator-only = [] -default = ["bao1x-usb", "ci-security"] +default = ["bao1x-usb"] diff --git a/baremetal/src/platform/bao1x/bao1x.rs b/baremetal/src/platform/bao1x/bao1x.rs index 824b094ba..f44209d7f 100644 --- a/baremetal/src/platform/bao1x/bao1x.rs +++ b/baremetal/src/platform/bao1x/bao1x.rs @@ -99,6 +99,9 @@ pub fn early_init() { bao1x_hal::board::setup_kb_pins(&iox); bao1x_hal::board::setup_oled_power_pin(&iox); bao1x_hal::board::setup_trng_power_pin(&iox); + // make sure SE0 is cleared + let (port, pin) = bao1x_hal::board::setup_usb_pins(&iox); + iox.set_gpio_pin(port, pin, IoxValue::High); } #[cfg(feature = "board-dabao")] {