esp-rs / std-training Goto Github PK
View Code? Open in Web Editor NEWEmbedded Rust on Espressif training material.
Home Page: https://esp-rs.github.io/std-training
License: Apache License 2.0
Embedded Rust on Espressif training material.
Home Page: https://esp-rs.github.io/std-training
License: Apache License 2.0
The LED doesn't light up
I have the ESP32-C3-Devkit-RUST-1 board and I'm trying to follow the Embedded Rust on Espressif book. I'm at the point where I'm trying to compile the hardware-check application, but it's failing with these errors:
<lots more output snipped>
Using custom user-supplied esp-idf repository at '/Users/gordon/esp/esp-idf' (detected from env variable `IDF_PATH`)
Using esp-idf v5.1.0 at '/Users/gordon/esp/esp-idf'
Output: "/Users/gordon/dev/esp32-rust/espressif-trainings/intro/hardware-check/target/riscv32imc-esp-espidf/release/build/esp-idf-sys-d1a5f1a58ff63106/out/bindings.rs"
Bindgen builder flags: ["/Users/gordon/.cargo/registry/src/github.com-1ecc6299db9ec823/esp-idf-sys-0.31.5/src/include/esp-idf/bindings.h", "--rust-target", "1.47", "--blocklist-function", "strtold", "--blocklist-function", "_strtold_r", "--blocklist-function", "v.*printf", "--blocklist-function", "v.*scanf", "--blocklist-function", "_v.*printf_r", "--blocklist-function", "_v.*scanf_r", "--blocklist-function", "esp_log_writev", "--no-layout-tests", "--with-derive-default", "--ctypes-prefix", "c_types", "--generate", "functions,types,vars,methods,constructors,destructors", "--use-core", "--no-rustfmt-bindings", "--", "-D__bindgen", "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"", "-DUNITY_INCLUDE_CONFIG_H", "-I/Users/gordon/esp/esp-idf/components/riscv/include", "-I/Users/gordon/dev/esp32-rust/espressif-trainings/intro/hardware-check/target/riscv32imc-esp-espidf/release/build/esp-idf-sys-d1a5f1a58ff63106/out/build/config", "-I/Users/gordon/esp/esp-idf/components/newlib/platform_include", "-I/Users/gordon/esp/esp-idf/components/freertos/FreeRTOS-Kernel/include", "-I/Users/gordon/esp/esp-idf/components/freertos/esp_additions/include/freertos", "-I/Users/gordon/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/include", "-I/Users/gordon/esp/esp-idf/components/freertos/esp_additions/include", "-I/Users/gordon/esp/esp-idf/components/esp_hw_support/include", "-I/Users/gordon/esp/esp-idf/components/esp_hw_support/include/soc", "-I/Users/gordon/esp/esp-idf/components/esp_hw_support/include/soc/esp32c3", "-I/Users/gordon/esp/esp-idf/components/esp_hw_support/port/esp32c3/.", "-I/Users/gordon/esp/esp-idf/components/esp_hw_support/port/esp32c3/private_include", "-I/Users/gordon/esp/esp-idf/components/heap/include", "-I/Users/gordon/esp/esp-idf/components/log/include", "-I/Users/gordon/esp/esp-idf/components/soc/include", "-I/Users/gordon/esp/esp-idf/components/soc/esp32c3/.", "-I/Users/gordon/esp/esp-idf/components/soc/esp32c3/include", "-I/Users/gordon/esp/esp-idf/components/hal/esp32c3/include", "-I/Users/gordon/esp/esp-idf/components/hal/include", "-I/Users/gordon/esp/esp-idf/components/hal/platform_port/include", "-I/Users/gordon/esp/esp-idf/components/esp_rom/include", "-I/Users/gordon/esp/esp-idf/components/esp_rom/include/esp32c3", "-I/Users/gordon/esp/esp-idf/components/esp_rom/esp32c3", "-I/Users/gordon/esp/esp-idf/components/esp_common/include", "-I/Users/gordon/esp/esp-idf/components/esp_system/include", "-I/Users/gordon/esp/esp-idf/components/esp_system/port/soc", "-I/Users/gordon/esp/esp-idf/components/esp_system/port/include/riscv", "-I/Users/gordon/esp/esp-idf/components/esp_system/port/include/private", "-I/Users/gordon/esp/esp-idf/components/lwip/include", "-I/Users/gordon/esp/esp-idf/components/lwip/include/apps", "-I/Users/gordon/esp/esp-idf/components/lwip/include/apps/sntp", "-I/Users/gordon/esp/esp-idf/components/lwip/lwip/src/include", "-I/Users/gordon/esp/esp-idf/components/lwip/port/esp32/include", "-I/Users/gordon/esp/esp-idf/components/lwip/port/esp32/include/arch", "-I/Users/gordon/esp/esp-idf/components/esp_ringbuf/include", "-I/Users/gordon/esp/esp-idf/components/efuse/include", "-I/Users/gordon/esp/esp-idf/components/efuse/esp32c3/include", "-I/Users/gordon/esp/esp-idf/components/driver/include", "-I/Users/gordon/esp/esp-idf/components/driver/deprecated", "-I/Users/gordon/esp/esp-idf/components/esp_pm/include", "-I/Users/gordon/esp/esp-idf/components/mbedtls/port/include", "-I/Users/gordon/esp/esp-idf/components/mbedtls/mbedtls/include", "-I/Users/gordon/esp/esp-idf/components/mbedtls/mbedtls/library", "-I/Users/gordon/esp/esp-idf/components/esp_app_format/include", "-I/Users/gordon/esp/esp-idf/components/bootloader_support/include", "-I/Users/gordon/esp/esp-idf/components/bootloader_support/bootloader_flash/include", "-I/Users/gordon/esp/esp-idf/components/app_update/include", "-I/Users/gordon/esp/esp-idf/components/spi_flash/include", "-I/Users/gordon/esp/esp-idf/components/pthread/include", "-I/Users/gordon/esp/esp-idf/components/esp_timer/include", "-I/Users/gordon/esp/esp-idf/components/app_trace/include", "-I/Users/gordon/esp/esp-idf/components/esp_event/include", "-I/Users/gordon/esp/esp-idf/components/nvs_flash/include", "-I/Users/gordon/esp/esp-idf/components/esp_phy/include", "-I/Users/gordon/esp/esp-idf/components/esp_phy/esp32c3/include", "-I/Users/gordon/esp/esp-idf/components/vfs/include", "-I/Users/gordon/esp/esp-idf/components/esp_netif/include", "-I/Users/gordon/esp/esp-idf/components/wpa_supplicant/include", "-I/Users/gordon/esp/esp-idf/components/wpa_supplicant/port/include", "-I/Users/gordon/esp/esp-idf/components/wpa_supplicant/esp_supplicant/include", "-I/Users/gordon/esp/esp-idf/components/esp_wifi/include", "-I/Users/gordon/esp/esp-idf/components/unity/include", "-I/Users/gordon/esp/esp-idf/components/unity/unity/src", "-I/Users/gordon/esp/esp-idf/components/cmock/CMock/src", "-I/Users/gordon/esp/esp-idf/components/console", "-I/Users/gordon/esp/esp-idf/components/http_parser", "-I/Users/gordon/esp/esp-idf/components/esp-tls", "-I/Users/gordon/esp/esp-idf/components/esp-tls/esp-tls-crypto", "-I/Users/gordon/esp/esp-idf/components/esp_adc/include", "-I/Users/gordon/esp/esp-idf/components/esp_adc/interface", "-I/Users/gordon/esp/esp-idf/components/esp_adc/esp32c3/include", "-I/Users/gordon/esp/esp-idf/components/esp_adc/deprecated/include", "-I/Users/gordon/esp/esp-idf/components/esp_eth/include", "-I/Users/gordon/esp/esp-idf/components/esp_gdbstub/include", "-I/Users/gordon/esp/esp-idf/components/esp_gdbstub/riscv", "-I/Users/gordon/esp/esp-idf/components/esp_gdbstub/esp32c3", "-I/Users/gordon/esp/esp-idf/components/esp_hid/include", "-I/Users/gordon/esp/esp-idf/components/tcp_transport/include", "-I/Users/gordon/esp/esp-idf/components/esp_http_client/include", "-I/Users/gordon/esp/esp-idf/components/esp_http_server/include", "-I/Users/gordon/esp/esp-idf/components/esp_https_ota/include", "-I/Users/gordon/esp/esp-idf/components/esp_lcd/include", "-I/Users/gordon/esp/esp-idf/components/esp_lcd/interface", "-I/Users/gordon/esp/esp-idf/components/protobuf-c/protobuf-c", "-I/Users/gordon/esp/esp-idf/components/protocomm/include/common", "-I/Users/gordon/esp/esp-idf/components/protocomm/include/security", "-I/Users/gordon/esp/esp-idf/components/protocomm/include/transports", "-I/Users/gordon/esp/esp-idf/components/esp_local_ctrl/include", "-I/Users/gordon/esp/esp-idf/components/esp_psram/include", "-I/Users/gordon/esp/esp-idf/components/sdmmc/include", "-I/Users/gordon/esp/esp-idf/components/esp_serial_slave_link/include", "-I/Users/gordon/esp/esp-idf/components/espcoredump/include", "-I/Users/gordon/esp/esp-idf/components/espcoredump/include/port/riscv", "-I/Users/gordon/esp/esp-idf/components/wear_levelling/include", "-I/Users/gordon/esp/esp-idf/components/fatfs/diskio", "-I/Users/gordon/esp/esp-idf/components/fatfs/vfs", "-I/Users/gordon/esp/esp-idf/components/fatfs/src", "-I/Users/gordon/esp/esp-idf/components/idf_test/include", "-I/Users/gordon/esp/esp-idf/components/idf_test/include/esp32c3", "-I/Users/gordon/esp/esp-idf/components/ieee802154/include", "-I/Users/gordon/esp/esp-idf/components/json/cJSON", "-I/Users/gordon/esp/esp-idf/components/mqtt/esp-mqtt/include", "-I/Users/gordon/esp/esp-idf/components/spiffs/include", "-I/Users/gordon/esp/esp-idf/components/wifi_provisioning/include", "--sysroot=/Users/gordon/.espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../riscv32-esp-elf", "-I/Users/gordon/.espressif/tools/riscv32-esp-elf/esp-2022r1-11.2.0/riscv32-esp-elf/bin/../riscv32-esp-elf/include", "-x", "c", "-DESP_IDF_COMP_BOOTLOADER_SUPPORT_ENABLED", "-DESP_IDF_COMP_IEEE802154_ENABLED", "-DESP_IDF_COMP_UNITY_ENABLED", "-DESP_IDF_COMP_ESP_PHY_ENABLED", "-DESP_IDF_COMP_WEAR_LEVELLING_ENABLED", "-DESP_IDF_COMP_FATFS_ENABLED", "-DESP_IDF_COMP_VFS_ENABLED", "-DESP_IDF_COMP_PERFMON_ENABLED", "-DESP_IDF_COMP_ESP_APP_FORMAT_ENABLED", "-DESP_IDF_COMP_XTENSA_ENABLED", "-DESP_IDF_COMP_ESPCOREDUMP_ENABLED", "-DESP_IDF_COMP_ESP_HW_SUPPORT_ENABLED", "-DESP_IDF_COMP_OPENTHREAD_ENABLED", "-DESP_IDF_COMP_PARTITION_TABLE_ENABLED", "-DESP_IDF_COMP_SPIFFS_ENABLED", "-DESP_IDF_COMP_HAL_ENABLED", "-DESP_IDF_COMP_ESPTOOL_PY_ENABLED", "-DESP_IDF_COMP_DRIVER_ENABLED", "-DESP_IDF_COMP_LWIP_ENABLED", "-DESP_IDF_COMP_SOC_ENABLED", "-DESP_IDF_COMP_BOOTLOADER_ENABLED", "-DESP_IDF_COMP_ESP_SYSTEM_ENABLED", "-DESP_IDF_COMP_ESP_EVENT_ENABLED", "-DESP_IDF_COMP_ESP_COMMON_ENABLED", "-DESP_IDF_COMP_PROTOBUF_C_ENABLED", "-DESP_IDF_COMP_CXX_ENABLED", "-DESP_IDF_COMP_MBEDTLS_ENABLED", "-DESP_IDF_COMP_NEWLIB_ENABLED", "-DESP_IDF_COMP_APP_UPDATE_ENABLED", "-DESP_IDF_COMP_ESP_HTTP_CLIENT_ENABLED", "-DESP_IDF_COMP_FREERTOS_ENABLED", "-DESP_IDF_COMP_TOUCH_ELEMENT_ENABLED", "-DESP_IDF_COMP_TCP_TRANSPORT_ENABLED", "-DESP_IDF_COMP_PTHREAD_ENABLED", "-DESP_IDF_COMP_ESP_PSRAM_ENABLED", "-DESP_IDF_COMP_ESP_HTTPS_OTA_ENABLED", "-DESP_IDF_COMP_HTTP_PARSER_ENABLED", "-DESP_IDF_COMP_USB_ENABLED", "-DESP_IDF_COMP_PROTOCOMM_ENABLED", "-DESP_IDF_COMP_ESP_LOCAL_CTRL_ENABLED", "-DESP_IDF_COMP_ESP_PM_ENABLED", "-DESP_IDF_COMP_JSON_ENABLED", "-DESP_IDF_COMP_HEAP_ENABLED", "-DESP_IDF_COMP_LINUX_ENABLED", "-DESP_IDF_COMP_SDMMC_ENABLED", "-DESP_IDF_COMP_ESP_ETH_ENABLED", "-DESP_IDF_COMP_WPA_SUPPLICANT_ENABLED", "-DESP_IDF_COMP_BT_ENABLED", "-DESP_IDF_COMP_ESP_RINGBUF_ENABLED", "-DESP_IDF_COMP_ESP_GDBSTUB_ENABLED", "-DESP_IDF_COMP_LOG_ENABLED", "-DESP_IDF_COMP_ESP_LCD_ENABLED", "-DESP_IDF_COMP_WIFI_PROVISIONING_ENABLED", "-DESP_IDF_COMP_IDF_TEST_ENABLED", "-DESP_IDF_COMP_CMOCK_ENABLED", "-DESP_IDF_COMP_MQTT_ENABLED", "-DESP_IDF_COMP_ESP_HID_ENABLED", "-DESP_IDF_COMP_ULP_ENABLED", "-DESP_IDF_COMP_RISCV_ENABLED", "-DESP_IDF_COMP_SPI_FLASH_ENABLED", "-DESP_IDF_COMP_ESP_SERIAL_SLAVE_LINK_ENABLED", "-DESP_IDF_COMP_ESP_HTTPS_SERVER_ENABLED", "-DESP_IDF_COMP_TINYUSB_ENABLED", "-DESP_IDF_COMP_ESP_ROM_ENABLED", "-DESP_IDF_COMP_ESP_TIMER_ENABLED", "-DESP_IDF_COMP_ESP_TLS_ENABLED", "-DESP_IDF_COMP_EFUSE_ENABLED", "-DESP_IDF_COMP_NVS_FLASH_ENABLED", "-DESP_IDF_COMP_ESP_WIFI_ENABLED", "-DESP_IDF_COMP_APP_TRACE_ENABLED", "-DESP_IDF_COMP_ESP_HTTP_SERVER_ENABLED", "-DESP_IDF_COMP_ESP_ADC_ENABLED", "-DESP_IDF_COMP_ESP_NETIF_ENABLED", "-DESP_IDF_COMP_CONSOLE_ENABLED", "-target", "riscv32"]
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:65:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:79:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:87:28: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:89:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:95:28: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:97:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:124:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:125:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:126:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:127:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:132:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:133:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:134:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:143:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:144:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:145:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:146:5: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:152:9: error: invalid input constraint 'rK' in asm
/Users/gordon/esp/esp-idf/components/riscv/include/riscv/rv_utils.h:155:9: error: invalid input constraint 'rK' in asm
fatal error: too many errors emitted, stopping now [-ferror-limit=]
I'm using macOS 10.15.7 on an Intel MacBook. I installed the software prerequisites as described in the book using rustup
and brew
. I installed esp-idf
v5.1.0 from git master and was able to successfully compile and flash the C hello_world application from esp-idf
onto my device.
error[E0063]: missing fields enable_so_linger
and linger_timeout
in initializer of httpd_config
--> C:\Users\jan.wendler.cargo\registry\src\github.com-1ecc6299db9ec823\esp-idf-svc-0.41.4\src\http\server.rs:68:14
|
68 | Self(httpd_config_t {
| ^^^^^^^^^^^^^^ missing enable_so_linger
and linger_timeout
error[E0063]: missing fields enable_so_linger
and linger_timeout
in initializer of httpd_config
--> C:\Users\jan.wendler.cargo\registry\src\github.com-1ecc6299db9ec823\esp-idf-svc-0.41.4\src\httpd.rs:394:9
|
394 | esp_idf_sys::httpd_config_t {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing enable_so_linger
and linger_timeout
error[E0308]: mismatched types
--> C:\Users\jan.wendler.cargo\registry\src\github.com-1ecc6299db9ec823\esp-idf-svc-0.41.4\src\ping.rs:37:18
|
37 | tos: conf.tos,
| ^^^^^^^^ expected i32
, found u8
Some errors have detailed explanations: E0063, E0308.
For more information about an error, try rustc --explain E0063
.
error: could not compile esp-idf-svc
due to 3 previous errors
I tried to run the hardware check with the newest commit 72a04ff
However the build fails in the very end. When searching for this problem online I found an issue discussing this problem on the esp-idf-svc repo. esp-idf-svc/issues/143 and esp-idf-svc/issues/151. Following this I tried to change the ESP-IDF version in the .cargo file to 4.4.2 but that did not solve the problem and the output is still the same.
I also tried to change the version to 4.4.3, which is the ESP-IDF version I have installed for C programming, but the result is the same.
We received some good shortcuts and tips from the ESP community, that should be included in the book.
More details in Fine tuning and wishlist
There are some references for ESP32-C3-DevKitC-02 in the repository that might need to be updated.
intro/hardware-check
READMEI am following the guide here and when trying to run the hardware-check example:
cargo espflash --release --monitor /dev/tty.usbserial-1130
I get the following error:
error: could not compile "riscv" due to 366 previous errors warning: build failed, waiting for other jobs to finish... error: build failed error: cannot find macro "llvm_asm" in this scope
error[E0635]: unknown feature "llvm_asm" --> /Users/reinhard/.cargo/registry/src/github.com-1ecc6299db9ec823/riscv-0.7.0/src/lib.rs:17:45 | 17 | #![cfg_attr(feature = "inline-asm", feature(llvm_asm))]
I have tried pinning nightly to nightly-2022-03-10 (using rustup install nightly-2022-03-10
and rustup component add rust-src --toolchain nightly-2022-03-10
) and to 2022-04-21, but both result in errors.
CI build currently fails because a dependency of espflash 1.7.0 requires a newer nightly
Allow the users to develop inside an online workspace with all the necessary dependencies
EspHttpServer.handle_get methods not found at EspHttpServer struct when i test http server demo.
build error:
Compiling http-server v0.1.0 (/home/iric/code/learn/espressif-trainings/intro/http-server)
error: could not compile `http-server` due to 3 previous errors; 2 warnings emitted
warning: unused imports: `io::Write`, `registry::Registry`
--> examples/http_server.rs:10:20
|
10 | http::server::{registry::Registry, Response},
| ^^^^^^^^^^^^^^^^^^
11 | io::Write,
| ^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
error[E0599]: no method named `handle_get` found for struct `EspHttpServer` in the current scope
--> examples/http_server.rs:31:12
|
31 | server.handle_get("/", |_request, response| {
| ^^^^^^^^^^ method not found in `EspHttpServer`
error[E0599]: no method named `handle_get` found for struct `EspHttpServer` in the current scope
--> examples/http_server.rs:41:12
|
41 | server.handle_get("/temperature", move |_request, response| {
| ^^^^^^^^^^ method not found in `EspHttpServer`
warning: unused import: `Response`
--> examples/http_server.rs:10:40
|
10 | http::server::{registry::Registry, Response},
| ^^^^^^^^
error: aborting due to 2 previous errors; 2 warnings emitted
Update the docker image to Dockerhub so we can download it instead of building it, it should result in faster buildtimes
In the example we expect 96 as device id while Rust ESP Board uses 0x68
(104 in decimal)
Hi! It would be good if examples, which are used as solutions, were also built with the CI.
The current name does provide much information about the training.
ace@UNITINU:~$ cargo install cargo-generate cargo-espflash espmonitor bindgen ldproxy
(...)
error: failed to run custom build command for `libudev-sys v0.1.4`
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Could not run `\"pkg-config\" \"--libs\" \"--cflags\" \"libudev\"`\nThe pkg-config command could not be found.\n\nMost likely, you need to install a pkg-config package for your OS.\nTry `apt install pkg-config`, or `yum install pkg-config`,\nor `pkg install pkg-config` depending on your distribution.\n\nIf you've already installed it, ensure the pkg-config command is one of the\ndirectories in the PATH environment variable.\n\nIf you did not expect this build to link to a pre-installed system library,\nthen check documentation of the libudev-sys crate for an option to\nbuild the library from source, or disable features or dependencies\nthat require pkg-config."', /home/ace/.cargo/registry/src/github.com-1ecc6299db9ec823/libudev-sys-0.1.4/build.rs:38:41
can't figure out a solution - libudev seems to be kinda broken under this particular Linux. sudo apt install pkg-config
is not enough, and trying to install libudev-dev
leads to:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libudev-dev : Depends: libudev1 (= 249.11-0ubuntu3) but 249.11-0ubuntu3.1 is to be installed
I found that I had to "downgrade" my Python version to 3.9 in order to get esp-idf-sys vX.X.X
to compile. I had previously installed Python using homebrew so downgraded Python from 3.11 using:
brew unlink [email protected]
Might be worthwhile adding a note about Python 3.11 compatibility issues in: book/src/02_2_software.md
https://github.com/esp-rs/espressif-trainings/blob/62192ea5c1de506df3960ff256db167cf3bcc945/advanced/button-interrupt/examples/solution.rs#L18 can now be replaced with SubscribedPin
from esp-idf-hal.
With #103, https://github.com/ferrous-systems/espressif-trainings/blob/main/book/src/assets/rust_board_v1_diagram.svg was added, this diagram shows v1
of the board. Would it be possible to use v1.2
https://github.com/esp-rs/esp-rust-board/blob/master/assets/rust_board_v1.2_diagram.png
in hello board it says
- press and hold boot button on the board, start flash command, release boot button after flashing process starts
Context: sometimes (see context in #109) the firmware update tool fails to put the board in firmware upload mode, for reasons currently not 100% clear. The solution is to
cargo espflash --release
) and wait for it to complete (adding --monitor
will not cause any harm but also not give any real benefits since you'll just be greeted with a waiting for download
message)espmonitor <device>
During the first training session we went through some bugs together. Mostly were related to the build, but we also had logger errors, error management errors (full list here: https://ferroussystems.hackmd.io/r16e3-HyTtSYM_vtmUjjnA)
Corresponding trouble shooting sections should be added to the book.
Allow the users to develop inside a container with all the necessary dependencies
settings
and extensions
in the new customization
propertyError: failed to compile cargo-generate v0.18.1
, intermediate artifacts can be found at /tmp/cargo-install140bht
Fix: add libssl-dev
(to apt-get) in Dockerfile.
A lot of users forget to rename the cfg.toml.example
file to cfg.toml
and update the Wifi credentials inside it. We could check if the file exists and if the values have been modified in the build.rs
and tell the user to update it if they haven't done it.
I recently purchased a couple of ESP32-Rust dev boards to check out rust on the esp32.
After following the instructions to install and setup rust and the online workbook, I get the following error when executing the command in the intro/hardware-check
directrory
cargo espflash --release --monitor /dev/ttyACM0
New version of cargo-espflash is available: v2.0.0-rc.2
Serial port: /dev/ttyACM0
Connecting...
Compiling serde v1.0.152
Compiling thiserror v1.0.38
Compiling ignore v0.4.19
Compiling strum v0.24.1
Compiling proc_macro v0.0.0 (/home/lzuccarelli/.rustup/toolchains/nightly-2022-03-10-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro)
Compiling darling_macro v0.14.2
error: could not compile `ignore` due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
error[E0658]: use of unstable library feature 'scoped_threads'
--> /home/lzuccarelli/.cargo/registry/src/github.com-1ecc6299db9ec823/ignore-0.4.19/src/walk.rs:1285:9
|
1285 | std::thread::scope(|s| {
| ^^^^^^^^^^^^^^^^^^
|
= note: see issue #93203 <https://github.com/rust-lang/rust/issues/93203> for more information
= help: add `#![feature(scoped_threads)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'scoped_threads'
--> /home/lzuccarelli/.cargo/registry/src/github.com-1ecc6299db9ec823/ignore-0.4.19/src/walk.rs:1299:32
|
1299 | handles.push(s.spawn(|| worker.run()));
| ^^^^^
|
= note: see issue #93203 <https://github.com/rust-lang/rust/issues/93203> for more information
= help: add `#![feature(scoped_threads)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'scoped_threads'
--> /home/lzuccarelli/.cargo/registry/src/github.com-1ecc6299db9ec823/ignore-0.4.19/src/walk.rs:1302:24
|
1302 | handle.join().unwrap();
| ^^^^
|
= note: see issue #93203 <https://github.com/rust-lang/rust/issues/93203> for more information
= help: add `#![feature(scoped_threads)]` to the crate attributes to enable
error: aborting due to 3 previous errors
I tried adding the #![feature(scoped_threads)]
to the lib.rs, wifi.rs and both build.rs and src/main.rs in the intro/hardware-check directory.
The rustc version is
rustc --version
rustc 1.61.0-nightly (458262b13 2022-03-09)
Any assistance on how to fix this will be appreciated
After following the instructions in the book, I tried building the Hello Board project with cargo build --target riscv32imc-esp-espidf
.
The build then fails with many errors of the following type:
Compiling embedded-io v0.3.1
error[E0658]: generic associated types are unstable
--> /home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-io-0.3.1/src/asynch.rs:17:5
|
17 | / type ReadFuture<'a>: Future<Output = Result<usize, Self::Error>>
18 | | where
19 | | Self: 'a;
| |_________________^
|
= note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
= help: add `#![feature(generic_associated_types)]` to the crate attributes to enable
My rust toolchain is up to date and the specific version requested in the book is available:
$ rustup toolchain list
stable-x86_64-unknown-linux-gnu (default)
nightly-2022-03-10-x86_64-unknown-linux-gnu (override)
There are several crates mentioned in Espressif toolchain section that can be removed as they are not necessary. Currently, we only need cargo-espflash
and ldproxy
PS D:\intro\http-client> cp .\examples\https_client.rs .\src\main.rs
PS D:\intro\http-client> cargo espflash --release --monitor COM5
New version of cargo-espflash is available: v2.0.0-rc.1
Serial port: COM5
Connecting...
Compiling http-client v0.1.0 (D:\intro\http-client)
error: could not compile `http-client` due to 2 previous errors
error[E0425]: cannot find value `esp_crt_bundle_attach` in crate `esp_idf_sys`
--> src\main.rs:40:46
|
40 | crt_bundle_attach: Some(esp_idf_sys::esp_crt_bundle_attach),
| ^^^^^^^^^^^^^^^^^^^^^ not found in `esp_idf_sys`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0425`.
PS D:\intro\http-client>
ace@UNITINU:~/espressif-trainings/intro/hardware-check$ cargo build --release
(...)
error: failed to run custom build command for esp-idf-sys v0.30.4
(...)
/usr/bin/python3: No module named pip
partial solution: sudo apt install python-pip3
however, then this happens (same error occurs when running in Docker with the supplied docker config instead):
esptool.py v3.3.2-dev Creating esp32c3 image... Merged 1 ELF section Successfully created esp32c3 image. Generated /home/ace/espressif-trainings/intro/hardware-check/target/riscv32imc-esp-espidf/release/build/esp-idf-sys-4ad62538e5233c10/out/build/libespidf.bin [995/995] cd /home/ace/espressif-trainings/intro/hardware-check/target/riscv32imc-esp-espidf/release/build/esp-idf-sys-4ad62538e5233c10/out/build/esp-idf/esptool_py && python /home/ace/.espressif/esp-idf-release/v4.4/components/partition_table/check_sizes.py --offset 0x8000 partition --type app /home/ace/espressif-trainings/intro/hardware-check/target/riscv32imc-esp-espidf/release/build/esp-idf-sys-4ad62538e5233c10/out/build/partition_table/partition-table.bin /home/ace/espressif-trainings/intro/hardware-check/target/riscv32imc-esp-espidf/release/build/esp-idf-sys-4ad62538e5233c10/out/build/libespidf.bin libespidf.bin binary size 0x22130 bytes. Smallest app partition is 0x100000 bytes. 0xdded0 bytes (87%) free.
cargo:root=/home/ace/espressif-trainings/intro/hardware-check/target/riscv32imc-esp-espidf/release/build/esp-idf-sys-4ad62538e5233c10/out
cargo:rerun-if-changed=/home/ace/.cargo/registry/src/github.com-1ecc6299db9ec823/esp-idf-sys-0.30.4/src/include/esp-idf/bindings.h
--- stderr fatal: No names found, cannot describe anything. fatal: No names found, cannot describe anything.
WARNING: The script virtualenv is installed in '/home/ace/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
fatal: No names found, cannot describe anything. fatal: No names found, cannot describe anything. fatal: No names found, cannot describe anything. Output: "/home/ace/espressif-trainings/intro/hardware-check/target/riscv32imc-esp-espidf/release/build/esp-idf-sys-4ad62538e5233c10/out/bindings.rs"
Bindgen builder flags: ["/home/ace/.cargo/registry/src/github.com-1ecc6299db9ec823/esp-idf-sys-0.30.4/src/include/esp-idf/bindings.h", "--rust-target", "1.47", "--blocklist-function", "strtold", "--blocklist-function", "_strtold_r", "--blocklist-function", "v.*printf", "--blocklist-function", "v.*scanf", "--blocklist-function", "_v.*printf_r", "--blocklist-function", "_v.*scanf_r", "--blocklist-function", "esp_log_writev", "--no-layout-tests", "--with-derive-default", "--ctypes-prefix", "c_types", "--generate", "functions,types,vars,methods,constructors,destructors",
"--use-core", "--no-rustfmt-bindings", "--", "-D__bindgen", "-DHAVE_CONFIG_H", "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"", "-DUNITY_INCLUDE_CONFIG_H", "-DWITH_POSIX", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_ringbuf/include", "-I/home/ace/espressif-trainings/intro/hardware-check/target/riscv32imc-esp-espidf/release/build/esp-idf-sys-4ad62538e5233c10/out/build/config", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/newlib/platform_include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/freertos/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/freertos/include/esp_additions/freertos", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/freertos/port/riscv/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/freertos/include/esp_additions", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_hw_support/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_hw_support/include/soc", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_hw_support/include/soc/esp32c3", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_hw_support/port/esp32c3/.", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_hw_support/port/esp32c3/private_include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/heap/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/log/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/lwip/include/apps", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/lwip/include/apps/sntp", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/lwip/lwip/src/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/lwip/port/esp32/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/lwip/port/esp32/include/arch", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/soc/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/soc/esp32c3/.", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/soc/esp32c3/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/hal/esp32c3/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/hal/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/hal/platform_port/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_rom/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_rom/include/esp32c3", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_rom/esp32c3", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_common/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_system/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_system/port/soc", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_system/port/include/riscv", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_system/port/public_compat", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/riscv/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/driver/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/driver/esp32c3/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_pm/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/efuse/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/efuse/esp32c3/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/vfs/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_wifi/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_event/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_netif/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_eth/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/tcpip_adapter/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_phy/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_phy/esp32c3/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_ipc/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/app_trace/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_timer/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/mbedtls/port/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/mbedtls/mbedtls/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/app_update/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/spi_flash/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/bootloader_support/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/nvs_flash/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/pthread/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_gdbstub/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_gdbstub/riscv", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_gdbstub/esp32c3", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/espcoredump/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/espcoredump/include/port/riscv", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/wpa_supplicant/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/wpa_supplicant/port/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/wpa_supplicant/esp_supplicant/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/ieee802154/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/console", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/asio/asio/asio/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/asio/port/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/cbor/port/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/unity/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/unity/unity/src", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/cmock/CMock/src", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/coap/port/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/coap/libcoap/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/nghttp/port/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/nghttp/nghttp2/lib/includes", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp-tls", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp-tls/esp-tls-crypto", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_adc_cal/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_hid/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/tcp_transport/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_http_client/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_http_server/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_https_ota/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_lcd/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_lcd/interface", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/protobuf-c/protobuf-c", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/protocomm/include/common", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/protocomm/include/security", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/protocomm/include/transports", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/mdns/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_local_ctrl/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/sdmmc/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_serial_slave_link/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/esp_websocket_client/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/expat/expat/expat/lib", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/expat/port/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/wear_levelling/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/fatfs/diskio", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/fatfs/vfs", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/fatfs/src", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/freemodbus/common/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/idf_test/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/idf_test/include/esp32c3", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/jsmn/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/json/cJSON", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/libsodium/libsodium/src/libsodium/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/libsodium/port_include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/mqtt/esp-mqtt/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/openssl/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/spiffs/include", "-I/home/ace/.espressif/esp-idf-release/v4.4/components/wifi_provisioning/include", "--sysroot=/home/ace/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/../riscv32-esp-elf", "-I/home/ace/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/../riscv32-esp-elf/include", "-x", "c", "-DESP_IDF_COMP_PTHREAD_ENABLED", "-DESP_IDF_COMP_NVS_FLASH_ENABLED", "-DESP_IDF_COMP_ESP_TLS_ENABLED", "-DESP_IDF_COMP_ESP_HTTP_CLIENT_ENABLED", "-DESP_IDF_COMP_ESP_HTTP_SERVER_ENABLED", "-DESP_IDF_COMP_ESPCOREDUMP_ENABLED", "-DESP_IDF_COMP_APP_UPDATE_ENABLED", "-DESP_IDF_COMP_ESP_SERIAL_SLAVE_LINK_ENABLED", "-DESP_IDF_COMP_SPI_FLASH_ENABLED", "-DESP_IDF_COMP_ESP_ADC_CAL_ENABLED", "-DESP_IDF_COMP_MQTT_ENABLED", "-DESP_IDF_COMP_VFS_ENABLED", "-DESP_IDF_COMP_SPIFFS_ENABLED", "-DESP_IDF_COMP_FATFS_ENABLED", "-DESP_IDF_COMP_SOC_ENABLED", "-target", "riscv32"]
/home/ace/.espressif/esp-idf-release/v4.4/components/freertos/port/riscv/include/freertos/portmacro.h:439:20: warning: section does not match previous declaration [-Wsection]
/home/ace/.espressif/esp-idf-release/v4.4/components/freertos/port/riscv/include/freertos/portmacro.h:271:20: note: previous attribute is here
/home/ace/.cargo/registry/src/github.com-1ecc6299db9ec823/esp-idf-sys-0.30.4/src/include/esp-idf/bindings.h:69:10: fatal error: 'esp_crt_bundle.h' file not found
/home/ace/.espressif/esp-idf-release/v4.4/components/freertos/port/riscv/include/freertos/portmacro.h:439:20: warning: section does not match previous declaration [-Wsection], err: false
/home/ace/.cargo/registry/src/github.com-1ecc6299db9ec823/esp-idf-sys-0.30.4/src/include/esp-idf/bindings.h:69:10: fatal error: 'esp_crt_bundle.h' file not found, err: true
Error: Failed to generate bindings
We should check the link books in our CI. Example: https://github.com/esp-rs/book/blob/main/.github/workflows/ci.yml#L54
Integrate the devcontainers with Wokwi simulator
Add webflash support so users that use devcontainers can flash the resulting binaries
I suggest adding a hint somewhere in the book that in this environment, threads have very limited stack space. So you may often encounter stack overflow problems. The stack size can be specified in this way:
thread::Builder::new().stack_size(4096).spawn(|| {
// do something
})?;
Hi,
I just noticed that using an SSID that exceeds 32 characters leads to a panic. I had one that has 33 characters. So magically this works with the C implementation I assume it only uses the first 32 characters or some null termination magic. I actually just noticed that the 2.4Ghz SSID exceeds 32 characters, Android, RPI ... happily accepted that.
WiFi router: Ubiquiti U6-LR now running the latest firmware 6.0.15.
Chip type: ESP32-C3 (revision 3)
Crystal frequency: 40MHz
Flash size: 4MB
Features: WiFi
MAC address: 7c:df:a1:da:76:5c
[00:00:01] ######################################## 12/12 segment 0x0
[00:00:00] ######################################## 1/1 segment 0x8000
[00:00:44] ######################################## 411/411 segment 0x10000
Flashing has completed!
Commands:
CTRL+R Reset chip
CTRL+C Exit
�
�ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x172c
load:0x403ce000 [_coredump_iram_start:??:??],len:0x928
load:0x403d0000 [_coredump_iram_start:??:??],len:0x2ce0
entry 0x403ce000 [_coredump_iram_start:??:??]
I (30) boot: ESP-IDF v4.4-dev-2825-gb63ec47238 2nd stage bootloader
I (30) boot: compile time 12:10:40
I (30) boot: chip revision: 3
I (33) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (43) boot.esp32c3: SPI Speed : 80MHz
I (45) boot.esp32c3: SPI Mode : DIO
I (50) boot.esp32c3: SPI Flash Size : 4MB
I (55) boot: Enabling RNG early entropy source...
I (60) boot: Partition Table:
I (64) boot: ## Label Usage Type ST Offset Length
I (71) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (78) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (86) boot: 2 factory factory app 00 00 00010000 003f0000
I (93) boot: End of partition table
I (98) boot_comm: chip revision: 3, min. application chip revision: 0
I (105) esp_image: segment 0: paddr=00010020 vaddr=3c090020 size=18428h ( 99368) map
I (128) esp_image: segment 1: paddr=00028450 vaddr=3fc8ea00 size=02cb8h ( 11448) load
I (131) esp_image: segment 2: paddr=0002b110 vaddr=40380000 size=04f08h ( 20232) load
I (138) esp_image: segment 3: paddr=00030020 vaddr=42000020 size=82f18h (536344) map
I (223) esp_image: segment 4: paddr=000b2f40 vaddr=40384f08 size=099bch ( 39356) load
I (230) esp_image: segment 5: paddr=000bc904 vaddr=50000010 size=00010h ( 16) load
I (235) boot: Loaded app from partition at offset 0x10000
I (235) boot: Disabling RNG early entropy source...
I (251) cpu_start: Pro cpu up.
I (259) cpu_start: Pro cpu start user code
I (260) cpu_start: cpu freq: 160000000
I (260) cpu_start: Application information:
I (262) cpu_start: Project name: libespidf
I (267) cpu_start: App version: 1
I (272) cpu_start: Compile time: May 5 2022 20:25:58
I (278) cpu_start: ELF file SHA256: 0000000000000000...
I (284) cpu_start: ESP-IDF: 36823b4
I (289) heap_init: Initializing. RAM available for dynamic allocation:
I (296) heap_init: At 3FC956B0 len 0002A950 (170 KiB): DRAM
I (302) heap_init: At 3FCC0000 len 0001F060 (124 KiB): STACK/DRAM
I (309) heap_init: At 50000020 len 00001FE0 (7 KiB): RTCRAM
I (316) spi_flash: detected chip: generic
I (320) spi_flash: flash io: dio
I (324) sleep: Configure to isolate all GPIO pins in sleep state
I (331) sleep: Enable automatic switching of GPIO sleep configuration
I (338) cpu_start: Starting scheduler.
Hello, world!
I (344) pp: pp rom version: 9387209
I (344) net80211: net80211 rom version: 9387209
I (364) wifi:wifi driver task: 3fc9f7d4, prio:23, stack:6656, core=0
I (364) system_api: Base MAC address is not set
I (364) system_api: read default base MAC address from EFUSE
I (374) wifi:wifi firmware version: 63017e0
I (374) wifi:wifi certification version: v7.0
I (374) wifi:config NVS flash: enabled
I (374) wifi:config nano formating: disabled
I (384) wifi:Init data frame dynamic rx buffer num: 32
I (384) wifi:Init management frame dynamic rx buffer num: 32
I (394) wifi:Init management short buffer num: 32
I (394) wifi:Init dynamic tx buffer num: 32
I (404) wifi:Init static tx FG buffer num: 2
I (404) wifi:Init static rx buffer size: 1600
I (414) wifi:Init static rx buffer num: 10
I (414) wifi:Init dynamic rx buffer num: 32
I (414) wifi_init: rx ba win: 6
I (424) wifi_init: tcpip mbox: 32
I (424) wifi_init: udp mbox: 6
I (424) wifi_init: tcp mbox: 6
I (434) wifi_init: tcp tx win: 5744
I (434) wifi_init: tcp rx win: 5744
I (444) wifi_init: tcp mss: 1440
I (444) wifi_init: WiFi IRAM OP enabled
I (454) wifi_init: WiFi RX IRAM OP enabled
I (454) phy_init: phy_version 909,aa05aec,Apr 16 2022,13:42:08
I (544) wifi:mode : sta (7c:df:a1:da:76:5c)
I (544) wifi:enable tsf
I (2644) wifi:flush txq
I (2644) wifi:stop sw txq
I (2644) wifi:lmac stop hw txq
Guru Meditation Error: Core 0 panic'ed (Illegal instruction). Exception was unhandled.
Core 0 register dump:
MEPC : 0x420043d0 [_ZN11esp_idf_svc7private4cstr7set_str17h93acd3ac098d6da3E.llvm.10345667518865182924:??:??] RA : 0x42004216 [_ZN11esp_idf_svc4wifi186_$LT$impl$u20$core..convert..From$LT$$RF$embedded_svc..wifi..ClientConfiguration$GT$$u20$for$u20$esp_idf_svc..private..common..Newtype$LT$esp_idf_sys..bindings..wifi_sta_config_t$GT$$GT$4from17h094a9f9fa8246963E:??:??] SP : 0x3fc98e00 GP : 0x3fc8f200
TP : 0x3fc81974 T0 : 0x4005890e [chip726_phyrom_version_num:??:??] T1 : 0x0000000f T2 : 0x3fca5244
....
If you need the entire trace let me know. I'm not sure whether there are credentials in the remaining dump. Anyway I think this is really an edge case and I can not even reproduce it anymore since after upgrading my router firmware I can no longer set the SSID beyond 32 characters. So mostly leaving it here so people who encounter this can find this. Fix was basically changing the SSID to < 32 characters.
Btw. I also updated all dependencies and the one of esp32-c3-dkc02-bsc when I ran into the issue. So basically this still exists in the latest published versions. This issue also persists when changing to the pio feature.
Cargo.toml hwcheck after dependency update:
[features]
default = ["native"]
native = ["esp-idf-sys/native"]
[dependencies]
esp-idf-sys = { version = "=0.31.5", features = ["binstart"] }
esp32-c3-dkc02-bsc = { path = "../../common/lib/esp32-c3-dkc02-bsc" }
log = "0.4"
anyhow = "1"
toml-cfg = "0.1"
[build-dependencies]
embuild = "0.29"
anyhow = "1"
[patch.crates-io]
riscv = { git = "https://github.com/rust-embedded/riscv", version = "0.8"}
ESP-IDF environment is not being activated properly since some dependencies are not updated enough to detect the activated environment. Since the installed esp-idf was not being detected, during the first build it would download and install esp-idf, hence the long building times.
For title.
in hello board it says
- press and hold boot button on the board, start flash command, release boot button after flashing process starts
this is incomplete and holds the user hostage for an unnecessarily long amount of time.
A little backstory:
What is very likely the case here is that the ESP Rust Board - unlike the dev kit boards - lacks the required external components to put the mcu in DFU/bootloader mode (I see no dedicated chip to assert DTR
and RTS
).
The solution is to do this manually by
furthermore (this is the "incomplete" part), unfortunately this means that cargo espflash --monitor
will not ever work on these boards, since after flashing has completed you
4. have to reset the board once more to exit DFU mode and run the newly uploaded firmware
5. start espmonitor
after said reset has been triggered.
- use a hub.
I'm not aware of a situation where this would help. Did you maybe specifically mean "use a powered hub"? (although I'd say: if that helps your broken USB setup isn't "unpowered hub", it's "running outside of spec")
In the latest release of esp-idf-hal
, esp-idf-sys
and other esp-idf-* crates there have been some major changes, hence if a user follows the training and then tries to copy-paste parts of the code with the esp-idf-template
it probably won't work as there were several breaking changes.
Try to reproduce all the exercises in wokwi.com, so user can follow the whole training without requiring hw and to setup the environment.
rust-esp32c3-training
builder: wokwi/wokwi-builders#29Created Wokwi Rust custom chips for imc42670p and shtc3, so they can be used for the training.
Maybe we should include the Cargo.toml
file in the projects so users know which crates are being used and can browse the documentation:
02_4_hello_board.md Line 71 suggests the use of espmonitor
to monitor your Rust board. Using the software install instructions in this repo, this command did not work out of the box. I had to run cargo install espmonitor
and then use the command as follows:
$ cargo espmonitor -c esp32c3 /dev/ttyACM0
I'm not certain if this is an issue with my install, or simply an oversight. If it's an oversight, I can try to submit a pull request with a more complete software download list, and a corrected command invocation.
I'm running into lots of build issues following along on my macos laptop, so I decided to try out the provided Docker container. My first attempted build of the http_client example in the container failed too, all I did was clone this repository and run cd espressif-trainings/intro/http-client && cargo build --release --example http_client
error[E0658]: use of unstable library feature 'scoped_threads'
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/ignore-0.4.20/src/walk.rs:1285:9
|
1285 | std::thread::scope(|s| {
| ^^^^^^^^^^^^^^^^^^
|
= note: see issue #93203 <https://github.com/rust-lang/rust/issues/93203> for more information
= help: add `#![feature(scoped_threads)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'scoped_threads'
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/ignore-0.4.20/src/walk.rs:1299:32
|
1299 | handles.push(s.spawn(|| worker.run()));
| ^^^^^
|
= note: see issue #93203 <https://github.com/rust-lang/rust/issues/93203> for more information
= help: add `#![feature(scoped_threads)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'scoped_threads'
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/ignore-0.4.20/src/walk.rs:1302:24
|
1302 | handle.join().unwrap();
| ^^^^
|
= note: see issue #93203 <https://github.com/rust-lang/rust/issues/93203> for more information
= help: add `#![feature(scoped_threads)]` to the crate attributes to enable
The examples should also support connecting to wifi networks with no authentication (AuthMethod::None
).
Fix the intro/http-client/example/https_client
example and include it in the CI tests, before building it, skdconfig.defautlts
needs to be modified: https://esp-rs.github.io/espressif-trainings/03_3_3_https_client.html#https-client
--target
is not required as its already specified in the config.toml
serial-monitor
subcommand of cargo-espflash
cargo-espflash
command, it will print a list of the available serial devices so the user can choose.espmonitor
is not being installed but its mentioned. espmonitor
is no longer required.espflash
and cargo-espflash
v2.0
soon. With this new release, subcommands will change a bit, so it may be worth waiting for the new release and update all the flashing/monitoring commands at once.espflash
/cargo-espflash
. It may help add a note so users are using a recent version of it, or having a fixed version on the book so we make sure they all install the same version.cargo run
to flash and monitor. by adding the following to .cargo/config.toml
:[target.riscv32imc-esp-espidf]
runner = "espflash --monitor"
espflash
- Project name: hello-world
- DevContainer Support: false
- STD support: true
- MCU: esp32c3
- ESP-IDF version: 4.4
http_serve
should be http_server
):cargo espflash --release --example **http_serve** --monitor $SERIALDEVICE
*
are building fine but not running properly, they need to be reviewed.02_1_hardware.md is inconsistent and a bit confusing.
I purchased the Rust development board from Mouser, which:
In this instance I can understand why it would be undesirable to present the learner with a minimum of options, but I think that it would be better to provide a clear fork showing the expected behavior for the ESP32-C3-DevKitC-02 and the ESP32-C3-DevKit-RUST-1. I also think pictures might be helpful. I can provide an image of both boards, unless image integration is frowned on in this work.
when trying to run the http-client example
cargo doc --open
I got a multitude of errors about the llvm_asm! macro
error: cannot find macro `llvm_asm` in this scope
I was able to resolve it by downloading the esp-pacs repo and patch esp32c3 in common/lib/esp32-c3-dkc01-bsc/Cargo.toml
[dependencies]
esp32c3 = "=0.4.0"
...
[patch.crates.io]
esp32c3 = { path = "/Users/lmckechnie/esp/esp-pacs/esp32c3" }
This updated the riscv dependency to 0.8.0. I also added the riscv 0.8.0 dependency to intro/http-client/exercise/Cargo.toml
Evaluate adding dependabot, at least to update CI actions
I get the following errors from rust-analyzer (and the analyzer does not work):
[ERROR rust_analyzer::config] failed to find any projects in [AbsPathBuf("/workspace")]
[ERROR rust_analyzer::main_loop] FetchWorkspaceError:
rust-analyzer failed to discover workspace
I've also noticed that "remoteUser" changed in devcontainer.json
from root
to esp
. With this change the container won't start.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.