Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove direct boot support from esp-hal #903

Merged
merged 2 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

### Breaking

- Direct boot support has been removed (#903).

## [0.13.1] - 2023-11-02

### Fixed
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