-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
flash: Add program/erase parallelism support for STM32F4x #67919
flash: Add program/erase parallelism support for STM32F4x #67919
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.
LGTM, but I have a question:
I can see that the size of write is decided on write at run-time, at line 114, as the size is passed there.
Wouldn't it be most efficient for the driver to select the largest possible write size?
For example user is presented with write-block-size == 2, so every buffer address and size needs to be two bytes aligned, but the same buffer may be 4 or 8 bytes aligned which means that for the driver it would be most efficient to select write by that size.
Max write size depends on MCU voltage.
Unaligned buffer is handled with |
Hm. Interesting, could not find the info in STM32F4 docs, but not a platform specialist here.
You have two alignments here: source and destination; memcpy aligns source buffer, you could also use here What I mean by changing write alignment is that it is probably most efficient, although I do not know the platform, to write by the highest possible chunk. |
It's in the STM32F412 reference manual RM0402 Rev 6, 3.5.2 Program/erase parallelism.
Is
Yes, it would be the most efficient, but in this case, the chunk size depends on applied voltage, so the Fun fact: |
Thanks, now I can see this. Very interesting.
Check what will give you better results. I suspect that
Nice to know I am not the only one.
I guess user has to check that before sending board to the field. |
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.
LGTM.
I have left comment on possible usage of `UNALIGNED_GET, but that is up to the committer to validate.
You probably want to update copyrights. |
Clang compiles it to the same instructions. It's just a decision between
and
I must admit that UNALIGNED_GET looks nice, but let the code owner decide 😄
Google is already in copyrights. Should I change the year? |
ST people decide then.
Yes, date but that is up to your company policy. |
|
The implementation uses the same approach as STM32F1x. Program/erase speed can be set by setting 'write-block-size' flash property to 1, 2, 4 or 8. Signed-off-by: Patryk Duda <patrykd@google.com>
34feeff
to
d5eadcf
Compare
Changed |
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.
LGTM, Thanks.
Though I have a concern on the documentation of this configurability and how one can guess this is actually a tunable parameter when reading the binding.
I'm not blocking since I can see that this is already the case on STM32F1.
Option I see is to add per series variants of st,stm32-nv-flash
with new write-block-size
prop defined as an enum with proper description.
The implementation uses the same approach as STM32F1x.
Program/erase speed can be set by setting 'write-block-size' flash property to 1, 2, 4 or 8.