This repo is going to be used for hosting the code for the upcoming Eurobot 2017 competition. The code is GPL3 licensed.
- STM32F4-Discovery board
- PIC base motion driver
- Dynamixel AX12
- Analogue PWM driven servo motors
- libopencm3 library
- FreeRTOS
- Top level directory contains
drivers
- functions for controlling the actual devices and mechanisms on the robotactuators
- output devices such as motors and pneumaticsax12
- digital servo by Dynamixelax12.c
andax12.h
- functions for interfacing with the AX12Makefile
- source the necessary files to make proper compilation possible
motion
- motion driver, uses UART to talk to another MCUmotion.c
andmotion.h
- functions for interfacing with the motion driverMakefile
- source the necessary files to make proper compilation possible
initialisation
- contains source files with functions initialising the MCUMakefile
- source the necessary files to make proper compilation possibleclock_config.c
andclock_config.h
- initialises clock for all the peripheries utilised by the projectgpio_config.c
andgpio_config.h
- initialises GPIO portstimer_config.c
andtimer_config.h
- enables PWM's and other timersuart_config.c
anduart_config.h
- initialises UART's
libopencm3
- a git submodule and a library on which every file dependsLICENSE
- GPL3 licenseDoxyfile
- doxygen configurationMakefile
- rules to build and flash the actual binaryTODO
- serves as a reminder of the things needed to be donemain.c
- the main while(1) loopmake_def_rules.mk
- contains clean target and .c -> .omake
rulesmake_def_vars.mk
- contains all variables used by otherMakefiles
- Linux or Cygwin environment
arm-none-eabi
toolchaingit
make
st-link
utility
If you're just looking for a fastest way to use this code here's the simplest way:
git clone https://github.com/bstaletic/eurobot2k17
cd eurobot2k17
git submodule update --init
cd libopencm3
make
cd ..
make flash
This will explain every single step in the compilation procedure and thte ways to customise it. While the secnod just changes the working directory to that of the cloned repo.
First six steps are mandatory. The first step clones the repository, the third clones the libopencm3 library and the fifth compiles the libopencm3
library.
git clone https://github.com/bstaletic/eurobot2k17
cd eurobot2k17
git submodule update --init
cd libopencm3
make
cd ..
Now the code is ready for compilation and the default make
target compiles the bin file ready for flashing onto STM32F407VG. Other possible targets are as follows:
- $(DESTDIR)eurobot2k17.elf - passed to objcopy to make the bin file
- $(DESTDIR)generated.STM32F407VG.ld - linker script used to make the elf file
- flash - flashes the bin file onto STM32F407
- doc - builds
doxygen
documentation - clean - cleans the whole project of compiled files
The make
variables known to this project's Makefile
are:
- BOARD - defines the board for which the code is compiled
- CC - compiler to be used
- CFLAGS - user configurable compiler flags
- DESTDIR - a directory where the resulting elf and bin binaries as well as the linker script
- SRC - path to the project's source code
- DOXYGEN - executable for generating documentation
- OBJCOPY - objcopy from the utilised toolchain
- STFLASH - flash utility from st-link package
The default values of these variables:
- BOARD := STM32F407VG
- CC := arm-none-eabi-gcc
- CFLAGS := -Os -g -Wall -Wextra -pednatic -x c -std=c99
- DESTDIR := ${SRC}build/
- SRC not set by default
- DOXYGEN := doxygen
- OBJCOPY := arm-none-eabi-objcopy
- STLINK := st-flash
NOTE: If you set