-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the official wiki for the TSAT Utilities Kit (TUK)! This project is aimed at streamlining some common operations across subsystems. Here, you’ll find comprehensive documentation to help you get started with the kit and understand its features.
🚧 This wiki is a Work in Progress. Some info will be missing. I will be updating intermittingly when I have time.
To get started with TUK, you can follow these simple steps:
All you need is any old STM32 project!
- In STM32CubeIDE, add a source folder named "External" to your project root.
- Then open your terminal, and navigate to your project folder in your terminal:
cd your/project/path - Add this repository as a submodule into your project with:
git submodule add https://github.com/UMSATS/tsat-utilities-kit External/tsat-utilities-kit
- From STM32CubeIDE, right click on the
tsat-utilities-kit/Incfolder and selectAdd/remove include path....
Hint: If you can't open the folder, you may need to refresh your workspace. To do that, right click and hit "Refresh" over the project root.

- Leave all configurations selected and hit
OK.

-
Next, follow the CAN Wrapper Installation Guide to enable CAN as required by the CAN Wrapper Module.
-
Next, you will need to define a compiler symbol so TUK can distinguish the family of microprocessor being used. For most UMSATS projects, this will be the L4 family. With the project open and selected, find the navbar and go to
Project > Properties. Then follow the directions shown in the image below:
You will get a pop-up that asks if you want to rebuild the index. Hit "Rebuild Index".
- Go back to your terminal and commit the changes. Note this will also commit any other changes you've made to the project. Consider committing existing changes in a separate commit.
git add -A git commit -m "Install TSAT Utilities Kit" - Push to the remote repository to sync GitHub with your local repository.
git push origin main
The following steps will update your copy of TUK to the most recent commit:
- Ensure your project repository is up-to-date and clean (
git pullto update, thengit statusto check if it's clean. commit and push if it's not). -
cdinto the root folder of the submodule. - Enter
git pull. -
cdback to the root folder of your project. - Enter:
git add -A
git commit -m "Update TSAT Utilities Kit"
git pushIf you have multiple submodules in your project, you can update all of them at once by replacing steps 2-4 with:
git submodule foreach git pull origin mainNow you can include the kit in your code by using #include "tuk/tuk.h", or by including individual modules separately via a tuk/XXXX.h path.
Note that most modules require initialisation before use. Refer to the module's usage guide for more info.
Here's some example code using the CAN Wrapper Module:
#include "tuk/can_wrapper.h"
#include <stdbool.h>
bool Report_PCB_Temp()
{
uint16_t temp;
bool success = TMP235_Read_Temp(&temp);
if (success)
{
uint8_t my_data[CAN_MAX_BODY_SIZE] = {0};
SET_MSG_DATA(my_data, 0, uint8_t, TEL_PCB_TEMP);
SET_MSG_DATA(my_data, 1, uint16_t, temp);
CANWrapper_Transmit(&hcan1, NODE_CDH, CMD_CDH_PROCESS_TELEMETRY_REPORT, my_data);
}
return success;
}Each module has its own usage guide below:
- CAN Wrapper Module: This module wraps a simpler interface around HAL's CAN interface for sending & receiving messages onboard the TSAT satellite.
- Debug Module: Contains debugging utilities, such as print macros and a logger for storing diagnostic data.
More things are coming soon!
- Update Installer
- assert.h for the Debug Module
- Flash Module
If you encounter any issues or have any questions, contact me at logan.furedi@umsats.ca. If you find a bug, feel free to open an issue on GitHub.