This is the repository for Align Standard Library (ASL).
Align Racing UiA (AR) is a multidisciplinary student organisation at The University of Agder (UiA), that take part in the world’s largest yearly engineering competition; Formula Student (FS). The organisation continuously consists of around 60 students, from a wide variety of disciplines. The competition includes developing, building, budgeting and marketing a small scale formula type racing car. AR takes this a bit further by having more focus on developing a strong organisation, open for all disciplines, that gives the members a taste of future work-life.
This repository is currently undergoing a major overhaul, and will be more directed towards a STM32 ecosystem, unlike the Arduino and ATmega targets it usually have targeted. The libraries in this repository is following a CMake build structure, with the goal that everything should be relatively easy to implement in custom projects, by simply adding the subdirectory, and including the libraries.
The build tools used internaly are currently based on the "STM32 VS Code extension" combined with CMake, to simplify the process of building, and flashing projects onto the microcontrollers through an STLink.
First make sure you have STM32CubeCLT and STM32CubeMX.
With those, open STM32CubeMX and setup and configure a CMake project.
If you need this library, include it.
If you have the required space to download everything, the simplest way to include all the functionality of the ASL to your own project, is to add it as a submodule. Note: To be able to use all the functionality in asl normally, you have to make sure to generate all STM32 peripherals as a file pair. This is done by enabling it under "Project Manager" and "Code Generation" in CubeMX.
git init
git submodule add -b AR25 https://github.com/align-racing-uia/align_standard_library asl
Then add it to your project by adding
add_subdirectory(asl)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE
asl
asl_utils (optional, needs a timer as described in the header file)
asl_can (optional, needs fdcan)
asl_events (optional, needs a timer and interrupts)
)
To your CMakeLists.txt.
Then, to download all external libraries as well, run the current command in the main project folder:
git submodule update --init --recursive
If you need to update to a newer version of ASL in your project, the easiest way to do it is to delete the align standard library folder, and rerun:
git submodule update --init --recursive
If that doesnt work, or you want to develop asl further whilst using it for your project, you can do the following instead:
cd <asl folder goes here>
git checkout AR25 (only needed the first time)
git pull
To upload your changes to asl
cd <asl folder goes here>
git add .
git commit -m "A message explaining the changes youve made"
git push
If you would like to add another feature gate, take a look in the CMakeLists.txt folder in asl, and try to copy the process. Remember to update this readme accordingly.
We are mainly using an STLink to do debugging, but sometimes it is nice to be able to print messages to a console. To do this, we use RTT through the official RTT implementation created by Segger. In this repository it is added as a submodule, with a light CMakeLists to make it easy to implement it into custom programs. As the team is using STLinks for programming, and not JLinks, the best solution the team has found to see RTT stream, is to use the functionality of the program "strtt". Note, this only works on Windows. On linux you can try to use a webbased solution instead.
- If a program from an external repo is to be added as a library, make sure to create a new folder for it in the
libsfolder, together with aCMakeLists.txt. It is also prefered if external libraries is added as a submodules.
If you have problems with missing libncurses.so.5 on a debian based linux, add:
deb http://security.ubuntu.com/ubuntu focal-security main universe
To
sudo nano /etc/apt/sources.list
and run
sudo apt-get install libncurses5
All content included in this Git repository is under the license:
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
You are free to:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material
Under the following terms:
- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- NonCommercial — You may not use the material for commercial purposes.
- ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
- No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
