Code for the robotronik club participation to the french robotics cup (WIP). This code will implement motor control and positioning awareness by odometry.
Reminder: To clone the submodule in the same time, use git clone --recurse-submodules, then don't forget to build libopencm3. You need to execute make install_udev one time to add the permission to flash.
If you forgot to clone with submodule just run git submodule update --init --recursive
To compile and flash you need gcc-arm-none-eabi-bin, st-linkand openocd
To build: mainTest.elf
To flash: mainTest.flash
To clean: make clean
You can access the documentation generated from the code with doxygen (see the doxygen paragraph to generate it) in the doxygen/html or latex.
Microcontroller used: STM32F303K8 on a Nulceo-32 board, main doc:
- Reference Manual STM32F3 line, doc RM0316, 1141 pages
- memory map, p57, table 4
- STM32F303x6/x8 Datasheet, 124 pages
- alternate function, p41, table 14
- Reference STM Nuleo-32 Board, doc UM1956, 37 pages
Generating the documentation with doxygen: --> install doxygen on your system
--> run doxygen doxygenConf from the project directory
--> the documentation can then be read from doxygen/html/index.html in a browser
--> to generate the pdf for the github (or for yourself !) go into the latex directory cd doxygen/latex and run make.
Note: You must have a latex distribution on your computer that has pdflatex command.
--> to update the compile_command.json you can use bear (available in the AUR)
--> run make clean
--> run bear /compilation command/
--> install picocom
--> find your card ls /dev . It should be /dev/ttyACM0
--> run picocom with picocom -b 9600 /dev/ttyACM0
-
Tabs are spaces = 4
-
Column = 80
-
Brackets :
def peripheral_action_subjectofaction(params){ code... some more code... } -
Function naming
- _ is the separator
- peripheral_action_subjectofaction
- function starting with _ are private and should not be called in high level code
-
Variables
- my_var
-
Documentation using doxygen
- comment the function interface in the .h files (javadoc like)
- detail the function in .c files
-
We envision three levels for the code :
- lowlevel fuctions that must be as general as possible to setup the hardware config (ex: timer fuctions)
- lowlevel modules with the functions called by the user (ex: motor module, with setup and speed/dir fuctions)
- rolling unit level (ex: control engineering)