-
Notifications
You must be signed in to change notification settings - Fork 209
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
Maximum Task Priority #687
Comments
Exciting with RISC-V activities! :) As you might have noted, in export.rs there's this function:
The
|
Thanks for finding, but the current system is correct! :) For RISCV support we are officially adding it to RTIC 2. Plus the codegen is RTIC 2 is much simpler, so adding support should be close to trivial. |
Oh, very cool to hear that a new version is in the pipeline! Yes, I see the logical to hardware transformation, but that's not what I wanted to say. I probably did not express myself properly :) What I meant was that the highest logical RTIC priority is |
Now I see your point, good catch!
Trying to put prio 256 would at least not silently fail/overflow but rather explode and not let the user build :) It simply does not fit in the u8 and Rust will let us know ❤️ What to do about it... I'm a bit hesitant to just throw in a larger type there, especially as there seems hardware having the use case is RISC-V (which we currently do not support in RTIC v1) For RTIC v2 this should be kept in mind, so I'll reopen the task as a tracking issue for this :) |
Great, this sounds reasonable :) |
The book states, that task priorities are in range
1..=(1 << NVIC_PRIO_BITS)
, whereNVIC_PRIO_BITS
could be up to8
bits. The logical priority of the monotonic task however is set to1 << NVIC_PRIO_BITS
. In case ofNVIC_PRIO_BITS == 8
, this would lead to the logical priority being256
, i.e. 1 unit higher than allowed and an overflow would happen. This would make the timer the least prioritized interrupt.I think the issue is not very urgent, since (to my limited knowledge) cortex-m devices normally do not offer 8 priority bits. However, I stumbled upon this when I was porting RTIC to the RISC-V processor architecture (with the CLIC extension), that offers 8 priority bits.
Best,
Noah
The text was updated successfully, but these errors were encountered: