Skip to content

Instantly share code, notes, and snippets.

@fredericmorin
Last active August 29, 2019 15:25
Show Gist options
  • Save fredericmorin/4f2a454b66e90f324e3337d1ac0b1180 to your computer and use it in GitHub Desktop.
Save fredericmorin/4f2a454b66e90f324e3337d1ac0b1180 to your computer and use it in GitHub Desktop.
pascallanger/DIY-Multiprotocol-TX-Module dev environment
#!/bin/bash
mkdir -p ~/multimodule-dev/
cd ~/multimodule-dev/
# setup environment
mkdir bin
echo "export PATH=\$PATH:`pwd`/bin" >> ~/.bash_profile
export PATH=$PATH:`pwd`/bin
# curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh # missing fix from branch massi/noapi
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/massi/noapi/install.sh | sh
arduino-cli version # should work
# install board target
arduino-cli \
--additional-urls https://raw.githubusercontent.com/pascallanger/DIY-Multiprotocol-TX-Module-Boards/master/package_multi_4in1_board_index.json \
core update-index
arduino-cli \
--additional-urls https://raw.githubusercontent.com/pascallanger/DIY-Multiprotocol-TX-Module-Boards/master/package_multi_4in1_board_index.json \
core install multi4in1:STM32F1
# custom project config
mkdir DIY-Multiprotocol-TX-Module-Config
cat >> DIY-Multiprotocol-TX-Module-Config/_MyConfig.h << EOF
//#define FORCE_GLOBAL_ID 0x12345678
#define CHECK_FOR_BOOTLOADER
#undef ENABLE_PPM
#undef FAILSAFE_ENABLE
//er9x
// #define MULTI_STATUS
// #undef MULTI_TELEMETRY
//opentx
// #undef MULTI_STATUS
// #define MULTI_TELEMETRY
// protocols cleanup - faster compile time
#undef A7105_INSTALLED
#undef CYRF6936_INSTALLED
#undef NRF24L01_INSTALLED
#undef CORONA_CC2500_INO
#undef FRSKYV_CC2500_INO
#undef HITEC_CC2500_INO
#undef SFHSS_CC2500_INO
EOF
# clone project
git clone git@github.com:pascallanger/DIY-Multiprotocol-TX-Module.git
# build project
cd DIY-Multiprotocol-TX-Module/
arduino-cli compile \
-b multi4in1:STM32F1:multistm32f103c \
--build-properties build.hs_flag="-DUSE_MY_CONFIG -I`pwd`/../DIY-Multiprotocol-TX-Module-Config/" \
-o `pwd`/../Multiprotocol.multi4in1.STM32F1.multistm32f103c \
Multiprotocol
# upload
arduino-cli upload -v \
-b multi4in1:STM32F1:multistm32f103c:upload_method=DFUUploadMethod \
-i `pwd`/../Multiprotocol.multi4in1.STM32F1.multistm32f103c \
-p /dev/cu.usbmodem* \
Multiprotocol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment