From 7833f609756738bf112f60e204aed314ae5f5adf Mon Sep 17 00:00:00 2001 From: JurajSadel <43887390+JurajSadel@users.noreply.github.com> Date: Fri, 1 Oct 2021 10:04:42 +0200 Subject: [PATCH 1/5] README.md: add instructions to rust-esp32-example how to produce table of footprints (#35) Co-authored-by: Juraj Sadel --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index e347af4..9b0e405 100644 --- a/README.md +++ b/README.md @@ -102,3 +102,17 @@ To exit the monitor, press `Ctrl-]`. ```sh openocd -f board/esp32-wrover-kit-3.3v.cfg ``` + +## Table of footprints + +Print the memory statistics of the project: + +```sh +idf.py size-files +``` + +or in `json` format: + +```sh +$IDF_PATH/tools/idf_size.py --files --json build/esp32-hello-rust.map +``` From da9348646106ebf815b611aa3597518c91057410 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Tue, 5 Oct 2021 13:08:31 +0200 Subject: [PATCH 2/5] cmake: add environment variables for esp-idf-sys support --- components/rustlib/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/rustlib/CMakeLists.txt b/components/rustlib/CMakeLists.txt index cc52fee..4100cff 100644 --- a/components/rustlib/CMakeLists.txt +++ b/components/rustlib/CMakeLists.txt @@ -23,6 +23,8 @@ set(RUST_INCLUDE_DIR "${RUST_TARGET_DIR}") set(RUST_INCLUDE_HEADER "${RUST_INCLUDE_DIR}/RustApi.h") set(RUST_STATIC_LIBRARY "${RUST_TARGET_DIR}/${CARGO_TARGET}/${CARGO_BUILD_TYPE}/librustlib.a") +idf_build_get_property(sdkconfig SDKCONFIG) + ExternalProject_Add( rustlib_project PREFIX "${RUST_PROJECT_DIR}" @@ -34,6 +36,10 @@ ExternalProject_Add( BUILD_COMMAND ${CMAKE_COMMAND} -E env CARGO_BUILD_TARGET=${CARGO_TARGET} CARGO_BUILD_TARGET_DIR=${RUST_TARGET_DIR} + CARGO_CMAKE_BUILD_INCLUDES=$ + CARGO_CMAKE_BUILD_LINK_LIBRARIES=$ + CARGO_CMAKE_BUILD_SDKCONFIG=${sdkconfig} + CARGO_CMAKE_BUILD_COMPILER=${CMAKE_C_COMPILER} cargo build ${CARGO_BUILD_ARG} ${CARGO_FEATURES_ARG} INSTALL_COMMAND "" BUILD_ALWAYS TRUE From bd7c44a38a346082f00cc5ffda9416c47abfe971 Mon Sep 17 00:00:00 2001 From: Rob Gilson Date: Tue, 12 Oct 2021 09:23:39 -0400 Subject: [PATCH 3/5] Updated docs to point to rust-build 1.55.0 for TCP and UDP bind fixes (#39) This fixes https://github.com/esp-rs/rust/issues/81 --- .../rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md b/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md index 2d1e73e..e254181 100644 --- a/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md +++ b/docs/rust-on-xtensa-installation-x86_64-unknown-linux-gnu.md @@ -17,7 +17,7 @@ sudo apt install gcc wget xz-utils rustup toolchain install nightly -VERSION="1.54.0-dev" +VERSION="1.55.0-dev" ARCH="x86_64-unknown-linux-gnu" RUST_DIST="rust-${VERSION}-${ARCH}" RUST_SRC_DIST="rust-src-${VERSION}" @@ -25,11 +25,11 @@ TOOLCHAIN_DESTINATION_DIR="~/.rustup/toolchains/esp" mkdir -p ${TOOLCHAIN_DESTINATION_DIR} -wget https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/${RUST_DIST}.tar.xz +wget https://github.com/esp-rs/rust-build/releases/download/v${VERSION}/${RUST_DIST}.tar.xz tar xvf ${RUST_DIST}.tar.xz ./${RUST_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs -wget https://dl.espressif.com/dl/idf-rust/dist/noarch/${RUST_SRC_DIST}.tar.xz +wget https://github.com/esp-rs/rust-build/releases/download/v${VERSION}/${RUST_SRC_DIST}.tar.xz tar xvf ${RUST_SRC_DIST}.tar.xz ./${RUST_SRC_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs From fa1fc9efacea85c9e9caf115cea7a089b2e59020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Mich=C3=A1lek?= Date: Tue, 12 Oct 2021 15:26:06 +0200 Subject: [PATCH 4/5] Update link to installation instructions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b0e405..5dbe7da 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ First, install the ESP-IDF SDK as shown in the [Get Started](https://docs.espres ### ESP32 and ESP32-S series -To support the Xtensa instruction set, build and install custom LLVM and Rust toolchains as shown in the [Rust On Xtensa](docs/rust-on-xtensa.md) guide. +Installation instruction for Xtensa architecture is in project [esp-rs/rust-build](https://github.com/esp-rs/rust-build). #### Podman/Docker image From c80b5522d0cdc616288d063fc4d9dfa4df05912d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Mich=C3=A1lek?= Date: Tue, 12 Oct 2021 15:28:08 +0200 Subject: [PATCH 5/5] Add link to installation instructions --- docs/rust-on-xtensa.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/rust-on-xtensa.md b/docs/rust-on-xtensa.md index 701c8da..4872a82 100644 --- a/docs/rust-on-xtensa.md +++ b/docs/rust-on-xtensa.md @@ -1,3 +1,7 @@ +# Deprecated + +Installation instructions moved to: [esp-rs/rust-build](https://github.com/esp-rs/rust-build) + # Rust on ESP32 and ESP32-S series (Xtensa) Following instructions are specific for ESP32 and ESP32-S series based on Xtensa architecture.