Skip to content

Latest commit

 

History

History
37 lines (30 loc) · 1.84 KB

File metadata and controls

37 lines (30 loc) · 1.84 KB

Rust example for xtensa esp32 architecture

Presented here is a straightforward UART echo Rust example utilizing Martos with UART functionality.

Within the setup function, the UART interface is initialized once on GPIO pins 16 (RX) and 17 (TX) with 19200 baud rate, 8 data bits, no parity, and 1 stop bit. Additionally, within the loop function, incoming UART data is continuously read byte-by-byte and immediately echoed back to the sender, with each processed byte being logged along with a running counter for debugging purposes.

How to install dependencies

For comprehensive guidance on installing the necessary dependencies for developing applications targeting the Xtensa ESP32 architecture, please refer to the official website. Below is an illustrative example demonstrating the installation of building toolchains on a Linux (Ubuntu/Debian):

apt-get -qq update
apt-get install -y -q build-essential curl
curl https://sh.rustup.rs -sSf | sh -s -- -y
cargo install espup
espup install

How to build the example

For a thorough guide on developing projects for the Xtensa ESP32 architecture across various operating systems, we recommend consulting the official website. Below, you will find an illustrative example showcasing the building process on a Linux system (Ubuntu/Debian):

. $HOME/export-esp.sh
cargo build

How to run the example

For detailed instructions on running projects for the Xtensa ESP32 architecture across various operating systems, we recommend consulting the official website. Below, you will find an illustrative example showcasing the running on a Linux system (Ubuntu/Debian):

cargo run