In this repository is where all of the OBC Software is housed. This is the final version that will be used on the satellite. The software runs on the Microchip ATSAMV71Q21B Microcontroller Unit, which is a 32-bit ARM Cortex-M7 core. We use FreeRTOS to handle the tasking of the MCU. More information regarding OBC can be found here.
After cloning the repo, run the command conan source . to clone the needed repositories, which currently are:
- cross-platform-software
- atsam-component-drivers
If cloning
COBSthrows a permission/access error, setup an SSH key in GitHub to fix it.
If you're using CLion, you need to add in CMake options (File -> Settings -> Build, Execution, Deployment -> CMake ->
CMake Options) this -DCMAKE_TOOLCHAIN_FILE=cmake-build-debug/build/Debug/generators/conan_toolchain.cmake -DCMAKE_CXX_COMPILER="/usr/bin/arm-none-eabi-g++" -DCMAKE_C_COMPILER="/usr/bin/arm-none-eabi-gcc".
If you just cmake from cli, just add the same flags in your command.
To be able to build, however, you need to install the required conan packages. See the Conan section for more info.
This repository uses conan 2.0 to manage dependencies.
Some of the Conan packages (logger and ecss-services) are hosted on a private repository, so you need to either:
- have access to the repository (if you're already on GitLab, it's the same
credentials, and you should login at least once) and add the
remote to your conan remotes. To do that run the following two commands
conan remote add conan https://artifactory.spacedot.gr/artifactory/api/conan/conanandconan remote login conan $YOUR_USERNAME, which will prompt you to add your password. - or, clone the repo on your own, and package it locally use
conan create . --build=missingin the root of the repo. This way, you don't need to add the remote repository, as conan will add it in local cache. - or, clone the repo on your own and add it as a submodule in the
libfolder, and make the necessary CMakeLists. txt changes to include it in the build.
To install the necessary packages, you need to follow these steps:
- Make sure you performed one of the
AcubeSAT Conan Packagessections teps - Run
conan profile detect --force: Generates default profile detecting GCC. However, for this project, you need to set up the correct architecture. Find whereconansets up profiles (probably~/.conan2/profiles) and runcp conan-arm-profile ~/.conan2/profiles(or another directory if conan2 stores the profiles elsewhere) in this project's folder. - Then run
conan install . --output-folder=cmake-build-debug --build="*" -u -pr conan-arm-profile. If you're using CLion and don't seecmake-build-debug, you have toReload CMake projectto have it generated. After you've runconan install...you canReload CMake projectand build as per usual. - Make sure you followed the steps under the
Buildsection - If the Imported target "common" included non-existent path appears, just delete the
cmake-build-debugfolder and redo theconan install...command
Prototypes of ECSS Services
- ST[01]
- ST[03]
- ST[17] (Not a task, since there isn't a need of periodic update. However, the MCU responds to TC[17,1] and TC[17,3])
- ST[20]
Peripherals:
- Internal MCU Temperature Sensor
- External (MCP9808) Temperature Sensor
- UART with DMA
- Parameter updating of ST[20]
minicom is found in almost all package managers for Linux and macOS. For Linux you can use:
For Pop/Ubuntu/Debian derivatives
sudo apt install minicomFor Fedora
sudo dnf install minicomFor Arch
sudo pacman -S minicomminicom is a program that displays the serial input of a port on your computer. To run it, you must specify such a port.
On Linux systems, the serial ports for connected embedded devices are /dev/ttyACMX, where X is a number. The first device you connect will start at 0, and each new device increases the number by 1. Note that removing a device "frees" the port, so if you have two devices connnected and you remove the first, /dev/ttyACM0 will be disconnected while /dev/ttyACM1 will be connected to the remaining target device. When using UART-to-USB devices such as an FTDI, the naming scheme changes and the devices will be at /dev/ttyUSBX, however the above scheme remains the same.
You can use the command ls /dev/ttyACM* to view all connected devices on the /dev/ttyACMX spectrum.
If a device is connected to port /dev/ttyACM0, you can use:
minicom -D /dev/ttyACM0to get its ouput.
All actions inside the program require pressing the Meta key first. If you want to exit the program, you need to press Meta, then x. On Linux the Meta key is CTRL+A, while on macOS it is Escape. You can use Meta, then z to view a list of shortcuts.
Our embedded devices send only a \n delimiter on the end of each log message. Thus, when you open the minicom instance, you will see that each line starts at the end of the previous line. After a couple of log messages, the new lines will start at the right edge of the screen and the messages will be invisible. To control this, you can press Meta, then u to toggle interpreting \n as \r\n. Each new message will now start at the beginning of the next line.
In case you need to save the output of a session to a file, use the option -C filename.txt when opening the program. For example:
minicom -D /dev/ttyACM0 -C output.txtwill save the logs to the file output.txt in your current directory.
The internal watchdog has been disabled for debugging reasons.
To re-enable remove the line
WDT_REGS->WDT_MR = WDT_MR_WDDIS_Msk;in initialization.c. It's on line 148 at the time of writing. You should also uncomment WDT_Initialize() below that.