-
Notifications
You must be signed in to change notification settings - Fork 11
Enable consumer of ec-slimloader-imxrt to construct FlashJournal #29
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,18 +43,19 @@ const MAX_SLOT_COUNT: usize = 7; | |||||||||||||||||||||
| pub type ExternalStorage = BlockingAsync<FlexSpiNorStorage<'static, READ_ALIGNMENT, WRITE_ALIGNMENT, ERASE_SIZE>>; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| pub struct Partitions { | ||||||||||||||||||||||
| pub state: Partition<'static, ExternalStorage, RW, NoopRawMutex>, | ||||||||||||||||||||||
| pub journal: FlashJournal<Partition<'static, ExternalStorage, RW>>, | ||||||||||||||||||||||
| pub slots: Vec<Partition<'static, ExternalStorage, RO, NoopRawMutex>, MAX_SLOT_COUNT>, | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
||||||||||||||||||||||
| // Allow async functions in traits for ImxrtConfig, as async trait methods are required for this API. | |
| // Note: async functions in traits are currently unstable in Rust. This lint suppression is intentional, | |
| // and should be revisited when the feature is stabilized or if trait design changes. |
Copilot
AI
Oct 17, 2025
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.
Making this trait method async is a breaking change that moves error handling responsibility to trait implementers. The original implementation had explicit panic handling with a descriptive message. Consider documenting the expected error handling behavior for FlashJournal::new failures, or provide guidance on how implementers should handle initialization errors.
| /// Initializes the partitions required for bootloading. | |
| /// | |
| /// # Error Handling | |
| /// Implementers are responsible for handling any errors that may occur during | |
| /// initialization (e.g., failures in `FlashJournal::new`). It is recommended to | |
| /// log errors with a descriptive message and either panic or return a default value, | |
| /// depending on the application's requirements. Consistent error handling should be | |
| /// ensured across all implementations. |
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.
The
FlashJournaltype is missing the mutex type parameter that was present in the originalPartition(NoopRawMutex). This creates an inconsistency with theslotsfield on line 47 which still specifiesNoopRawMutex. Verify thatFlashJournal's type parameters are correct and consistent with the partition's mutex requirements.