libopencm3 is a free software library for microntrollers using an arm cortex-m processor core
libopencm3-plus is an extension library developed by ARCOS-Lab that provides easy printf and malloc (and general stdlib support) and specific hardware support to the stm32 microcontrollers and discovery development boards
sudo apt-get install gcc-arm-none-eabi
sudo apt-get install openocd
sudo apt-get install stlink-tools
sudo apt-get install minicom
mkdir -p ~/local/src/repos/github
cd ~/local/src/repos/github
git clone https://github.com/libopencm3/libopencm3-examples
cd libopencm3-examples
git submodule init
git submodule update
cd libopencm3
make -j`nproc`
cd ..
cd examples/stm32/f3/stm32f3-discovery/miniblink
make -j`nproc`
make V=1 flash
Note: There may be an error during
make flash
command. There are two possible reasons for this:
make flash
export OOCD_INTERFACE=stlink-v2-1
You ca use
stlink-v2
instead
Or you can edit the make file editing OOCD_INTERFACE=stlink
mkdir -p ~/local/src/repos/gitlab/arcoslab
cd ~/local/src/repos/gitlab/arcoslab
git clone git@gitlab.com:arcoslab/libopencm3-plus-examples.git
cd libopencm3-plus-examples
git submodule init
git submodule update
cd libopencm3
make -j`nproc`
cd ..
cd libopencm3-plus
make -j`nproc`
cd ..
cd examples/stm32/f3/stm32f3discovery/cdcacm_example
make -j`nproc`
make V=1 flash
sudo dmesg
sudo minicom -s
Entry in Serial port Setup, F and G should be No. If not, set it.
In A, set the serial port of USB ACM devise (/dev/ttyACM#).
Then, in Screen and Keyboard, T should be YES, if not set it.
Go to Exit, and Enter.
You should see a mesagge of test that's the default printf debbuger.If you write in the keyboard, the characters will apear in the console, and if make a enter, the message "test" will apear again.
To exit press Ctrl+A nad then press just Q, and select yes.
Note: There may be an error during
make flash
command. There are two possible reasons for this:
make flash
export OOCD_INTERFACE=stlink-v2-1
You ca use
stlink-v2
instead
cd examples/stm32/f3/stm32f3discovery/
cp cdcacm_example my_project_name