-
Notifications
You must be signed in to change notification settings - Fork 869
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
embassy-stm32 support g0 second flash bank #3711
embassy-stm32 support g0 second flash bank #3711
Conversation
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.
thank you!
Would be nice to have some feedback on how to deal with the now diverging options/registers other than the conditional compilation
conditional compilation is the way to go. it's a giant pain but there's no better alternative really :(
It has occurred to me that there might be an issue with this code for dual bank 256kb or less devices. The way the idx variable is calculated in the page erase method does not take into account the dual flash banks. This is 'fixed' for 512kbit devices by the 7bit bit mask for the page number. Another device will for example attempt to erase bank 2 page 64, instead of bank 2 page 0. This was an issue that arguably existed before already as bank 2 was just unavailable. I will read up on the full set of available G0/G4 variants and see if i can come up with a more general solution. In the meantime could you elaborate on:
|
From what I can tell this will be an issue for
Ill come with a proper solution that works for these devices once I'm back from vacation. |
I don't know, maybe the person who wrote the code wasn't aware of it.
this is something that Embassy should definitely support and is currently a bit lacking. Currently embassy-stm32 assumes single-bank for some chips and just breaks in dual-bank mode (for example G4, in dual bank it has a hole in the address space between the two banks). It's possible it assumes dual-bank for other chips, not sure. I think what would make most sense is a It also has implications for stm32-data, because the memory map changes depending on the mode. G4 has the hole, also G4 and others change the sector size. |
Integration of changes made in embassy-rs/stm32-data/pull/556: Addition of dual flash bank support for G0.
Would be nice to have some feedback on how to deal with the now diverging options/registers other than the conditional compilation