Skip to content
Kolosso edited this page Nov 15, 2024 · 38 revisions

Welcome to the TSAT Utilities Kit Wiki!

Overview

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.

Table of Contents

  1. Getting Started
  2. Installation
  3. Updating
  4. Usage
  5. Features
  6. Support

Getting Started

To get started with TUK, you can follow these simple steps:

  1. Installation
  2. Usage
  3. Features

Installation

Prerequisites

All you need is any old STM32 project!

Steps

  1. In STM32CubeIDE, add a folder named "External" to your project root.

image

  1. Then open your terminal, and navigate to your project folder in your terminal:
    cd your/project/path
  2. Add this repository as a submodule into your project with:
    git submodule add https://github.com/UMSATS/tsat-utilities-kit External/tsat-utilities-kit
  3. From STM32CubeIDE, right click on the tsat-utilities-kit/Inc folder and select Add/remove include path....

image

  1. Leave all configurations selected and hit OK.

image

  1. Next, follow the CAN Wrapper Installation Guide to enable CAN and TIM16 as required by the CAN Wrapper Module.
  2. 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"
  3. Push to the remote repository to sync GitHub with your local repository.
    git push origin main

Updating

The following steps will update your copy of TUK to the most recent commit:

  1. Ensure your project repository is up-to-date and clean (git pull to update, then git status to check if it's clean. commit and push if it's not).
  2. cd into the root folder of the submodule.
  3. Enter git pull.
  4. cd back to the root folder of your project.
  5. Enter:
git add -A
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 main

Usage

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 module has its own usage guide below:

Features

  • 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

Support

If you encounter any issues or have any questions, contact me at [email protected]. If you find a bug, feel free to open an issue on GitHub.