Skip to content

Instantly share code, notes, and snippets.

@spiralray
Last active May 18, 2019 16:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save spiralray/0dfe899d1230ff1a5522 to your computer and use it in GitHub Desktop.
Save spiralray/0dfe899d1230ff1a5522 to your computer and use it in GitHub Desktop.
#!/bin/bash
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
*** stm32plus/lib/include/stl/string 2014-11-30 15:46:14.262968608 +0900
--- stm32plus/lib/include/stl/string 2014-11-30 15:47:03.522970422 +0900
***************
*** 239,250 ****
// Helper functions for exception handling.
template <class _Tp, class _Alloc>
void _String_base<_Tp,_Alloc>::_M_throw_length_error() const {
! __STL_THROW(length_error("basic_string"));
}
template <class _Tp, class _Alloc>
void _String_base<_Tp, _Alloc>::_M_throw_out_of_range() const {
! __STL_THROW(out_of_range("basic_string"));
}
--- 239,250 ----
// Helper functions for exception handling.
template <class _Tp, class _Alloc>
void _String_base<_Tp,_Alloc>::_M_throw_length_error() const {
! //__STL_THROW(length_error("basic_string"));
}
template <class _Tp, class _Alloc>
void _String_base<_Tp, _Alloc>::_M_throw_out_of_range() const {
! //__STL_THROW(out_of_range("basic_string"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment