The checksum used there with only 32 bits is probably just a simple summation of the contents of the Flash area. Such checksums were still used in earlier EPROMs of the last century because their storage capacity was small enough to detect possible bit errors.
Because of this procedure, the significantly larger flash area of the STM32 and the small data width of the checksum, the sense is rather questionable, especially since the STM32CubeProgrammer also offers a bit-by-bit comparison of the programmed area after programming.
As @TDK has already indicated, the use of the STM32CubeProgrammer would be strongly recommended.
Regards
/Peter
In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.