Merge branch 'main' of github.com:espressif/rust-esp32-example
This commit is contained in:
commit
60e0353c17
16
README.md
16
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
|
||||
```
|
||||
|
|
|
|||
|
|
@ -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=$<TARGET_PROPERTY:${COMPONENT_LIB},INCLUDE_DIRECTORIES>
|
||||
CARGO_CMAKE_BUILD_LINK_LIBRARIES=$<TARGET_PROPERTY:${COMPONENT_LIB},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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue