From 572756c6aafd5e7c41e009508da63997f175b831 Mon Sep 17 00:00:00 2001 From: puckoprutt Date: Wed, 15 Jul 2026 02:02:20 +0200 Subject: [PATCH] small tweeks --- bashrc | 10 ++++++++++ cargo.sh | 5 +++++ probe.sh | 8 ++++++++ rustup.sh | 18 ++++++++++++++---- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/bashrc b/bashrc index de558b4..7ad8d67 100644 --- a/bashrc +++ b/bashrc @@ -58,3 +58,13 @@ function rust_disassemble() { cargo objdump --bin $1 -- --disassemble --no-show-raw-insn --print-imm-hex fi } + +function rust_print_size() { + elif [ -z "$1" ]; then + cargo nm --release -- --print-size --size-sort + cargo size --release + else + cargo nm -- --print-size --size-sort lists symbol sorted by size + cargo size + fi +} diff --git a/cargo.sh b/cargo.sh index 3cef812..c00b3a1 100644 --- a/cargo.sh +++ b/cargo.sh @@ -1,5 +1,10 @@ +echo "cargo version" +cargo --version + cargo install cargo-binutils cargo install cargo-generate +cargo install espflash --locked +cargo install esp-generate --locked cargo install flip-link cargo install qemu-run cargo install svd2rust diff --git a/probe.sh b/probe.sh index e30d902..cb16407 100644 --- a/probe.sh +++ b/probe.sh @@ -7,5 +7,13 @@ function check_if_installed() { fi } +function install_udev_rules() { + if [[ $EUID -eq 0 ]]; then + sudo probe-rs complete install-udev-rules + else + echo "could not install udev-rules, needs to be root." + fi +} check_if_installed +install_udev_rules diff --git a/rustup.sh b/rustup.sh index d1cddc5..6984bac 100644 --- a/rustup.sh +++ b/rustup.sh @@ -17,8 +17,18 @@ rustup update echo "installing llvm-tools.." rustup component add llvm-tools rustup component add rustfmt -#rustup target add thumbv6m-none-eabi # Cortex-M0 and Cortex-M0+ -#rustup target add thumbv7m-none-eabi # Cortex-M3 -#rustup target add thumbv7em-none-eabi # Cortex-M4 and Cortex-M7 (no FPU) -#rustup target add thumbv7em-none-eabihf # Cortex-M4F and Cortex-M7F (with FPU) +rustup default stable +rustup update stable +echo "adding some popular toolchains.." +rustup target add thumbv6m-none-eabi # Cortex-M0 and Cortex-M0+ +rustup target add thumbv7m-none-eabi # Cortex-M3 +rustup target add thumbv7em-none-eabi # Cortex-M4 and Cortex-M7 (no FPU) +rustup target add thumbv7em-none-eabihf # Cortex-M4F and Cortex-M7F (with FPU) +rustup target add thumbv8m.main-none-eabi # Cortex-M33 and M55 (no FPU) +rustup target add thumbv8m.main-none-eabihf # Cortex-M33 and M55 (with FPU) +rustup target add riscv32imac-unknown-none-elf # RISC-V 32-bit +echo "rustup rustc and cargo is ready to go!" +echo "rustc version" +rustc --version +rustup show