Let the MCU (e.g., STM32) Compiler Automatically Embed the Firmware CRC32 for the Bootloader’s Integrity Check

Let the MCU (e.g., STM32) compiler automatically embed the firmware CRC32 for the bootloader’s integrity check. Two int32 values, crc32Value and crc32Value2, are reserved at the very end of FLASH. The check works the same way in every case: first verify crc32Value; if it is incorrect, check crc32Value2. If neither is correct, the program is faulty and the bootloader enters its error-handling stage.