BPI-M2 custom U-Boot instead of stock

It is possible to flash/update the onboard bootloader? From http://en.techinfodepot.shoutwiki.com/wiki/Banana_Pi_BPI_M2_Berry it looks like it is running Stock bootloader U-Boot 2014.07, is it possible to flash this with a custom built one? Saw for another BPI card a post described flashing stock bootloader over UART

you should make it clear which image you flashed and which uboot source code for custom build

If you upgrade just boot loader, that one might not be able to boot stock Linux without issues, and vice versa. Simply start with a fresh image. Last week I managed to built and boot latest M2 ultra with u-boot 2023.07 + kernel 6.1.y - by making an image with https://github.com/armbian/build

I’ve been testing with custom-built u-boot to create a bootloader for an embedded Linux (Yocto) device with two images. Wanted to know if it was possible to flash the onboard bootloader to also give the option of booting directly from USB, instead of having an SD card with a bootloader for devices where clients prefer to have the system on a USB stick instead of using a high endurance SD-card

you can try armbian image with bootloader in sd or emmc, and rootfs install to usb disk. and create your yocto image as this boot structure if using mainline source. no way to boot usb directly from onboard rom.