STM32H7 SBSFU Firmware Validation
Hi all,
I'm new to using the STM secure boot/secure firmware update and I'm trying to understand how the verification works when sending a new firmware image to the board. I got SBSFU running on an STM32H750B-DK dev board and successfully loaded the example UserApp program from the SBSFU extension package. I then tried to corrupt the firmware image file by flipping a single bit in a copy of the firmware file created with python script utilizing the shutil.copyfile() method, which from its documentation does not copy file metadata. From what I understand, when I try to load the corrupted image onto the board using Tera Term and selecting the "Download a new Fw image" option, after verifying the keys the SBSFU should verify the integrity of the new firmware image by checking both the header and the rest of the file compared to the current image. Is my understanding correct? Or does the SBSFU only verify the image signature?
This brings me to my issue. In some cases, the new corrupted image loads and runs without issues, even without the same metadata as the previous image and with a flipped bit, though in other cases the SBSFU properly rejects the corrupted image. This seems to have to do with the position of the flipped bit - if the bit is earlier in the file it is not rejected. I'd like to understand why it's not being rejected in certain cases. Is it because the SBSFU is able to handle such a small "corruption" in some cases? Are there areas of the firmware image that don't need to be validated and so there could be a flipped bit? Any help would be greatly appreciated.
