Skip to content

Commit fb5f755

Browse files
authored
Feature/update hal 2023 12 (#71)
* update SPI call * remove dependency on atomics * fix resolution for ESP32-LcdKit
1 parent e5c82f0 commit fb5f755

File tree

31 files changed

+106
-150
lines changed

31 files changed

+106
-150
lines changed

esp-wrover-kit/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
[package]
22
name = "spooky-wrover-kit"
3-
version = "0.9.0"
3+
version = "0.10.0"
44
authors = ["Juraj Michálek <juraj.michalek@gmail.com>"]
55
edition = "2021"
66
license = "MIT"
77

88
[target.xtensa-esp32-none-elf.dependencies]
9-
xtensa-atomic-emulation-trap = "0.4.0"
10-
hal = { package = "esp32-hal", version = "0.16.0", features = ["psram-8m"] }
9+
hal = { package = "esp32-hal", version = "0.17.0", features = ["psram-8m"] }
1110
esp-backtrace = { version = "0.9.0", features = [
1211
"esp32",
1312
"panic-handler",

esp-wrover-kit/src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ fn main() -> ! {
8484

8585
let spi = Spi::new(
8686
peripherals.SPI2,
87-
lcd_sclk,
88-
lcd_mosi,
89-
lcd_miso,
90-
lcd_cs,
9187
60u32.MHz(),
9288
SpiMode::Mode0,
9389
&clocks,
94-
// );
90+
).with_pins(
91+
Some(lcd_sclk),
92+
Some(lcd_mosi),
93+
Some(lcd_miso),
94+
Some(lcd_cs),
9595
).with_dma(dma_channel.configure(
9696
false,
9797
&mut descriptors,
Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[target.riscv32imac-unknown-none-elf]
1+
[target.riscv32imc-unknown-none-elf]
22
runner = "espflash flash --monitor"
33
#runner = "probe-rs run --chip esp32c3 --format idf"
44

@@ -7,30 +7,14 @@ rustflags = [
77
# Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.)
88
# NOTE: May negatively impact performance of produced code
99
"-C", "force-frame-pointers",
10-
11-
# comment the cfgs below if you do _not_ wish to emulate atomics.
12-
# enable the atomic codegen option for RISCV
13-
"-C", "target-feature=+a",
14-
# tell the core library have atomics even though it's not specified in the target definition
15-
"--cfg", "target_has_atomic_load_store",
16-
"--cfg", 'target_has_atomic_load_store="8"',
17-
"--cfg", 'target_has_atomic_load_store="16"',
18-
"--cfg", 'target_has_atomic_load_store="32"',
19-
"--cfg", 'target_has_atomic_load_store="ptr"',
20-
# enable cas
21-
"--cfg", "target_has_atomic",
22-
"--cfg", 'target_has_atomic="8"',
23-
"--cfg", 'target_has_atomic="16"',
24-
"--cfg", 'target_has_atomic="32"',
25-
"--cfg", 'target_has_atomic="ptr"',
2610
]
2711

2812
[env]
2913
# Use clean build after changing ESP_LOGLEVEL
3014
ESP_LOGLEVEL="DEBUG"
3115

3216
[build]
33-
target = "riscv32imac-unknown-none-elf"
17+
target = "riscv32imc-unknown-none-elf"
3418

3519
[unstable]
3620
build-std = [ "core", "alloc" ]

esp32-c3-devkit-rust/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
22
name = "spooky-esp32-c3"
3-
version = "0.9.0"
3+
version = "0.10.0"
44
authors = ["Juraj Michálek <juraj.michalek@gmail.com>"]
55
edition = "2021"
66
license = "MIT"
77

8-
[target.riscv32imac-unknown-none-elf.dependencies]
9-
hal = { package = "esp32c3-hal", version = "0.13.0" }
8+
[target.riscv32imc-unknown-none-elf.dependencies]
9+
hal = { package = "esp32c3-hal", version = "0.14.0" }
1010
esp-backtrace = { version = "0.9.0", features = [
1111
"esp32c3",
1212
"panic-handler",

esp32-c3-devkit-rust/src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,14 @@ fn main() -> ! {
8080

8181
let spi = Spi::new(
8282
peripherals.SPI2,
83-
lcd_sclk,
84-
lcd_mosi,
85-
lcd_miso,
86-
lcd_cs,
8783
60u32.MHz(),
8884
SpiMode::Mode0,
8985
&clocks,
86+
).with_pins(
87+
Some(lcd_sclk),
88+
Some(lcd_mosi),
89+
Some(lcd_miso),
90+
Some(lcd_cs),
9091
).with_dma(dma_channel.configure(
9192
false,
9293
&mut descriptors,

esp32-c3-devkit-rust/wokwi.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
[wokwi]
44
version = 1
5-
#elf = "target/riscv32imac-unknown-none-elf/debug/spooky-esp32-c3"
6-
#firmware = "target/riscv32imac-unknown-none-elf/debug/spooky-esp32-c3"
5+
#elf = "target/riscv32imc-unknown-none-elf/debug/spooky-esp32-c3"
6+
#firmware = "target/riscv32imc-unknown-none-elf/debug/spooky-esp32-c3"
77
#gdbServerPort = 3333
88

9-
elf = "target/riscv32imac-unknown-none-elf/release/spooky-esp32-c3"
10-
firmware = "target/riscv32imac-unknown-none-elf/release/spooky-esp32-c3"
9+
elf = "target/riscv32imc-unknown-none-elf/release/spooky-esp32-c3"
10+
firmware = "target/riscv32imc-unknown-none-elf/release/spooky-esp32-c3"

esp32-c3-lcdkit/.cargo/config.toml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
1-
[target.riscv32imac-unknown-none-elf]
1+
[target.riscv32imc-unknown-none-elf]
22
runner = "espflash flash --monitor"
33
rustflags = [
44
"-C", "link-arg=-Tlinkall.x",
55
# Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.)
66
# NOTE: May negatively impact performance of produced code
77
"-C", "force-frame-pointers",
8-
9-
# comment the cfgs below if you do _not_ wish to emulate atomics.
10-
# enable the atomic codegen option for RISCV
11-
"-C", "target-feature=+a",
12-
# tell the core library have atomics even though it's not specified in the target definition
13-
"--cfg", "target_has_atomic_load_store",
14-
"--cfg", 'target_has_atomic_load_store="8"',
15-
"--cfg", 'target_has_atomic_load_store="16"',
16-
"--cfg", 'target_has_atomic_load_store="32"',
17-
"--cfg", 'target_has_atomic_load_store="ptr"',
18-
# enable cas
19-
"--cfg", "target_has_atomic",
20-
"--cfg", 'target_has_atomic="8"',
21-
"--cfg", 'target_has_atomic="16"',
22-
"--cfg", 'target_has_atomic="32"',
23-
"--cfg", 'target_has_atomic="ptr"',
248
]
259

2610
[build]
27-
target = "riscv32imac-unknown-none-elf"
11+
target = "riscv32imc-unknown-none-elf"
2812

2913
[unstable]
3014
build-std = [ "core", "alloc" ]

esp32-c3-lcdkit/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
22
name = "spooky-esp32-c3-lcdkit"
3-
version = "0.8.0"
3+
version = "0.10.0"
44
authors = ["Juraj Michálek <juraj.michalek@gmail.com>"]
55
edition = "2021"
66
license = "MIT"
77

8-
[target.riscv32imac-unknown-none-elf.dependencies]
9-
hal = { package = "esp32c3-hal", version = "0.13.0" }
8+
[target.riscv32imc-unknown-none-elf.dependencies]
9+
hal = { package = "esp32c3-hal", version = "0.14.0" }
1010
esp-backtrace = { version = "0.9.0", features = [
1111
"esp32c3",
1212
"panic-handler",

esp32-c3-lcdkit/src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,14 @@ fn main() -> ! {
154154

155155
let spi = Spi::new(
156156
peripherals.SPI2,
157-
lcd_sclk,
158-
lcd_mosi,
159-
lcd_miso,
160-
lcd_cs,
161157
60u32.MHz(),
162158
SpiMode::Mode0,
163159
&clocks,
160+
).with_pins(
161+
Some(lcd_sclk),
162+
Some(lcd_mosi),
163+
Some(lcd_miso),
164+
Some(lcd_cs),
164165
).with_dma(dma_channel.configure(
165166
false,
166167
&mut descriptors,

esp32-c3-lcdkit/wokwi.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
[wokwi]
44
version = 1
5-
elf = "target/riscv32imac-unknown-none-elf/release/spooky-esp32-c3-lcdkit"
6-
firmware = "target/riscv32imac-unknown-none-elf/release/spooky-esp32-c3-lcdkit"
5+
elf = "target/riscv32imc-unknown-none-elf/release/spooky-esp32-c3-lcdkit"
6+
firmware = "target/riscv32imc-unknown-none-elf/release/spooky-esp32-c3-lcdkit"

0 commit comments

Comments
 (0)