Build system for ESTC OS-less tasks
- arm-none-eabi compiler
- stlink utility
- common_defs.mk -- file with many useful rules. Every makefile that builds something should include it and define
BUILD_ROOT
variable -- path to this file. - Makefile -- "main hub" for a project. Here you can add you workshop directories and call
make
on them. Take a look at the examplelab1
target. - common -- directory with various common stuff like startup files and interrupt tables. It's compiled once as a static library
libstmcommon.a
and linked with every binary produced with the build system. - stm_spl -- Standard Peripherials Library form ST. It makes development much easier but with an overhead.
- projects -- directory with workshops. Every workshop should be in a separate directory inside and should define its own makefile rules. Take a look at the led_test as an example.
- You can put worhskops git repository to projects directory.
- It's possible to use helper commands from common_defs.mk to link your binaries. Example:
main: main.o
@echo "Linking ELF"
$(LINK_ELF)
@echo "Making image"
$(MAKE_IMAGE)
If you have arm-none-eabi-gdb
binary installed, then you can skip right to step 2 of this instruction. Otherwise, stat from the beginning
- Install gdb for ARM. In ubuntu:
#> sudo apt install gdb-mutiarch
- Connect a board and use
st-util
to start a GB server on it:?> st-util -m -p 4242
- Navigate to your project directory and launch gdb. For ubuntu:
?> gdb-multiarch main.elf
- Connect to a gdb server on board and load your binary:
Tou can put those lines (omitting
gdb> target extended-remote :4242 gdb> load main.elf gdb> continue
gdb>
prefix) to the~/.gbinit
file. - Press a reset on the board
- Debug normally. GDB reference: GDB refcard.