Skip to content

Commit

Permalink
Feature/update hal 2023 12 (#71)
Browse files Browse the repository at this point in the history
* update SPI call
* remove dependency on atomics
* fix resolution for ESP32-LcdKit
  • Loading branch information
georgik authored Dec 18, 2023
1 parent e5c82f0 commit fb5f755
Show file tree
Hide file tree
Showing 31 changed files with 106 additions and 150 deletions.
5 changes: 2 additions & 3 deletions esp-wrover-kit/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[package]
name = "spooky-wrover-kit"
version = "0.9.0"
version = "0.10.0"
authors = ["Juraj Michálek <[email protected]>"]
edition = "2021"
license = "MIT"

[target.xtensa-esp32-none-elf.dependencies]
xtensa-atomic-emulation-trap = "0.4.0"
hal = { package = "esp32-hal", version = "0.16.0", features = ["psram-8m"] }
hal = { package = "esp32-hal", version = "0.17.0", features = ["psram-8m"] }
esp-backtrace = { version = "0.9.0", features = [
"esp32",
"panic-handler",
Expand Down
10 changes: 5 additions & 5 deletions esp-wrover-kit/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ fn main() -> ! {

let spi = Spi::new(
peripherals.SPI2,
lcd_sclk,
lcd_mosi,
lcd_miso,
lcd_cs,
60u32.MHz(),
SpiMode::Mode0,
&clocks,
// );
).with_pins(
Some(lcd_sclk),
Some(lcd_mosi),
Some(lcd_miso),
Some(lcd_cs),
).with_dma(dma_channel.configure(
false,
&mut descriptors,
Expand Down
20 changes: 2 additions & 18 deletions esp32-c3-devkit-rust/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[target.riscv32imac-unknown-none-elf]
[target.riscv32imc-unknown-none-elf]
runner = "espflash flash --monitor"
#runner = "probe-rs run --chip esp32c3 --format idf"

Expand All @@ -7,30 +7,14 @@ rustflags = [
# Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.)
# NOTE: May negatively impact performance of produced code
"-C", "force-frame-pointers",

# comment the cfgs below if you do _not_ wish to emulate atomics.
# enable the atomic codegen option for RISCV
"-C", "target-feature=+a",
# tell the core library have atomics even though it's not specified in the target definition
"--cfg", "target_has_atomic_load_store",
"--cfg", 'target_has_atomic_load_store="8"',
"--cfg", 'target_has_atomic_load_store="16"',
"--cfg", 'target_has_atomic_load_store="32"',
"--cfg", 'target_has_atomic_load_store="ptr"',
# enable cas
"--cfg", "target_has_atomic",
"--cfg", 'target_has_atomic="8"',
"--cfg", 'target_has_atomic="16"',
"--cfg", 'target_has_atomic="32"',
"--cfg", 'target_has_atomic="ptr"',
]

[env]
# Use clean build after changing ESP_LOGLEVEL
ESP_LOGLEVEL="DEBUG"

[build]
target = "riscv32imac-unknown-none-elf"
target = "riscv32imc-unknown-none-elf"

[unstable]
build-std = [ "core", "alloc" ]
6 changes: 3 additions & 3 deletions esp32-c3-devkit-rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "spooky-esp32-c3"
version = "0.9.0"
version = "0.10.0"
authors = ["Juraj Michálek <[email protected]>"]
edition = "2021"
license = "MIT"

[target.riscv32imac-unknown-none-elf.dependencies]
hal = { package = "esp32c3-hal", version = "0.13.0" }
[target.riscv32imc-unknown-none-elf.dependencies]
hal = { package = "esp32c3-hal", version = "0.14.0" }
esp-backtrace = { version = "0.9.0", features = [
"esp32c3",
"panic-handler",
Expand Down
9 changes: 5 additions & 4 deletions esp32-c3-devkit-rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ fn main() -> ! {

let spi = Spi::new(
peripherals.SPI2,
lcd_sclk,
lcd_mosi,
lcd_miso,
lcd_cs,
60u32.MHz(),
SpiMode::Mode0,
&clocks,
).with_pins(
Some(lcd_sclk),
Some(lcd_mosi),
Some(lcd_miso),
Some(lcd_cs),
).with_dma(dma_channel.configure(
false,
&mut descriptors,
Expand Down
8 changes: 4 additions & 4 deletions esp32-c3-devkit-rust/wokwi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

[wokwi]
version = 1
#elf = "target/riscv32imac-unknown-none-elf/debug/spooky-esp32-c3"
#firmware = "target/riscv32imac-unknown-none-elf/debug/spooky-esp32-c3"
#elf = "target/riscv32imc-unknown-none-elf/debug/spooky-esp32-c3"
#firmware = "target/riscv32imc-unknown-none-elf/debug/spooky-esp32-c3"
#gdbServerPort = 3333

elf = "target/riscv32imac-unknown-none-elf/release/spooky-esp32-c3"
firmware = "target/riscv32imac-unknown-none-elf/release/spooky-esp32-c3"
elf = "target/riscv32imc-unknown-none-elf/release/spooky-esp32-c3"
firmware = "target/riscv32imc-unknown-none-elf/release/spooky-esp32-c3"
20 changes: 2 additions & 18 deletions esp32-c3-lcdkit/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
[target.riscv32imac-unknown-none-elf]
[target.riscv32imc-unknown-none-elf]
runner = "espflash flash --monitor"
rustflags = [
"-C", "link-arg=-Tlinkall.x",
# Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.)
# NOTE: May negatively impact performance of produced code
"-C", "force-frame-pointers",

# comment the cfgs below if you do _not_ wish to emulate atomics.
# enable the atomic codegen option for RISCV
"-C", "target-feature=+a",
# tell the core library have atomics even though it's not specified in the target definition
"--cfg", "target_has_atomic_load_store",
"--cfg", 'target_has_atomic_load_store="8"',
"--cfg", 'target_has_atomic_load_store="16"',
"--cfg", 'target_has_atomic_load_store="32"',
"--cfg", 'target_has_atomic_load_store="ptr"',
# enable cas
"--cfg", "target_has_atomic",
"--cfg", 'target_has_atomic="8"',
"--cfg", 'target_has_atomic="16"',
"--cfg", 'target_has_atomic="32"',
"--cfg", 'target_has_atomic="ptr"',
]

[build]
target = "riscv32imac-unknown-none-elf"
target = "riscv32imc-unknown-none-elf"

[unstable]
build-std = [ "core", "alloc" ]
6 changes: 3 additions & 3 deletions esp32-c3-lcdkit/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "spooky-esp32-c3-lcdkit"
version = "0.8.0"
version = "0.10.0"
authors = ["Juraj Michálek <[email protected]>"]
edition = "2021"
license = "MIT"

[target.riscv32imac-unknown-none-elf.dependencies]
hal = { package = "esp32c3-hal", version = "0.13.0" }
[target.riscv32imc-unknown-none-elf.dependencies]
hal = { package = "esp32c3-hal", version = "0.14.0" }
esp-backtrace = { version = "0.9.0", features = [
"esp32c3",
"panic-handler",
Expand Down
9 changes: 5 additions & 4 deletions esp32-c3-lcdkit/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,14 @@ fn main() -> ! {

let spi = Spi::new(
peripherals.SPI2,
lcd_sclk,
lcd_mosi,
lcd_miso,
lcd_cs,
60u32.MHz(),
SpiMode::Mode0,
&clocks,
).with_pins(
Some(lcd_sclk),
Some(lcd_mosi),
Some(lcd_miso),
Some(lcd_cs),
).with_dma(dma_channel.configure(
false,
&mut descriptors,
Expand Down
4 changes: 2 additions & 2 deletions esp32-c3-lcdkit/wokwi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

[wokwi]
version = 1
elf = "target/riscv32imac-unknown-none-elf/release/spooky-esp32-c3-lcdkit"
firmware = "target/riscv32imac-unknown-none-elf/release/spooky-esp32-c3-lcdkit"
elf = "target/riscv32imc-unknown-none-elf/release/spooky-esp32-c3-lcdkit"
firmware = "target/riscv32imc-unknown-none-elf/release/spooky-esp32-c3-lcdkit"
6 changes: 3 additions & 3 deletions esp32-c6-devkit/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "spooky-esp32-c6"
version = "0.9.0"
version = "0.10.0"
authors = ["Juraj Michálek <[email protected]>"]
edition = "2021"
license = "MIT"

[target.riscv32imac-unknown-none-elf.dependencies]
hal = { package = "esp32c6-hal", version = "0.6.0" }
esp-backtrace = { version = "0.8.0", features = ["esp32c6", "panic-handler", "exception-handler", "print-uart"] }
hal = { package = "esp32c6-hal", version = "0.7.0" }
esp-backtrace = { version = "0.9.0", features = ["esp32c6", "panic-handler", "exception-handler", "print-uart"] }
esp-println = { version = "0.7.0", features = [ "esp32c6", "log" ] }

[dependencies]
Expand Down
9 changes: 5 additions & 4 deletions esp32-c6-devkit/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ fn main() -> ! {

let spi = Spi::new(
peripherals.SPI2,
lcd_sclk,
lcd_mosi,
lcd_miso,
lcd_cs,
60u32.MHz(),
SpiMode::Mode0,
&clocks
).with_pins(
Some(lcd_sclk),
Some(lcd_mosi),
Some(lcd_miso),
Some(lcd_cs),
).with_dma(dma_channel.configure(
false,
&mut descriptors,
Expand Down
16 changes: 0 additions & 16 deletions esp32-s2-kaluga/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,6 @@ runner = "espflash flash --monitor"
rustflags = [
"-C", "link-arg=-Tlinkall.x",
"-C", "link-arg=-nostartfiles",

# enable the atomic codegen option for Xtensa
"-C", "target-feature=+s32c1i",

# tell the core library have atomics even though it's not specified in the target definition
"--cfg", "target_has_atomic_load_store",
"--cfg", 'target_has_atomic_load_store="8"',
"--cfg", 'target_has_atomic_load_store="16"',
"--cfg", 'target_has_atomic_load_store="32"',
"--cfg", 'target_has_atomic_load_store="ptr"',
# enable cas
"--cfg", "target_has_atomic",
"--cfg", 'target_has_atomic="8"',
"--cfg", 'target_has_atomic="16"',
"--cfg", 'target_has_atomic="32"',
"--cfg", 'target_has_atomic="ptr"',
]

[env]
Expand Down
5 changes: 2 additions & 3 deletions esp32-s2-kaluga/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[package]
name = "spooky-s2-kaluga"
version = "0.9.0"
version = "0.10.0"
authors = ["Juraj Michálek <[email protected]>"]
edition = "2021"
license = "MIT"

[target.xtensa-esp32s2-none-elf.dependencies]
xtensa-atomic-emulation-trap = "0.4.0"
hal = { package = "esp32s2-hal", version = "0.13.0" }
hal = { package = "esp32s2-hal", version = "0.14.0" }
esp-backtrace = { version = "0.9.0", features = [
"esp32s2",
"panic-handler",
Expand Down
9 changes: 5 additions & 4 deletions esp32-s2-kaluga/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ fn main() -> ! {

let spi = Spi::new(
peripherals.SPI2,
lcd_sclk,
lcd_mosi,
lcd_miso,
lcd_cs,
60u32.MHz(),
SpiMode::Mode0,
&clocks
).with_pins(
Some(lcd_sclk),
Some(lcd_mosi),
Some(lcd_miso),
Some(lcd_cs),
).with_dma(dma_channel.configure(
false,
&mut descriptors,
Expand Down
5 changes: 2 additions & 3 deletions esp32-s3-box-lite/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[package]
name = "spooky-s3-box-lite"
version = "0.9.0"
version = "0.10.0"
authors = ["Juraj Michálek <[email protected]>"]
edition = "2021"
license = "MIT"

[target.xtensa-esp32s3-none-elf.dependencies]
xtensa-atomic-emulation-trap = "0.4.0"
hal = { package = "esp32s3-hal", version = "0.13.0" , features = ["opsram-8m"] }
hal = { package = "esp32s3-hal", version = "0.14.0" , features = ["opsram-8m"] }
esp-backtrace = { version = "0.9.0", features = [
"esp32s3",
"panic-handler",
Expand Down
11 changes: 6 additions & 5 deletions esp32-s3-box-lite/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ fn main() -> ! {

let spi = Spi::new(
peripherals.SPI2,
lcd_sclk,
lcd_mosi,
lcd_miso,
lcd_cs,
40u32.MHz(),
60u32.MHz(),
SpiMode::Mode0,
&clocks,
).with_pins(
Some(lcd_sclk),
Some(lcd_mosi),
Some(lcd_miso),
Some(lcd_cs),
).with_dma(dma_channel.configure(
false,
&mut descriptors,
Expand Down
4 changes: 2 additions & 2 deletions esp32-s3-box/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "spooky-s3-box"
version = "0.9.0"
version = "0.10.0"
authors = ["Juraj Michálek <[email protected]>"]
edition = "2021"
license = "MIT"

[target.xtensa-esp32s3-none-elf.dependencies]
xtensa-atomic-emulation-trap = "0.4.0"
hal = { package = "esp32s3-hal", version = "0.13.0" , features = ["opsram-8m"] }
hal = { package = "esp32s3-hal", version = "0.14.0" , features = ["opsram-8m"] }
esp-backtrace = { version = "0.9.0", features = [
"esp32s3",
"panic-handler",
Expand Down
9 changes: 5 additions & 4 deletions esp32-s3-box/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,14 @@ fn main() -> ! {

let spi = Spi::new(
peripherals.SPI2,
lcd_sclk,
lcd_mosi,
lcd_miso,
lcd_cs,
60u32.MHz(),
SpiMode::Mode0,
&clocks,
).with_pins(
Some(lcd_sclk),
Some(lcd_mosi),
Some(lcd_miso),
Some(lcd_cs),
)
.with_dma(dma_channel.configure(
false,
Expand Down
5 changes: 2 additions & 3 deletions esp32-s3-usb-otg/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[package]
name = "spooky-s3-usb-otg"
version = "0.9.0"
version = "0.10.0"
authors = ["Juraj Michálek <[email protected]>"]
edition = "2021"
license = "MIT"

[target.xtensa-esp32s3-none-elf.dependencies]
xtensa-atomic-emulation-trap = "0.4.0"
hal = { package = "esp32s3-hal", version = "0.13.0" }
hal = { package = "esp32s3-hal", version = "0.14.0" }
esp-backtrace = { version = "0.9.0", features = [
"esp32s3",
"panic-handler",
Expand Down
Loading

0 comments on commit fb5f755

Please sign in to comment.