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

Update Miosix Kernel #239

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Update Miosix Kernel #239

wants to merge 18 commits into from

Conversation

mdiepart
Copy link
Contributor

@mdiepart mdiepart commented Feb 16, 2024

While implementing user functions (functions that user code can register in OpenRTX to be called periodically or asynchronously to avoid creating a thread for minor functionalities) I realized that the function pthread_cond_timedwait is needed.

It looks like that function is available in recent versions of miosix. Updating the kernel would allow to implement user functions. It is also probably gonna be needed for OpenHT.

This PR updates the miosix kernel, then fixes the code for Module17. This PR does not work for all targets yet.

One of the main problem that was found in the update process is that the default miosix implementation for the system timer (TIM5) uses an uninitialized TimeConversion instance. Commit 86fce68 fixes it.

As @silseva noted, a system timer implementation needs to be implemented for the MK22 processor.

@mdiepart
Copy link
Contributor Author

I tried flashing my RT3s radio (with a copycat MCU). It compiles and flashes alright, but it doesn't boot.

I explored a bit, and I find that there probably is a problem with miosix. In particular, the function startKernel() returns despite the comment right after saying that we should never reach there. I tested that by I turning on the green LED, turning on the PWR_SW pin and entering an infinite loop.

For now I don't have many clues on why it could be.

@mdiepart
Copy link
Contributor Author

I wrote a preliminary implementation for MK22 MCUs. It is untested as I don't have a GD-77 or MD-9600.

De-clutters the architecture
Accounting for new arch structure and new kernel files
Fixed a bad cast warning in kernel.cpp
Fixed a warning with variadic macros in logging.h
Fixed invalid type warning in util.cpp
This fixes a problem where the time would pass 11.904 times too slow. It turns out that the OS used an uninitialized TimeConversion instance. This commit fixes that, though I don't really know why this fix is even needed.
Preliminary implementation for NXP MK22 MCU series. Tested.
@mdiepart
Copy link
Contributor Author

I rebased the branch on the current Master branch.
I completed/fixed the NXP timer implementation. For now, it is using FlexTimer 0 (FTM0) with a prescaler of 4.

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.

None yet

1 participant