diff --git a/README.md b/README.md index e347af4..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 @@ -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 +``` 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 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 666434a..ea4c7ae 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 @@ -21,7 +21,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}" @@ -29,11 +29,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 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.