Findings by Riscure:
bl2/ext/mcuboot/flash_map.c:flash_area_align()
The variable flash_info ->program_unit is uint32_t, but converted to uint8_t when returning.
Scope of the task:
Change the return value of flash_area_align() to uint32_t
Examine the code base, and change the variables according to the new return type, where the flash_area_align() is called.