diff --git a/.cargo/config.toml b/.cargo/config.toml index a5e60e4a..c80b1a36 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -30,7 +30,7 @@ build-std = ["std", "panic_abort"] #ESP_IDF_VERSION = { value = "master" } # Comment out this when using the PlatformIO build (it only supports `v4.3.2`) -ESP_IDF_VERSION = { value = "release/v4.4" } +ESP_IDF_VERSION = { value = "release/v4.4" } # These configurations will pick up your custom "sdkconfig.release", "sdkconfig.debug" or "sdkconfig.defaults[.*]" files # that you might put in the root of the project diff --git a/README.md b/README.md index efeb8bce..93ca4bc6 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Highlights: - **Support for Rust STD** (threads, console, TCP/IP) safe APIs - ... upstreamed and [part of the Rust STD library](https://github.com/rust-lang/rust/pull/87666) - **New, experimental!** Support for asynchronous networking using [smol](https://github.com/smol-rs/smol) -- **New, experimental!** Support for running in the [Espressif fork of QEMU](https://github.com/espressif/qemu/wiki) +- Support for running in the [Espressif fork of QEMU](https://github.com/espressif/qemu/wiki) - Rust Safe APIs for various ESP-IDF services like WiFi, Ping, Httpd and logging - ... via [esp-idf-svc](https://crates.io/crates/esp-idf-svc) ([embedded-svc](https://crates.io/crates/embedded-svc) abstractions implemented on top of ESP-IDF) - NAPT support (Router from the SoftAP to the STA interface). **NOTE**: In production, do NOT leave the SoftAP interface open (without password)! @@ -48,10 +48,10 @@ Highlights: - Note that other RMII Ethernet boards might work just fine as well, but you'll have to change the chip from `RmiiEthDriver::IP101` to whatever chip your board is using, in the demo code itself. - (Only if you happen to have an ESP32-S2 board and can connect a LED to GPIO Pin 04 and GND): Try accessing `http://>/ulp` once build is flashed on the MCU -## QEMU (WIP, experimental) +## QEMU + - Rather than flashing on the chip, you can now run the demo in QEMU: - Clone and then build [the Espressif fork of QEMU](https://github.com/espressif/qemu) by following the [build instructions](https://github.com/espressif/qemu/wiki) - - Install the [esptool.py](https://github.com/espressif/esptool) utility - Uncomment `CONFIG_ETH_USE_OPENETH=y`, `CONFIG_MBEDTLS_HARDWARE_AES=n`, and `CONFIG_MBEDTLS_HARDWARE_SHA=n` in `sdkconfig.defaults.esp32` (it is not enabled by default because this somehow causes issues when compiling for the ESP32S2) - Build the app with `cargo build --features qemu` - NOTE: Only ESP32 is supported for the moment, so make sure that the `xtensa-esp32-espidf` target (the default one) is active in your `.cargo/config.toml` file (or override with `cargo build --features qemu --target xtensa-esp32-espidf`) diff --git a/qemu.sh b/qemu.sh index 18f15576..2aaf8c47 100755 --- a/qemu.sh +++ b/qemu.sh @@ -6,6 +6,5 @@ BUILD=debug TARGET=xtensa-esp32-espidf # Don't change this. Only the ESP32 chip is supported in QEMU for now -esptool.py --chip esp32 elf2image target/$TARGET/$BUILD/rust-esp32-std-demo -esptool.py --chip esp32 merge_bin --output target/$TARGET/$BUILD/rust-esp32-std-demo-qemu.bin --fill-flash-size 4MB 0x1000 qemu_bins/bootloader.bin 0x8000 qemu_bins/partitions.bin 0x10000 target/$TARGET/$BUILD/rust-esp32-std-demo.bin --flash_mode dio --flash_freq 40m --flash_size 4MB -$ESP_QEMU_PATH/qemu-system-xtensa -nographic -machine esp32 -nic user,model=open_eth,id=lo0,hostfwd=tcp:127.0.0.1:7888-:80 -drive file=target/$TARGET/$BUILD/rust-esp32-std-demo-qemu.bin,if=mtd,format=raw +cargo espflash save-image --features qemu --merge target/$TARGET/$BUILD/rust-esp32-std-demo.bin +$ESP_QEMU_PATH/qemu-system-xtensa -nographic -machine esp32 -nic user,model=open_eth,id=lo0,hostfwd=tcp:127.0.0.1:7888-:80 -drive file=target/$TARGET/$BUILD/rust-esp32-std-demo.bin,if=mtd,format=raw diff --git a/qemu_bins/bootloader.bin b/qemu_bins/bootloader.bin deleted file mode 100644 index d82f20fa..00000000 Binary files a/qemu_bins/bootloader.bin and /dev/null differ diff --git a/qemu_bins/partitions.bin b/qemu_bins/partitions.bin deleted file mode 100644 index 4dce1020..00000000 Binary files a/qemu_bins/partitions.bin and /dev/null differ