From c5817439574aadb5a411ac3cd891a0d02850cf2a Mon Sep 17 00:00:00 2001 From: heck Date: Wed, 4 Sep 2024 12:03:19 +0200 Subject: [PATCH] add functions to load different toolchains --- bash_profile.d/toolchains.sh | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 bash_profile.d/toolchains.sh diff --git a/bash_profile.d/toolchains.sh b/bash_profile.d/toolchains.sh new file mode 100644 index 0000000..59126f8 --- /dev/null +++ b/bash_profile.d/toolchains.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +function heck_toolchain_esp32() { + # esp-idf toolchain + export ESP_IDF=~/src/esp-idf/ + if [[ -e $ESP_IDF ]]; then { + source $ESP_IDF/export.sh + }; fi +} + +function heck_toolchain_avr() { + # AVR + alias repl='screen /dev/cu.usbmodemC7FD1A0181A71' + alias 32u4-console='screen /dev/cu.usbmodem11301' +} + +function heck_toolchain_arduino() { + # Arduino + export PATH=$PATH:~/src/arduino-cli +} + +function heck_toolchain_daisy() { + PATH=~/gcc-arm-none-eabi-10.3-2021.10/bin:$PATH + PATH=~/gcc-arm-none-eabi-10.3-2021.10/arm-none-eabi/bin:$PATH +} + +function heck_toolchain_fv1() { + # ch431 + export PATH="$HOME/src/ch341eeprom/:$PATH" + + # fvcompile, fvhex2bin, fvflash + function heck_fvcompile { + python -m asfv1 -b -c -s $1 $1.bin + } + + function heck_fvhex2bin { + srec_cat $1 -Intel -o $1.bin -binary + } + + #function fvflash { + # sudo ch341eeprom -v -s 24c32 -w $1 + #} + + function heck_fverase { + sudo fvflash --erase + } +} + +OCD_DIR=/opt/local/bin/openocd/ +heck_toolchain_daisy \ No newline at end of file