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
- HAL library
- FreeRTOS
- Top level directory contains
src
- directory contains the actual source filesmain.c
- the main while(1) loopdrivers
- functions for controlling the actual devices and mechanisms on the robotactuators
- output devices such as motors and pneumaticsanalog_servo
- analog chinese servoMakefile
- source the necessary files to make proper compilation possibleanalog_servo.c
andanalog_servo.h
- functions for interfacing with chinese analog servos
ax12
- digital servo by DynamixelMakefile
- source the necessary files to make proper compilation possibleax12.c
andax12.h
- functions for interfacing with the AX12
motion
- motion driver, uses UART to talk to another MCUMakefile
- source the necessary files to make proper compilation possiblemotion.c
andmotion.h
- functions for interfacing with the motion driver
sensors
- input devices such as digital and analog sensorsanalog
- analog sensorsMakefile
- source the necessary files to make proper compilation possiblecolour.c
andcolour.h
- interface of the colour sensor
colour
- colour sensor driver, returns frequencyMakefile
- source the necessary files to make proper compilation possiblecolour.c
andcolour.h
- functions for interfacing with colour sensor
executors
- abstracts drivers for easier writing of tacticstrunk
- mechanism for storing oresMakefile
- appends the source to SRC variabletrunk.c
andtrunk.h
- functions for interfacing with the trunk mechanism
initialisation
- contains source files with functions initialising the MCUMakefile
- source the necessary files to make proper compilation possibleadc_config.c
andadc_config.h
- initialises ADC1clock_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 donemake_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
openocd
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:
- assembly - generates only the assembly files
- bin - builds only the non-debug bin file
- clean - cleans either debug or release directory
- clean-all - cleans the whole project of compiled files
- doc - builds "doxygen" documentation
- flash - flashes the bin file onto STM32F4-Discovery
- help - prints this help message
The make
variables known to this project's Makefile
are:
- AS - assembler to be used
- CC - compiler to be used
- OBJCOPY - objcopy from the utilised toolchain
- BOARD - defines the board for which the code is compiled
- CFLAGS - user configurable compiler flags
- ASFLAGS - user configurable assembler flags
- DESTDIR - a directory where the resulting elf and bin binaries as well as the linker script
- OBJDIR - directory to keep all the object files
- DOCDIR - directory containing documentation
- BINDIR - directory with release version of the code
- ASMDIR - directory with assembly files
- SRCDIR - path to the project's source code
- DOXYGEN - executable for generating documentation
- DOXTFILE - $(STARTDIR)Doxyfile
- OPENOCD - flash utility from openocd package
- MKDIR_P - utility to make specified directory and its parents
- DEBUG - set to 0 for the release build
The default values of these variables:
- CC := arm-none-eabi-gcc
- AS := arm-none-eabi-as
- OBJCOPY := arm-none-eabi-objcopy
- DESTDIR := $(STARTDIR)build/
- OBJDIR := $(DESTDIR)obj/
- DOCDIR := $(DESTDIR)doc/
- BINDIR := $(DESTDIR)bin/
- ASMDIR := $(DESTDIR)asm/
- SRCDIR := $(STARTDIR)src/
- DOXYGEN := doxygen
- DOXYFILE := $(STARTDIR)Doxyfile
- OPENOCD := openocd
- MKDIR_P := mkdir -p
- DEBUG := not initially set
NOTE: If you set and of the directory paths, make sure you include the trailing slash.