I missed a detail in a previous post…
“truncate” can be used to enlarge a file…it can do more than shrink a file. Try it out on a small text file, verified with a hex editor before and after.
Note that if a serial console has any bytes of activity at all it will pause boot and wait for either a boot selection or go into the U-Boot shell. Should it look like serial console is halting something, then it might be that part of it put out an extraneous byte somewhere.
Just for curiosity…
When looking at the kernel-dtb partition versus what shows up after boot in “/proc/device-tree/” versus what is in any individual dtb file used during flash it might be useful to know that U-Boot itself uses a device tree, but that this device tree may differ from the kernel device tree. Some parts of drivers are in common between U-Boot and the kernel, while U-Boot may have its own driver in some cases. U-Boot definitely does not initialize as much as the full Linux kernel as well. Some of the hardware will be initialized and put into some state before Linux runs…U-Boot puts the device tree from the kernel-dtb partition into RAM along with the Linux kernel (and any initrd), and then Linux runs (essentially overwriting U-Boot). I don’t know if U-Boot does any editing of the kernel-dtb before it goes into RAM, but it might…and certainly there could be some state inherited by Linux which U-Boot left even though the parameter is not specified. Parts of what you see in device tree code may end up ignored by the Linux stage…parts of what is purely for U-Boot might cause some hardware to inherit this state.