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

Adding esp32p4 support #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ esp32c2 = "build --release --features esp32c2 --target riscv32imc-unknown-none-e
esp32c3 = "build --release --features esp32c3 --target riscv32imc-unknown-none-elf"
esp32c6 = "build --release --features esp32c6 --target riscv32imac-unknown-none-elf"
esp32h2 = "build --release --features esp32h2 --target riscv32imac-unknown-none-elf"
esp32p4 = "build --release --features esp32p4 --target riscv32imafc-unknown-none-elf"

[target.'cfg(target_arch = "riscv32")']
rustflags = [
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ esp32c2 = []
esp32c3 = []
esp32c6 = []
esp32h2 = []
esp32p4 = []

[profile.release]
codegen-units = 1
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ $ target-gen elf target/riscv32imc-unknown-none-elf/release/esp-flashloader outp
| esp32c3 | Y |
| esp32c6 | Y |
| esp32h2 | Y |
| esp32p4 | Y |

## Adding new chips

1. Add a feature for the chip inside `Cargo.toml`
2. Add a build alias to `.cargo/config.toml`
3. Add the [ROM API linker script](https://github.com/search?q=repo%3Aespressif%2Fesp-idf++path%3A*rom.api.ld&type=code) inside the `ld` directory.
3. Add the [ROM linker script](https://github.com/search?q=repo%3Aespressif%2Fesp-idf++path%3A*rom.ld&type=code) inside the `ld` directory.
4. Inside the ROM API linker script, add a memory section detailing where the program will be loaded.
```c
MEMORY {
Expand Down
2 changes: 2 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ fn main() {
let chip = "esp32c6";
#[cfg(feature = "esp32h2")]
let chip = "esp32h2";
#[cfg(feature = "esp32p4")]
let chip = "esp32p4";

{
fs::copy(
Expand Down
Loading