How this works
Flash-based bootloaders often require each image/partition to start on an erase-block boundary. Padding needed = (alignment − (size mod alignment)) mod alignment — this is exactly what tools like truncate, a custom padding script, or your build system's image post-processing step need to compute before writing a raw image to flash or generating a flash layout.