-
Notifications
You must be signed in to change notification settings - Fork 747
Add DateTime HIL, and implement for RPi Pico and STM32f429ZI #3559
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
Conversation
capsules/extra/src/date_time.rs
Outdated
let grant_enter_res = self.apps.enter(appid, |app, _| { | ||
app.subscribed = true; | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to actually store the command here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait how does this work? If an app calls get time while a different app calls set time, how does the second app actually get the time?
Thank you very much for the suggestions. I updated the function names and the capsule documentation as instructed. |
boards/nucleo_f429zi/openocd.cfg
Outdated
@@ -12,4 +12,3 @@ hla_vid_pid 0x0483 0x374b | |||
set WORKAREASIZE 0x10000 | |||
|
|||
source [find target/stm32f4x.cfg] | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert to what? As far as I remember, I never edited this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If github is showing a change, then the file changed. Looks like a line was removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very close!!
boards/nucleo_f429zi/openocd.cfg
Outdated
@@ -12,4 +12,3 @@ hla_vid_pid 0x0483 0x374b | |||
set WORKAREASIZE 0x10000 | |||
|
|||
source [find target/stm32f4x.cfg] | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If github is showing a change, then the file changed. Looks like a line was removed.
I deleted the endline in the openocd.cfg file, it seems that in my original text editor it was automatically ignored. The file should now be the same as in the main tock code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is close just need to remove extra changes and indent comments for register definitions to match.
8ab28af
to
bd7e228
Compare
For some reason, after I ran make format to clear up indentation, the "Pull Request Labeler / triage" test fails with the message " YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key (56:1)". Although I tried reverting the changes, the error persists. I do not have experience on this topic, would you have any suggestions as to how should I fix this issue? |
Error in our tooling, sorry :( Rebase/merge once #3673 goes through and it should be fixed. |
Can you run |
Done. |
The best thing to do would be to squash commits and then rebase on the latest master. |
92e11cd
to
d56a939
Compare
I squashed all the commits, now waiting for the checks to finish. |
capsules/extra/src/date_time.rs
Outdated
let grant_enter_res = self.apps.enter(appid, |app, _| { | ||
app.subscribed = true; | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait how does this work? If an app calls get time while a different app calls set time, how does the second app actually get the time?
The way it is meant to work, anytime an app calls to the capsule, its command is registered as subscribed. When the capsule ends the current task, it checks for any apps that have subscribed for a get or set operation. When a get operation is finished, the same result is passed to all apps that have subscribed for a get set (as they are the same values). Afterwards one of the queued set operations will be started. And then another get operation would queue if that is the case. |
parent 9264cbe author irina-b-dev <irina.bradu@stud.fils.upb.ro> 1626776251 +0300 committer Remus7 <remus.rughinis.007@gmail.com> 1695578584 +0300 parent 9264cbe author irina-b-dev <irina.bradu@stud.fils.upb.ro> 1626776251 +0300 committer Remus7 <remus.rughinis.007@gmail.com> 1695578576 +0300 parent 9264cbe author irina-b-dev <irina.bradu@stud.fils.upb.ro> 1626776251 +0300 committer Remus7 <remus.rughinis.007@gmail.com> 1695578566 +0300 added rtc ll driver and modified main for rp pico modified date_time capsule updated date_time capsules and pico main update for date_time capsule cleaned up warnings date_time capsule and rtc driver fixed bitshifting changed enter in grant from date time capsule tried async for rtc added setup for rtc modified rtc setup in main for pi pico updated date time capsule deleted unnecessary functions from rtc hil fixed rtc frequency and added date time settup handler added date time component and cleaned up code format rtc asynchronous interface removed rtc from time hil added date date_time hil fixed in_progressed flag setting, added comment for date_as_tuple function Update kernel/src/lib.rs Co-authored-by: Alexandru Radovici <msg4alex@gmail.com> deleted commented code rebase added rtc ll driver and modified main for rp pico updated date_time capsules and pico main update for date_time capsule changed enter in grant from date time capsule tried async for rtc updated date time capsule deleted unnecessary functions from rtc hil fixed rtc frequency and added date time settup handler added date time component and cleaned up code format rtc asynchronous interface removed rtc from time hil added date date_time hil fixed in_progressed flag setting, added comment for date_as_tuple function Update kernel/src/lib.rs Co-authored-by: Alexandru Radovici <msg4alex@gmail.com> deleted commented code rebase Rebased code to main and solved compilation errors Added RTC suppport on nucleo-stm32f429 board Changed date_time Capsule and date_time component Added documentation and support for rtc example Update boards/components/src/date_time.rs Co-authored-by: Alexandru Radovici <msg4alex@gmail.com> Update boards/components/src/date_time.rs Co-authored-by: Alexandru Radovici <msg4alex@gmail.com> Update boards/nucleo_f429zi/src/main.rs Co-authored-by: Alexandru Radovici <msg4alex@gmail.com> Added licence, minor change to date_time component Update boards/raspberry_pi_pico/src/main.rs Co-authored-by: Alexandru Radovici <msg4alex@gmail.com> Update boards/raspberry_pi_pico/src/main.rs Co-authored-by: Alexandru Radovici <msg4alex@gmail.com> Added license headers Updated nucleo board Cargo.toml Format License headers HIL Licence Header Update capsules/extra/src/date_time.rs Co-authored-by: Brad Campbell <bradjc5@gmail.com> Update kernel/src/hil/date_time.rs Change callback_set_date name to set_date_time_done Co-authored-by: Brad Campbell <bradjc5@gmail.com> Update kernel/src/hil/date_time.rs Updated comments Co-authored-by: Brad Campbell <bradjc5@gmail.com> Renamed funcitons Renamed date_time HIL functions and changed stm32f4xx PWR registers Changed capsule documentation Renamed struct Date to DateTimeValues Update chips/stm32f429zi/src/rtc.rs Co-authored-by: Brad Campbell <bradjc5@gmail.com> Added some comments in rtc code Update chips/stm32f429zi/src/lib.rs Co-authored-by: Brad Campbell <bradjc5@gmail.com> Update boards/raspberry_pi_pico/src/main.rs Co-authored-by: Brad Campbell <bradjc5@gmail.com> Update boards/raspberry_pi_pico/src/main.rs Co-authored-by: Brad Campbell <bradjc5@gmail.com> Update boards/raspberry_pi_pico/src/main.rs Co-authored-by: Brad Campbell <bradjc5@gmail.com> Update boards/raspberry_pi_pico/src/main.rs Co-authored-by: Brad Campbell <bradjc5@gmail.com> Update boards/raspberry_pi_pico/src/main.rs Co-authored-by: Brad Campbell <bradjc5@gmail.com> Update boards/raspberry_pi_pico/src/main.rs Co-authored-by: Brad Campbell <bradjc5@gmail.com> Update boards/nucleo_f429zi/src/main.rs Co-authored-by: Brad Campbell <bradjc5@gmail.com> Update boards/nucleo_f429zi/src/main.rs Co-authored-by: Brad Campbell <bradjc5@gmail.com> Moved pwr script from stm32f4xx to stm32f429zi Update chips/stm32f429zi/src/pwr.rs Co-authored-by: Brad Campbell <bradjc5@gmail.com> Update chips/stm32f429zi/src/pwr.rs Co-authored-by: Brad Campbell <bradjc5@gmail.com> Update chips/stm32f429zi/src/pwr.rs Co-authored-by: Brad Campbell <bradjc5@gmail.com> Update chips/stm32f429zi/src/pwr.rs Co-authored-by: Brad Campbell <bradjc5@gmail.com> Deleted endline Ran make format Minor changes Commend indents Ran git checkout origin/master boards/nucleo_f429zi/openocd.cfg Deleted unnecessary type casts Minor changes Repaired problems with rebase Deleted extra endlines
1269893
to
17098c3
Compare
What happens in the case that:
Won't App2 be issued a callback once the get finishes? Then App2 will continue execution as though the time was set, even though the set hasn't completed? Worse, the set will never actually happen, right? |
I seem to have uploaded an older, unfinished version of the capsule when I solved the rebase. Changing it now. |
Would you happen to know why 5 of the tests take still haven't reported any status? |
Head branch was pushed to by a user without write access
Need to fix CI errors. |
Head branch was pushed to by a user without write access
Pull Request Overview
This pull request adds a Date and Time HIL, driver and component. This includes low level drivers for Real Time Clock for nucleo-stm32f429zi and raspberry pi pico boards. The Real Time Clock for raspberry pi pico board was rebased for an older commit written for tock 1.0 (#2760). The code compiles with other changes made to the libtock-c project, including an example project to test Real Time Clock intended usage (tock/libtock-c#334).
Testing Strategy
This pull request was tested by running the implemented commands both in the board/main.src for the nucleo board, and also by running a program from the libtock-c userspace (setting and then printing current time each second).
TODO or Help Wanted
The Real Time Clock works for the two boards, RTC support for more boards might be added using the component, hil and capsule provided.
Documentation Updated
/docs
, or no updates are required.Formatting
make prepush
.make format
.