Severson-Group / AMDC-Firmware

Embedded system code (C and Verilog) which runs the AMDC Hardware
http://docs.amdc.dev/firmware
BSD 3-Clause "New" or "Revised" License
31 stars 5 forks source link

Port existing firmware modules to FreeRTOS #405

Open npetersen2 opened 3 months ago

npetersen2 commented 3 months ago

This issue documents the next big project for @Known4225 to work on.

Goal: Move the codebase to be based on FreeRTOS, instead of the current "in-house" cooperative scheduler.

Background

Since the AMDC's inception about 5-6 years ago, it has used a cooperative scheduler for task running. See the docs here and here to read more about this.

This has worked alright and allowed the AMDC to be used in research projects to get experimental data. However, cooperative scheduling is not the best approach for a real-time motor drive application. This is because there must be hard scheduling guarantees which are simply impossible (or quite hard) to ensure are met across all code and systems. Many of the current AMDC firmware is written in an "odd" way specifically to help meet these timing requirements. If we move to FreeRTOS, a lot of code can be simplified!

AMDC-Firmware version numbering

For your reference, we have three main versions which will become relevant:

Tasks for @Known4225

Your tasks are to start porting over the existing modules in the firmware to work with FreeRTOS. Below, I have outlined a recommended way of doing this:

The goal is, after completing these tasks, you will be able to type commands to the AMDC and it will run the command handlers, just like now... Except the full backend is FreeRTOS.

Helpful Resources

NOTE: most new examples will refer to AMD Xilinx Vitis software development....however, the AMDC still uses the older SDK environment. This will slightly alter the creation of new projects, but overall, is mostly the same.