Skip to content

H7 hi mem flash #1224

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

H7 hi mem flash #1224

wants to merge 2 commits into from

Conversation

usbalbin
Copy link
Member

@usbalbin usbalbin commented May 6, 2025

No description provided.

Comment on lines 1 to 3
_modify:
ICSR:
name: ISR
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@burrbull
What am I doing wrong here?

Without this fix:

$ cargo c --features stm32h7b3,rt,defmt
[...]
error[E0599]: no method named `isr` found for struct `Periph<stm32h7::stm32h7b3::rtc::RegisterB
lock, 1476411392>` in the current scope
   --> src/rtc.rs:765:26
    |
765 |                 self.reg.isr().modify(|_, w| w.wutf().clear_bit());
    |                          ^^^
    |
help: there is a method `icsr` with a similar name
    |
765 -                 self.reg.isr().modify(|_, w| w.wutf().clear_bit());
765 +                 self.reg.icsr().modify(|_, w| w.wutf().clear_bit());
[...]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reference I can see ICSR here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or perhaps this should not even be done in the first place. There does seem to be quite a bit of differences between the RTC in RM0455 as compared to RM0433. In RM0433 we have the battery backed ram in RTC_BKP[0-31]R but I can not seem to find that in RM0455 even though it is mentioned as a feature from what I can tell.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not do this on PAC level. H7A/B have newer RTC.
ISR and ICSR work different.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thank you. Makes sense.

Copy link
Member Author

@usbalbin usbalbin May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know how one is supposed to access the battery backed sram from the rm0455 devices? Is that supposed to be accessable throught the pac as with the other devices or is the hal supposed to use some other method like raw pointers or arrays in linker sections?

CR[12]:
_modify:
SSN[12]:
name: SNB
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this? Do you think this should be done? From what I can tell, the SSN in RM0455 4.9.4 seems to do the same thing as SNB from rm0433 4.9.4, however at a different bit position and width

rm0455

Bits 12:6 SSN1: Bank 1 sector erase selection number
These bits are used to select the target sector for an erase operation (they are unused
otherwise). SSN1 can be programmed only when LOCK1 is cleared to 0.
0x00: Sector 0 of user flash bank 1 selected
0x01: Sector 1 of user flash bank 1 selected
..

rm0433

Bits 10:8 SNB1: Bank 1 sector erase selection number
These bits are used to select the target sector for a sector erase operation (they are unused
otherwise). SNB1 can be programmed only when LOCK1 is cleared to 0.
000: sector 0 of bank 1
001: sector 1 of bank 1
...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you want me to revert this too :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. I'm fine with both variants.

@usbalbin usbalbin force-pushed the h7-hi-mem-flash branch from 0e693ea to a641879 Compare May 7, 2025 18:19
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.

2 participants