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

Issue with osDelay in TC_osKernelResume_1 #1635

Open
ianfield opened this issue Jun 19, 2023 · 2 comments
Open

Issue with osDelay in TC_osKernelResume_1 #1635

ianfield opened this issue Jun 19, 2023 · 2 comments
Assignees

Comments

@ianfield
Copy link

cmsis_rtos2_validation/Source/RV2_Kernel.c

Entry to TC_osKernelResume_1 (comes after TC_osKernelSuspend_1) the kernel is in state osKernelSuspended.

What is the expected return value for osDelay(1U). Should it be:

ASSERT_TRUE(osDelay(1U) == osError);

The comment "/* Synchronize tick */" seems out of place if the system timer is disabled at that point.

@ianfield
Copy link
Author

ianfield commented Jun 19, 2023

Alternatively, if kernel is suspended on entry, would this make sense:

osKernelResume(0);

/* Synchronize tick */
ASSERT_TRUE(osDelay(1U) == osOK);

@VladimirUmek
Copy link
Collaborator

Hi,
this should be open in CMSIS-RTOS2_Validation, but I guess we can also solve it here.

If you are referring to TC_osKernelSuspend_1 and TC_osKernelResume_1 then osDelay(1U) is there to set the tick counter to the start of time slice (as close as possible, hence it is synchronizing tick). It sets the initial condition to ensure correct test case flow.

Each test is independent and looking at the code, the kernel shall be running after TC_osKernelSuspend_1. The kernel is resumed and since osKernelSuspend and osKernelResume shall not be called from ISR any other call shall not suspend the kernel. TC_osKernelResume_1 is therefore called with the kernel tick running.

Does this make sense?

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

No branches or pull requests

3 participants