How to build the NOR flash image?

Since the vendor provided image doesn’t enable U-boot serial output, it’s almost impossible to debug boot problems, and impossible to have an elegant way to switch kernels.

Is there any procedure to rebuild the U-boot part of the SPI flash?

I think you use ROCK 5B, you can follow this guide to build u-boot:

You can refer to how armbian build its u-boot spi flash:, which will add GPT partition table.