-
Notifications
You must be signed in to change notification settings - Fork 484
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
STM32H750 flash corruption with double buffering enabled #1700
Comments
I would think #1696 has the same root cause, since the chips are from the same family and probably uses the same flash algo. |
I found a builtin target stm32h743xx which works much better than the Keil.STM32H7xx pack, after being modified for the H750 flash layout. I made 100 programmings in a row without any problems, whereas the CMSIS H750 pack flash loader failed after on average 2 programmings. By the way, I think the H743 support added in #1567 lists the wrong sector size for the flash, which should be 128K, but is listed as 8K in the flash algo dict, and 32K in the memory map. I assume this must be a mistake. Is this the correct issue tracker for CMSIS-PACK bugs? Otherwise I think this issue can be closed. I will send a PR adding the verify support and a new builtin target for H750. |
Just to add a data point: Programming and verifying work flawlessly with the same probes when using OpenOCD. |
Hi,
It seems there is a problem with the flash write routines for STM32H750. A simple program like the below gives corrupted flash for about one out of five attempts for a 30 kB file, without any type of sign that something went wrong.
Looking at the diff, it appears that some pages are only partially written with only the first part containing correct data, and the rest of the page being 0xff.
I was very surprised to find that neither the FileProgrammer helper, nor any of the underlying classes, support built in verification of the flash contents after programming. This is a fundamental feature of any flash programming tool. Of course you can do a manual compare separately, but that command does not have the same file format support as FileProgrammer.
I added verification support to the FlashBuilder class for easier debug of this problem. I can send a PR after some cleanup and exposing through FileProgrammer if there is any interest.
After testing a lot of times with the verify support active, it seems corruption only happens with double buffering enabled, and regardless of whether using sector erase or chip erase (which is a lot slower on STM32H750 for some reason). I don't see any way to switch off double buffering except changing the builder code, since the builder method to disable it doesn't seem to be exposed all the way up to FileProgrammer.
The text was updated successfully, but these errors were encountered: