Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runs TMS in RTOS #91

Merged
merged 3 commits into from
Apr 7, 2024
Merged

Runs TMS in RTOS #91

merged 3 commits into from
Apr 7, 2024

Conversation

BlakeFreer
Copy link
Contributor

@BlakeFreer BlakeFreer commented Apr 3, 2024

TMS on RTOS

closes #60

Changes

  • Enables FreeRTOS

    • Edits board_config.ioc to enable FreeRTOS
    • Adds os.cc and the necessary CMakeLists targets / sources
    • Wraps the Update() function in a task that runs every 100 ms.

      I believe this means a 100 ms delay between calls, not 100 ms from start to start. If needed, we can investigate a better timing method or shorten the delay to ensure we meet the BMS requirements. I updated to use tick_until to ensure a 100ms period

  • Update debug indicators to use nucleo pins (these can be changed or removed later)

  • Adds a power_to_pwm_ mapper to the fan controller to represent the inverted duty-cycle behaviour.

Testing

  • Builds successfully
  • The task is running at 100 ms, as indicated by toggling the blue led on every task cycle
  • Prior to enabling RTOS, the temp sensor and Fan PWM logic worked on windows (cannot test anymore on windows, but this shouldn't have changed)

Still TODO

not intended to be addressed by this PR

  • Add CAN messages
  • RTOS implementation / mock for the windows platform (windows will not build right now)

@BlakeFreer BlakeFreer linked an issue Apr 3, 2024 that may be closed by this pull request
@BlakeFreer BlakeFreer force-pushed the user/freerb/tms-rtos branch from bd74b19 to 2396514 Compare April 7, 2024 14:39
@samparent97 samparent97 merged commit 13f839d into main Apr 7, 2024
1 check passed
@samparent97 samparent97 deleted the user/freerb/tms-rtos branch April 7, 2024 16:51
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.

TMS on FreeRTOS
2 participants