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

Fixes for FreeRTOS task creation #24

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

fredrikdanielmoller
Copy link
Contributor

The port for FreeRTOS could allocate task stacks twice as large as expected. Furthermore, if out-of-memory when attempting to create a task, the error would go unreported. This would not necessarily lead to a crash, as the returned task handle is often not used.

In FreeRTOS version V11.0.1 or earlier, if configSTACK_DEPTH_TYPE is not
defined by user in FreeRTOSConfig.h, the default value set is uint16_t,
which is unlikely to be correct.

Fixed by replacing configSTACK_DEPTH_TYPE with StackType_t, which
should always be correct as it is used internally in xTaskCreate().

See #2351.
Stacks such as i-link assume that os_thread_create() always succeeds.
Returning NULL is inconsistent with other create() functions as well
as rt-kernel.

See #2363.
@hefloryd hefloryd requested a review from olbjo September 13, 2024 12:44
Copy link

@olbjo olbjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@hefloryd hefloryd merged commit 4bf20cd into rtlabs-com:master Sep 16, 2024
1 check passed
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.

3 participants