Skip to content

Commit

Permalink
Remove direct boot support from esp-hal
Browse files Browse the repository at this point in the history
  • Loading branch information
MabezDev committed Nov 6, 2023
1 parent ff80b69 commit b48dbcf
Show file tree
Hide file tree
Showing 34 changed files with 5 additions and 1,688 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ jobs:
# for each supported image format.
- name: build esp32c2-hal (no features)
run: cd esp32c2-hal/ && cargo build --examples
- name: build esp32c2-hal (direct-boot)
run: cd esp32c2-hal/ && cargo build --examples --features=direct-boot
# Subsequent steps can just check the examples instead, as we're already
# confident that they link.
- name: check esp32c2-hal (common features)
Expand Down Expand Up @@ -183,8 +181,6 @@ jobs:
# for each supported image format.
- name: build esp32c3-hal (no features)
run: cd esp32c3-hal/ && cargo +nightly build --examples
- name: build esp32c3-hal (direct-boot)
run: cd esp32c3-hal/ && cargo +nightly build --examples --features=direct-boot
- name: build esp32c3-hal (mcu-boot)
run: cd esp32c3-hal/ && cargo +nightly build --examples --features=mcu-boot
# Subsequent steps can just check the examples instead, as we're already
Expand Down Expand Up @@ -242,8 +238,6 @@ jobs:
# for each supported image format.
- name: build esp32c6-hal (no features)
run: cd esp32c6-hal/ && cargo +nightly build --examples
- name: build esp32c6-hal (direct-boot)
run: cd esp32c6-hal/ && cargo +nightly build --examples --features=direct-boot
# Subsequent steps can just check the examples instead, as we're already
# confident that they link.
- name: check esp32c6-hal (common features)
Expand Down Expand Up @@ -314,8 +308,6 @@ jobs:
# for each supported image format.
- name: build esp32h2-hal (no features)
run: cd esp32h2-hal/ && cargo +nightly build --examples
- name: build esp32h2-hal (direct-boot)
run: cd esp32h2-hal/ && cargo +nightly build --examples --features=direct-boot
# Subsequent steps can just check the examples instead, as we're already
# confident that they link.
- name: check esp32h2-hal (common features)
Expand Down Expand Up @@ -382,7 +374,7 @@ jobs:
with:
target: riscv32imc-unknown-none-elf
toolchain: nightly
components: rust-src
components: rust-src
- uses: Swatinem/rust-cache@v2

# build the ulp-riscv-hal examples first to make sure the examples which expect
Expand Down Expand Up @@ -457,7 +449,7 @@ jobs:
with:
target: riscv32imc-unknown-none-elf
toolchain: nightly
components: rust-src
components: rust-src
- uses: Swatinem/rust-cache@v2

# build the ulp-riscv-hal examples first to make sure the examples which expect
Expand All @@ -471,8 +463,6 @@ jobs:
# for each supported image format.
- name: build esp32s3-hal (no features)
run: cd esp32s3-hal/ && cargo +esp build --examples
- name: build esp32s3-hal (direct-boot)
run: cd esp32s3-hal/ && cargo +esp build --examples --features=direct-boot
# Subsequent steps can just check the examples instead, as we're already
# confident that they link.
- name: check esp32s3-hal (common features)
Expand Down Expand Up @@ -603,7 +593,7 @@ jobs:
with:
target: riscv32imc-unknown-none-elf
toolchain: "1.67"
components: rust-src
components: rust-src
- uses: Swatinem/rust-cache@v2

# build the ulp-riscv-hal examples first to make sure the examples which expect
Expand Down
1 change: 0 additions & 1 deletion esp32c2-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ default = ["rt", "vectored", "xtal-40mhz"]
async = ["esp-hal-common/async"]
debug = ["esp-hal-common/debug"]
defmt = ["esp-hal-common/defmt", "esp-println/defmt"]
direct-boot = ["esp-hal-common/rv-init-data"]
direct-vectoring = ["esp-hal-common/direct-vectoring"]
eh1 = ["esp-hal-common/eh1"]
interrupt-preemption = ["esp-hal-common/interrupt-preemption"]
Expand Down
26 changes: 0 additions & 26 deletions esp32c2-hal/build.rs
Original file line number Diff line number Diff line change
@@ -1,31 +1,5 @@
use std::{env, error::Error, fs, path::PathBuf};

#[cfg(feature = "direct-boot")]
fn main() -> Result<(), Box<dyn Error>> {
check_features();

// Put the linker script somewhere the linker can find it
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
println!("cargo:rustc-link-search={}", out.display());

fs::copy("ld/db-esp32c2-memory.x", out.join("memory.x")).unwrap();
fs::copy("ld/db-esp32c2-link.x", out.join("esp32c2-link.x")).unwrap();
fs::copy("ld/db-riscv-link.x", out.join("riscv-link.x")).unwrap();
fs::copy("ld/db-linkall.x", out.join("linkall.x")).unwrap();

fs::copy("ld/rom-functions.x", out.join("rom-functions.x"))?;

// Only re-run the build script when memory.x is changed,
// instead of when any part of the source code changes.
println!("cargo:rerun-if-changed=ld/memory.x");

#[cfg(feature = "defmt")]
println!("cargo:rustc-link-arg=-Tdefmt.x");

Ok(())
}

#[cfg(not(feature = "direct-boot"))]
fn main() -> Result<(), Box<dyn Error>> {
check_features();

Expand Down
14 changes: 0 additions & 14 deletions esp32c2-hal/ld/db-esp32c2-link.x

This file was deleted.

36 changes: 0 additions & 36 deletions esp32c2-hal/ld/db-esp32c2-memory.x

This file was deleted.

3 changes: 0 additions & 3 deletions esp32c2-hal/ld/db-linkall.x

This file was deleted.

177 changes: 0 additions & 177 deletions esp32c2-hal/ld/db-riscv-link.x

This file was deleted.

11 changes: 0 additions & 11 deletions esp32c2-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
//! provided by [embedded-hal-async] and [embedded-io-async]
//! - `debug` - Enable debug features in the HAL (used for development)
//! - `defmt` - Enable [`defmt::Format`] on certain types
//! - `direct-boot` - Use the direct boot image format
//! - `direct-vectoring` - Enable direct vector table hooking support
//! - `eh1` - Implement the traits defined in the `1.0.0-xxx` pre-releases of
//! [embedded-hal], [embedded-hal-nb], and [embedded-io]
Expand Down Expand Up @@ -60,16 +59,6 @@
//!
//! [ESP-IDF]: https://github.com/espressif/esp-idf
//! [App Image Format]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/app_image_format.html
//!
//! #### Direct Boot
//!
//! This device additionally supports direct-boot, which allows an application
//! to be executed directly from flash, without using the second-stage
//! bootloader. For more information please see the
//! [esp32c3-direct-boot-example] in the Espressif organization on GitHub.
//!
//! [esp32c3-direct-boot-example]: https://github.com/espressif/esp32c3-direct-boot-example

#![no_std]
#![doc(html_logo_url = "https://github.com/avatars/u/46717278")]

Expand Down
1 change: 0 additions & 1 deletion esp32c3-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ default = ["rt", "vectored", "esp-hal-common/rv-zero-rtc-bss"]
async = ["esp-hal-common/async"]
debug = ["esp-hal-common/debug"]
defmt = ["esp-hal-common/defmt", "esp-println/defmt"]
direct-boot = ["esp-hal-common/rv-init-data", "esp-hal-common/rv-init-rtc-data"]
direct-vectoring = ["esp-hal-common/direct-vectoring"]
eh1 = ["esp-hal-common/eh1"]
interrupt-preemption = ["esp-hal-common/interrupt-preemption"]
Expand Down
Loading

0 comments on commit b48dbcf

Please sign in to comment.