-
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.
🚧 Notice: 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!
- Navigate to your project folder in your terminal:
cd your/project/path
- Add this repository as a submodule into your
Drivers/
folder:git submodule add https://github.com/UMSATS/tsat-utilities-kit Drivers/tsat-utilities-kit
- From STM32CubeIDE, right click on the
tsat-utilities-kit/Inc
folder and selectAdd/remove include path...
. - Leave all configurations selected and hit
OK
. - Go back to your terminal and commit the changes:
git add Drivers/tsat-utilities-kit git commit -m "Add TSAT Utilities Kit Submodule"
- Push to the remote repository
git push origin main
⚠️ Note that the CAN Wrapper Module requires additional steps to install since you need to enable CAN and TIM16 in your project settings before use. For detailed instructions, visit the CAN Wrapper Installation Guide.
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 pull
to update, thengit status
to check if it's clean. commit and push if it's not). -
cd
into the root folder of the submodule. - Enter
git pull
. -
cd
back to the root folder of your project. - Enter:
git add .
git commit -m "Update TSAT Utilities Kit"
git push
If 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 master
Now 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)
{
CANMessage my_msg;
my_msg.cmd = CMD_CDH_PROCESS_PCB_TEMP;
SET_ARG(my_msg, 0, temp);
CANWrapper_Transmit(NODE_CDH, &my_msg);
}
return success;
}
Each included module has its own usage guide. You can find links below:
- CAN Wrapper Module Usage Guide
- Error Tracker Usage Guide
- Debug Module Usage Guide (coming soon)
- CAN Wrapper Module: This module wraps a simpler interface around HAL's CAN interface for sending & receiving messages onboard the TSAT satellite.
- Error Tracker: For recording errors into a buffer, so they can be reported to CDH.
-
Debug Module: Contains debugging utilities, such as the
LOG_INFO
,LOG_WARN
, andLOG_ERROR
macros. A usage guide is coming soon.
More things are coming soon!
- Program Loader
- assert.h
- 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.