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

add esp32c6 #123

Merged
merged 3 commits into from
Jun 11, 2023
Merged

add esp32c6 #123

merged 3 commits into from
Jun 11, 2023

Conversation

seanaye
Copy link
Contributor

@seanaye seanaye commented May 16, 2023

Adds the options for the esp32 c6 dev board in the cargo generate toml

@SergioGasquez
Copy link
Member

Hi @seanaye! Thanks for your contribution! We would also need some logic, as the new targets are not supported in some ESP-IDF versions, see https://github.com/espressif/esp-idf#esp-idf-release-and-soc-compatibility.

@sredman
Copy link
Contributor

sredman commented Jun 9, 2023

Hi @seanaye! Thanks for your contribution! We would also need some logic, as the new targets are not supported in some ESP-IDF versions, see https://github.com/espressif/esp-idf#esp-idf-release-and-soc-compatibility.

Do you have a suggestion for how you're thinking of this? I've never edited a cargo-generate template before, but from my struggles it seems that this isn't an easy thing to do.

@sredman
Copy link
Contributor

sredman commented Jun 9, 2023

Hi @seanaye! Thanks for your contribution! We would also need some logic, as the new targets are not supported in some ESP-IDF versions, see https://github.com/espressif/esp-idf#esp-idf-release-and-soc-compatibility.

Do you have a suggestion for how you're thinking of this? I've never edited a cargo-generate template before, but from my struggles it seems that this isn't an easy thing to do.

I have this, but it's not pretty, and will grow "infinitely" as more boards are released which need new SDKs.

[conditional.'defaults == false && (mcu == "esp32s6" || mcu == "esp32p4")'.placeholders.espidfver]
type = "string"
prompt = "ESP-IDF version (master = UNSTABLE)"
choices = ["master"] # Supported as of v5.1
default = "master"

[conditional.'defaults == false && (mcu == "esp32" || mcu == "esp32c3" || mcu == "esp32s2" || mcu == "esp32s3")'.placeholders.espidfver]
type = "string"
prompt = "ESP-IDF version (master = UNSTABLE)"
choices = ["v4.4", "v5.0", "master"]
default = "v4.4"

@Vollbrecht
Copy link
Collaborator

Also missing:
as long as the upstream support for the new c6 target is not integrated, the template should include the target manually as a file and invoke it in the build command.
riscv32imac-esp-espidf.json

{
    "arch": "riscv32",
    "cpu": "generic-rv32",
    "data-layout": "e-m:e-p:32:32-i64:64-n32-S128",
    "eh-frame-header": false,
    "emit-debug-gdb-scripts": false,
    "env": "newlib",
    "features": "+m,+a,+c",
    "is-builtin": false,
    "linker": "riscv32-esp-elf-gcc",
    "llvm-target": "riscv32",
    "max-atomic-width": 64,
    "os": "espidf",
    "panic-strategy": "abort",
    "relocation-model": "static",
    "target-family": [
      "unix"
    ],
    "target-pointer-width": "32",
    "vendor": "espressif"
  }

invoked with --target riscv32imac-esp-espidf.json or better add to the rustflags in config.toml so the user workflow dont change

@sredman
Copy link
Contributor

sredman commented Jun 10, 2023

Also missing: as long as the upstream support for the new c6 target is not integrated, the template should include the target manually as a file and invoke it in the build command. riscv32imac-esp-espidf.json

invoked with --target riscv32imac-esp-espidf.json or better add to the rustflags in config.toml so the user workflow dont change

Support for riscv32imac-esp-espidf was merged a couple of days ago: rust-lang/rust#111369

I have modified a project generated by this template locally, and I can confirm that the Hello World example works with a C6 board given you're using a nightly rust build. So now, ideally, the template should be made to work, and documentation updated.

@Vollbrecht
Copy link
Collaborator

Also missing: as long as the upstream support for the new c6 target is not integrated, the template should include the target manually as a file and invoke it in the build command. riscv32imac-esp-espidf.json

invoked with --target riscv32imac-esp-espidf.json or better add to the rustflags in config.toml so the user workflow dont change

Support for riscv32imac-esp-espidf was merged a couple of days ago: rust-lang/rust#111369

I have modified a project generated by this template locally, and I can confirm that the Hello World example works with a C6 board given you're using a nightly rust build. So now, ideally, the template should be made to work, and documentation updated.

🤩 nice, i missed that merge

@ivmarkov ivmarkov merged commit 49b9cf4 into esp-rs:master Jun 11, 2023
@@ -23,6 +23,24 @@ let targets = #{
gcc_target: "riscv32-esp-elf",
wokwi_board: "board-esp32-c3-devkitm-1",
},
esp32c6: #{
arch: "riscv",
rust_target: "riscv32imc-esp-espidf",
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be riscv32imac-esp-espidf (imAc) for esp32c6

Copy link
Contributor

Choose a reason for hiding this comment

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

See #124

@sredman
Copy link
Contributor

sredman commented Jun 11, 2023

Hi @seanaye! Thanks for your contribution! We would also need some logic, as the new targets are not supported in some ESP-IDF versions, see https://github.com/espressif/esp-idf#esp-idf-release-and-soc-compatibility.

I have put my proposal in #125

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.

5 participants