-
Notifications
You must be signed in to change notification settings - Fork 221
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] drop the timer-queue
Cargo feature
#199
Comments
I quite like this design, however it might cause confusion for users that do not know that this is automatic. I assume there will be very descriptive compile errors if one does not adhere to this? |
This seems uncontroversial let's give it a 1 week-ish FCP with disposition to merge:
Could you give examples of situations where users may find this confusing?
Paired with RFC #200 the error messages currently are
with span pointing to the
with span pointing to the
the type is a good hint, I think
I think the path difference is a good hint For the last two errors we can't do much to improve the error message. |
OK for me |
Thanks for the examples @japaric ! The type of errors you have specified are good and descriptive. I was a bit worried about the following kind of errors that was in the example:
When they look like this intimate knowledge of the internal workings are needed, but (just an example) some thing like this would be more descriptive:
I just want to keep us away from the first type of error messages, though this is an constructed example. |
🎉 This RFC has been formally approved. Implementation is in PR #205 (I'm going to keep this open until the PR lands) |
205: rtfm-syntax refactor + heterogeneous multi-core support r=japaric a=japaric this PR implements RFCs #178, #198, #199, #200, #201, #203 (only the refactor part), #204, #207, #211 and #212. most cfail tests have been removed because the test suite of `rtfm-syntax` already tests what was being tested here. The `rtfm-syntax` crate also has tests for the analysis pass which we didn't have here -- that test suite contains a regression test for #183. the remaining cfail tests have been upgraded into UI test so we can more thoroughly check / test the error message presented to the end user. the cpass tests have been converted into plain examples EDIT: I forgot, there are some examples of the multi-core API for the LPC541xx in [this repository](https://github.com/japaric/lpcxpresso54114) people that would like to try out this API but have no hardware can try out the x86_64 [Linux port] which also has multi-core support. [Linux port]: https://github.com/japaric/linux-rtfm closes #178 #198 #199 #200 #201 #203 #204 #207 #211 #212 closes #163 cc #209 (documents how to deal with errors) Co-authored-by: Jorge Aparicio <jorge@japaric.io>
205: rtfm-syntax refactor + heterogeneous multi-core support r=japaric a=japaric this PR implements RFCs #178, #198, #199, #200, #201, #203 (only the refactor part), #204, #207, #211 and #212. most cfail tests have been removed because the test suite of `rtfm-syntax` already tests what was being tested here. The `rtfm-syntax` crate also has tests for the analysis pass which we didn't have here -- that test suite contains a regression test for #183. the remaining cfail tests have been upgraded into UI test so we can more thoroughly check / test the error message presented to the end user. the cpass tests have been converted into plain examples EDIT: I forgot, there are some examples of the multi-core API for the LPC541xx in [this repository](https://github.com/japaric/lpcxpresso54114) people that would like to try out this API but have no hardware can try out the x86_64 [Linux port] which also has multi-core support. [Linux port]: https://github.com/japaric/linux-rtfm closes #178 #198 #199 #200 #201 #203 #204 #207 #211 #212 closes #163 cc #209 (documents how to deal with errors) Co-authored-by: Jorge Aparicio <jorge@japaric.io>
Done in PR #205 |
199: v0.6.10 r=korken89 a=Disasm Co-authored-by: Vadim Kaushan <admin@disasm.info>
Current behavior
To use the
schedule
API one needs to first enable thetimer-queue
Cargofeature. Enabling this feature changes the types of the fields of the
rtfm::Peripherals
struct.Proposal
Remove the
timer-queue
feature; one can always use theschedule
API in anRTFM application. The fields of the
rtfm::Peripherals
struct never change whenone uses the
schedule
API in an application.Rationale
The
timer-queue
feature doesn't work with thethumbv6m-none-eabi
target. Tosupport the
schedule
API on heterogeneous multi-core devices where one core isARMv6-M the user would have to compile the
cortex-m-rtfm
crate with adifferent set of Cargo features for each core (compilation target). Not only
this is not currently supported by
cargo-microamp
but it would also result inre-compiling the
cortex-m-rtfm-macros
crate, the biggest dependency, at leasttwice.
Detailed design
The
timer-queue
Cargo feature will be removed. Thecortex-m-rtfm-macros
crate will codegen timer queue related data structures only when the application
makes use of the
schedule
API.The
rtfm::Peripherals
struct, which represents the Cortex-M peripherals notused by the framework, will change its fields to match the fields of
cortex_m::Peripherals
minus theSYST
(system timer) field. All fields willbe there by value so the user can turn them into resources and use them from
any task -- ownership over the
SCB
was specifically requested in #165 (cc@azasypkin).
The type of the
core
field of theinit::Context
struct will changedepending on whether the application uses the
schedule
API or not. When theschedule
API is used thecore
field will have typertfm::Peripherals
(
SYST
field not included); when theschedule
API is not used the fieldwill have type
cortex_m::Peripherals
(theSYST
field will be included). Inother words, the system timer (
SysTick
) will only be exposed to the end userwhen it's not used by the framework. Likewise, the end user will not be able
to use the
SysTick
as a hardware task when the application uses theschedule
API.
The text was updated successfully, but these errors were encountered: