Last active
March 23, 2019 13:29
-
-
Save HansRobo/4630e45e3141644b06bedd89abf2dd92 to your computer and use it in GitHub Desktop.
environment_construction_for_stm32plus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02c4", MODE="0666" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02d8", MODE="0666" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02d9", MODE="0666" | |
SUBSYSTEM=="usb", KERNEL=="ttyUSB*", MODE="0666" | |
SUBSYSTEM=="usb", KERNEL=="ttyACM*", MODE="0666" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="3748", MODE="0666" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="374b", MODE="0666" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="df11", MODE="0666" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="05a9", ATTR{idProduct}=="058a", MODE="0666" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PATH=$PATH:/usr/local/arm-cs-tools/bin | |
if [ "$(uname)" == 'Darwin' ]; then | |
brew update | |
brew install git scons | |
else | |
yes | sudo apt-get update | |
sudo apt-get -y install git-core scons | |
fi | |
cp stm32plus_nostlthrow.patch /tmp | |
cd /tmp | |
if [ -e stm32plus ]; then | |
echo "Delete old stm32plus files" | |
rm -rf stm32plus | |
fi | |
#git clone https://github.com/spiralray/stm32plus.git -b can-support | |
git clone https://github.com/andysworkshop/stm32plus.git | |
patch -b stm32plus/lib/include/stl/string < stm32plus_nostlthrow.patch | |
cd stm32plus | |
scons mode=small mcu=f1md hse=12000000 -j4 examples=no | |
scons mode=small mcu=f1hd hse=12000000 -j4 examples=no | |
scons mode=small mcu=f1md hse=8000000 -j4 examples=no | |
scons mode=small mcu=f1hd hse=8000000 -j4 examples=no | |
scons mode=small mcu=f4 hse=25000000 -j4 float=hard examples=no | |
scons mode=small mcu=f4 hse=8000000 -j4 float=hard examples=no | |
scons mode=small mcu=f4 hse=12000000 -j4 float=hard examples=no | |
scons mode=small mcu=f429 hse=8000000 -j4 float=hard examples=no | |
if [ -e ~/workspace/stm32plus ]; then | |
echo "Delete old stm32plus files" | |
rm -rf ~/workspace/stm32plus | |
fi | |
mkdir -p ~/workspace | |
mv ./lib ~/workspace/stm32plus | |
cd ~/workspace/stm32plus/build | |
#To be compatible with old stm32plus | |
cp -r small-f1hd-8000000e small-f1hd-8000000 | |
cp -r small-f1hd-12000000e small-f1hd-12000000 | |
cp -r small-f1md-8000000e small-f1md-8000000 | |
cp -r small-f1md-12000000e small-f1md-12000000 | |
cp -r small-f4-8000000e-hard small-f4-8000000-hard | |
cp -r small-f4-25000000e-hard small-f4-25000000-hard | |
cp -r small-f429-8000000e-hard small-f429-8000000-hard | |
cd small-f1hd-8000000 | |
cp libstm32plus-small-f1hd-8000000e.a libstm32plus-small-f1hd-8000000.a | |
cd ../small-f1hd-12000000 | |
cp libstm32plus-small-f1hd-12000000e.a libstm32plus-small-f1hd-12000000.a | |
cd ../small-f1md-8000000 | |
cp libstm32plus-small-f1md-8000000e.a libstm32plus-small-f1md-8000000.a | |
cd ../small-f1md-12000000 | |
cp libstm32plus-small-f1md-12000000e.a libstm32plus-small-f1md-12000000.a | |
cd ../small-f4-8000000-hard | |
cp libstm32plus-small-f4-8000000e-hard.a libstm32plus-small-f4-8000000-hard.a | |
cd ../small-f4-25000000-hard | |
cp libstm32plus-small-f4-25000000e-hard.a libstm32plus-small-f4-25000000-hard.a | |
cd ../small-f429-8000000-hard | |
cp libstm32plus-small-f429-8000000e-hard.a libstm32plus-small-f429-8000000-hard.a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Add udev-rules file | |
sudo cp 50-udev.rules /etc/udev/rules.d/ | |
#Update JAVA | |
yes | sudo apt-get update | |
# sudo apt-get -y install openjdk-8-jdk openjdk-8-jre openjdk-8-jre-headless openjdk-8-jre-dcevm openjdk-8-jre-zero icedtea-8-plugin openjdk-8-jre-headless icedtea-netx icedtea-netx-common | |
# sudo apt install -y java-common | |
# sudo update-java-alternatives --jre -s `sudo update-java-alternatives -l | grep 1.7.0 | awk '{print $1}'` | |
# sudo update-java-alternatives --jre-headless -s `sudo update-java-alternatives -l | grep 1.7.0 | awk '{print $1}'` | |
# sudo update-java-alternatives -s `sudo update-java-alternatives -l | grep 1.7.0 | awk '{print $1}'` | |
# sudo update-java-alternatives -l | |
#GNU Tools for ARM Embedded Processors is 32bit application. | |
sudo apt-get -y install lib32z1 | |
#Set up GNU Tools for ARM | |
cd /tmp | |
#stm32plus supports gcc-arm-none-eabi-6_1-2017q1 | |
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 | |
sudo tar xvf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 -C /usr/local | |
sudo ln -snf /usr/local/gcc-arm-none-eabi-7-2018-q2-update /usr/local/arm-cs-tools | |
export PATH=$PATH:/usr/local/arm-cs-tools/bin | |
source ~/.bashrc | |
sudo apt-get -y install dh-autoreconf | |
sudo apt-get -y install libusb-1.0-0-dev | |
sudo apt-get -y install git-core | |
sudo apt -y install cmake | |
cd /tmp | |
sudo mkdir stlink | |
cd /tmp/stlink | |
sudo git init . | |
sudo git remote add origin "https://github.com/texane/stlink.git" | |
sudo git fetch --tags | |
sudo git checkout 1.2.0 | |
sudo mkdir build && cd build | |
sudo cmake -DCMAKE_BUILD_TYPE=Debug .. | |
sudo make | |
sudo make install | |
#Setup dfu-util | |
sudo apt-get -y install dfu-util | |
#download stm32plus | |
cd ~/4630e45e3141644b06bedd89abf2dd92 | |
sudo chmod 775 install_stm32plus.sh | |
source ~/.bashrc | |
sudo sh install_stm32plus.sh | |
#End | |
echo "-----------------" | |
echo "-----------------" | |
echo "Install finished!" | |
echo "run source ~/.bashrc" | |
echo "then, run eclipse" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment