Skip to content

Finish Migrating SOTI Firmware to Latest Version of TUK #42

Open

Description

@Koloss0

📋 Task Description

Summary
Finish the branch I started called refactor/update-soti-board in SOTI.

Details
A while ago we made a bunch of changes to the TSAT Utilities Kit. We made a lot of API changes and—critically—we made it run exclusively with RTOS.

These changes meant our old code in the SOTI firmware was now incompatible. To fix this, I started a branch where I was updating the SOTI board firmware to be compatible with the new API and have it run with RTOS.

Unfortunately, I never finished as I got busy with other things. For this task, please complete the migration to the latest commit of TUK.

The new code will definitely not be 1:1 with the old code, as the code structure will be a bit different in the new API.

A much better reference will be the NUCLEO project, as I had previously migrated that code successfully, and the SOTI project will be extremely similar to it.

✅ Completion Criteria

  • The submodule for TUK is at the latest commit.
  • The SOTI firmware implements all functionality correctly.
    • All message traffic gets transmitted to the front-end via UART using an RTOS queue.
    • The LED flashes when data is being sent to the front-end.
    • Messages received from the front-end via UART are passed to the CAN bus.
  • The code compiles with no errors or warnings.

📂 Affected Components

🚧 Notes / Reference

  • Refer to the changes made in soti-nucleo-project in commit 4674aae, especially the changes to app.c. Your code will look similar to this, with some extra things on top.

Activity

  1. added theissue type on Oct 5, 2025
  2. Koloss0 commented on Oct 8, 2025

    @Koloss0
    MemberAuthor

    Just wanted to elaborate on the task a bit here.

    What is the SOTI firmware supposed to do?

    The SOTI board is the bridge between the satellite and the computer. It connects to the computer via UART (USB-C) and connects to the satellite via CAN.

    There are two main tasks SOTI performs:

    1. Displaying all message traffic to the screen (on the front-end).
    2. Letting the user enter custom messages to "talk" to the satellite.

    So this is what you're implementing in the firmware:

    • The firmware needs to pass messages from CAN over to UART, and it needs to pass messages from UART (the front-end) to CAN.
    • When data is passed to the front-end, the LED on the board should light up for a few milliseconds.

    What's left to do

    So far, most of this is implemented. The only work left to complete is implementing Handle_Message, Handle_RX and Handle_TX:

    • Handle_Message gets called when a received CAN message is ready to be processed. This function should accept CAN messages and put them into the s_output_queue.
    • Handle_RX gets called when a CAN message gets detected on the bus. It expects you to set the parameter uint8_t *rx_behaviour to define the processing behaviour of the message. To do this, you bitwise OR the constants RX_ACK, RX_HANDLE, and RX_CLEAR_TX_CACHE. In this case, you do not want SOTI to acknowledge messages it receives, so do not apply RX_ACK. You DO want SOTI to handle messages it receives (so it gets passed to Handle_Message), so apply RX_HANDLE. You DO want SOTI to detect timeout errors (will be implemented later), so apply TX_CLEAR_TX_CACHE.
    • Handle_TX gets called when a CAN message is transmitted using CANWrapper_Transmit_Raw. Remember, any messages going to and from CAN needs to be recorded to the front-end. So in this function, pass the messages to s_output_queue (to be later displayed).

    After you complete the above items, this task should be complete. Make sure to fix any errors or warnings you encounter and we'll test the code on the SOTI board when its done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions