Skip to content

Conversation

@Known4225
Copy link
Contributor

@Known4225 Known4225 commented May 12, 2025

This PR replaces the AMDC scheduler with FreeRTOS, an open source real time operating system.

The freertos-rebase branch only builds and makes use of cpu0 - since communication between the cpus on FreeRTOS was never completed. All functionality that was previously done on cpu1 (user apps, commands, timing manager, PWM, almost all the drivers) has been moved to cpu0.

FreeRTOS allows us to use preemptive scheduling, and to give priority to certain tasks.

This PR is incomplete. Here is a summary of the changes

  • Replace sys/scheduler with FreeRTOS kernel
  • Replace lwip library with FreeRTOS Plus TCP
  • Attempt to create high priority control tasks using the create_control_task() function
  • Changed logging to sync with control tasks and allow logged variables to be local
  • cpu1 does nothing

Steps to configure and build:

Includes:
/${ProjName}/src
/${ProjName}/FreeRTOS-Kernel/portable/GCC/ARM_CA9
/${ProjName}/FreeRTOS-Kernel/include
/${ProjName}/FreeRTOS-Plus-TCP/source/include
/${ProjName}/FreeRTOS-Plus-TCP/source/portable/Compiler/GCC
/${ProjName}/FreeRTOS-Plus-TCP/source/portable/NetworkInterface
../amdc_bsp_cpu0/ps7_cortexa9_0/include
../shared

first six are workspace paths


Source:
/freertos_app_cpu0
/freertos_app_cpu0/FreeRTOS-Kernel
/freertos_app_cpu0/FreeRTOS-Kernel/portable/GCC/ARM_CA9
/freertos_app_cpu0/FreeRTOS-Kernel/MemMang
/freertos_app_cpu0/FreeRTOS-Plus-TCP
/freertos_app_cpu0/FreeRTOS-Plus-TCP/source/portable/Compiler/GCC
/freertos_app_cpu0/FreeRTOS-Plus-TCP/source/portable/NetworkInterface/Zynq
/freertos_app_cpu0/shared


Software inferred flags:
-Wl,--start-group,-lxil,-lgcc,-lc,--end-group
-Wl,--start-group,-lxil,-lgcc,-lc,-llwip4,--end-group
-Wl,--start-group,-lxil,-lgcc,-lc,-llwip4,-lfreertos,--end-group

-Wl,-Map=mapfile.txt

Libraries:
m

Library search path:
${workspace_loc:/amdc_bsp_cpu0/ps7_cortexa9_0/lib}

I excluded FreeRTOS-Kernel/examples and FreeRTOS-Kernel/portable from the build
I also excluded FreeRTOS-Plus-TCP/test, FreeRTOS-Plus-TCP/tools, FreeRTOS-Plus-TCP/source/portable/Compiler, FreeRTOS-Plus-TCP/source/portable/BufferManagement/BufferAllocation_1.c, and FreeRTOS-Plus-TCP/source/portable/NetworkInterface from the build

Plans

Test AMDC 2.0 with BP6 power cabinet to verify functionality. We never got to do this since the cabinet had its own issues.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants