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

RFC: Increase max stack size for tasks #523

Open
Richard-Stump opened this issue Feb 9, 2023 · 1 comment
Open

RFC: Increase max stack size for tasks #523

Richard-Stump opened this issue Feb 9, 2023 · 1 comment
Labels
p: wishlist This should be worked on when there's time rfc This describes a feature, enhancement, or optimization in broad terms and should be discussed

Comments

@Richard-Stump
Copy link
Contributor

Problem:

Currently tasks in PROS are limited to 64k words, or 256kb of stack space. Most applications do not appear to reach this limit, but the folks working on vex-rt have ran into issues due to rust's memory management. Currently, the limit appears to be due to the fact that the stack depth is a uint16_t:

task_t task_create(task_fn_t function, void* const parameters, uint32_t prio, const uint16_t stack_depth, const char* const name);

Proposed Solution:

Change the FreeRTOS function to take a uint32_t for the stack depth, and add extra code to perform checks for things like:

  • Stack larger than available memory
  • Stack cannot fit into a free block of memory

Additionally, other things need to be considered such as:

  • Are stacks stored in a special memory segment?
  • Or are stacks allocated like other heap objects?
@Richard-Stump Richard-Stump added p: wishlist This should be worked on when there's time rfc This describes a feature, enhancement, or optimization in broad terms and should be discussed labels Feb 9, 2023
@Richard-Stump
Copy link
Contributor Author

After talking with the folks porting Rust to PROS, they found that their issues were not due to the limited stack size. I am leaving this PR open as it could be a useful addition in the future though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: wishlist This should be worked on when there's time rfc This describes a feature, enhancement, or optimization in broad terms and should be discussed
Projects
None yet
Development

No branches or pull requests

1 participant