Skip to content

Commit a3c3df5

Browse files
Merge #587
587: Use the official Espressif SVDs for testing, check additional chips r=burrbull a=jessebraham The CI and `rust-regress` tests for Espressif devices were quite out of date, so I've updated both to use the official SVDs and the most recent dependencies. In addition to the ESP32 the ESP32-C3/S2/S3 are now all checked. Co-authored-by: Jesse Braham <jesse@beta7.io>
2 parents 343ed53 + 269182c commit a3c3df5

File tree

4 files changed

+53
-6
lines changed

4 files changed

+53
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1616
If their indices don't start from 0 add accessors with right names.
1717
- Bring documentation on how to generate MSP430 PACs up to date (in line with
1818
[msp430_svd](https://github.com/pftbest/msp430_svd)).
19+
- Use the official SVDs from Espressif for CI and `rust-regress` tests, and
20+
additionally test the ESP32-C3, ESP32-S2, and ESP32-S3.
1921

2022
## [v0.21.0] - 2022-01-17
2123

ci/script.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,15 +608,25 @@ main() {
608608
echo '[dependencies.bare-metal]' >> $td/Cargo.toml
609609
echo 'version = "1.0.0"' >> $td/Cargo.toml
610610

611+
echo '[dependencies.riscv]' >> $td/Cargo.toml
612+
echo 'version = "0.6.0"' >> $td/Cargo.toml
613+
614+
echo '[dependencies.riscv-rt]' >> $td/Cargo.toml
615+
echo 'version = "0.8.0"' >> $td/Cargo.toml
616+
611617
echo '[dependencies.xtensa-lx]' >> $td/Cargo.toml
612618
echo 'version = "0.6.0"' >> $td/Cargo.toml
613619
echo 'features = ["esp32"]' >> $td/Cargo.toml
614620

615621
echo '[dependencies.xtensa-lx-rt]' >> $td/Cargo.toml
616-
echo 'version = "0.8.0"' >> $td/Cargo.toml
622+
echo 'version = "0.9.0"' >> $td/Cargo.toml
617623
echo 'features = ["esp32"]' >> $td/Cargo.toml
618624

619-
test_svd_for_target xtensa-lx https://raw.githubusercontent.com/esp-rs/esp32/master/svd/esp32.svd
625+
test_svd_for_target riscv https://raw.githubusercontent.com/espressif/svd/main/svd/esp32c3.svd
626+
627+
test_svd_for_target xtensa-lx https://raw.githubusercontent.com/espressif/svd/main/svd/esp32.svd
628+
test_svd_for_target xtensa-lx https://raw.githubusercontent.com/espressif/svd/main/svd/esp32s2.svd
629+
test_svd_for_target xtensa-lx https://raw.githubusercontent.com/espressif/svd/main/svd/esp32s3.svd
620630
;;
621631

622632
esac

ci/svd2rust-regress/src/svd_test.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ const CRATES_MSP430: &[&str] = &["msp430 = \"0.2.2\"", "msp430-rt = \"0.2.0\""];
1010
const CRATES_MSP430_NIGHTLY: &[&str] = &["msp430-atomic = \"0.1.2\""];
1111
const CRATES_CORTEX_M: &[&str] = &["cortex-m = \"0.7.0\"", "cortex-m-rt = \"0.6.13\""];
1212
const CRATES_RISCV: &[&str] = &["riscv = \"0.5.0\"", "riscv-rt = \"0.6.0\""];
13-
const CRATES_XTENSALX6: &[&str] = &["xtensa-lx6-rt = \"0.2.0\"", "xtensa-lx6 = \"0.1.0\""];
13+
const CRATES_XTENSALX: &[&str] = &["xtensa-lx-rt = \"0.9.0\"", "xtensa-lx = \"0.6.0\""];
1414
const CRATES_MIPS: &[&str] = &["mips-mcu = \"0.1.0\""];
1515
const PROFILE_ALL: &[&str] = &["[profile.dev]", "incremental = false"];
1616
const FEATURES_ALL: &[&str] = &["[features]"];
17+
const FEATURES_XTENSALX: &[&str] = &["default = [\"xtensa-lx/esp32\", \"xtensa-lx-rt/esp32\"]"];
1718

1819
fn path_helper(input: &[&str]) -> PathBuf {
1920
input.iter().collect()
@@ -133,7 +134,7 @@ pub fn test(
133134
RiscV => CRATES_RISCV.iter(),
134135
Mips => CRATES_MIPS.iter(),
135136
Msp430 => CRATES_MSP430.iter(),
136-
XtensaLX => CRATES_XTENSALX6.iter(),
137+
XtensaLX => CRATES_XTENSALX.iter(),
137138
})
138139
.chain(if nightly {
139140
match &t.arch {
@@ -144,7 +145,11 @@ pub fn test(
144145
[].iter()
145146
})
146147
.chain(PROFILE_ALL.iter())
147-
.chain(FEATURES_ALL.iter());
148+
.chain(FEATURES_ALL.iter())
149+
.chain(match &t.arch {
150+
XtensaLX => FEATURES_XTENSALX.iter(),
151+
_ => [].iter(),
152+
});
148153

149154
for c in crates {
150155
writeln!(file, "{}", c).chain_err(|| "Failed to append to file!")?;

ci/svd2rust-regress/src/tests.rs

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4245,7 +4245,37 @@ pub const TESTS: &[&TestCase] = &[
42454245
mfgr: Espressif,
42464246
chip: "esp32",
42474247
svd_url: Some(
4248-
"https://raw.githubusercontent.com/arjanmels/esp32/add-output-svd/svd/esp32.svd",
4248+
"https://raw.githubusercontent.com/espressif/svd/main/svd/esp32.svd",
4249+
),
4250+
should_pass: true,
4251+
run_when: Always,
4252+
},
4253+
&TestCase {
4254+
arch: XtensaLX,
4255+
mfgr: Espressif,
4256+
chip: "esp32s2",
4257+
svd_url: Some(
4258+
"https://raw.githubusercontent.com/espressif/svd/main/svd/esp32s2.svd",
4259+
),
4260+
should_pass: true,
4261+
run_when: Always,
4262+
},
4263+
&TestCase {
4264+
arch: XtensaLX,
4265+
mfgr: Espressif,
4266+
chip: "esp32s3",
4267+
svd_url: Some(
4268+
"https://raw.githubusercontent.com/espressif/svd/main/svd/esp32s3.svd",
4269+
),
4270+
should_pass: true,
4271+
run_when: Always,
4272+
},
4273+
&TestCase {
4274+
arch: RiscV,
4275+
mfgr: Espressif,
4276+
chip: "esp32c3",
4277+
svd_url: Some(
4278+
"https://raw.githubusercontent.com/espressif/svd/main/svd/esp32c3.svd",
42494279
),
42504280
should_pass: true,
42514281
run_when: Always,

0 commit comments

Comments
 (0)