Serial Boot and Rescue Mode Tips or Guide

Hi, I had bricked my Omnia. I managed to fix it. I managed to recover it using this guide in part https://docs.turris.cz/hw/omnia/serial-boot/ and partly this thread Bricked Omnia. How is it even possible, and how should one proceed in such a situation?
That is, I triggered boot over serial and started with ./kwboot -t -b uboot-turris-omnia-uart-spl.kwb -B 115200 /dev/ttyUSB0
Then I tried to give env default -a && saveenv, but I kept getting an error message.
Then I tried to reflect uboot via tftp, but without success. At this point I went into rescue mode, in which before I could not get in and I saw a system start up, but I don’t know which one.
After the restart, I tried again to use the recovery mode (4 LEDs) with a key inserted and boom, everything came back as before.
Does it seem a bit confusing to you like what? Well, me too. We would need someone more experienced to help improve the bricked device recovery guide.
I would also like to be able to use tftp, but on the official guide there is no hint on how to install or use the server.
I looked on the OpenWRT website and actually found more information, but after installing and configuring the aftpd package on Ubuntu, I still don’t succeed in the enterprise. Any clarification or suggestion is welcome. Thanks. PS: for anyone using this cable, https://www.adafruit.com/product/954 (which I purchased by looking at this forum), the correct order to get a connection is to place the black plug in order from the left, then the one white, finally the green one (red no).

This stuff how do you actually do it from the u-boot console?

NOR recovery

Once you have U-Boot running, you can get various images for example via tftp and write it to nor.

To download image from tftp server you need to get your network started, decide where to load it and load it. Assuming you have tftp server running on computer with ip 192.168.1.1 on WAN network, following U-Boot commands will get you image into RAM.

setenv autoload no
dhcp
setenv serverip 192.168.1.1
tftpboot ${kernel_addr_r} image

Now you have a file originally called image in RAM on your router. To write to NOR you have to know where it belongs.

To reflash U-Boot, your image file on tftp will be uboot-turris-omnia-spl.kwb and you need to write it from the beginning of the NOR.

sf probe
sf update ${kernel_addr_r} 0 ${filesize}

To recover rescue system, your image file will be omnia-initramfs-zimage and you need to start writing it after first megabyte that is reserved for U-Boot

sf probe
sf update ${kernel_addr_r} 0x00100000 ${filesize}

After that, you can call reset command or hit a reset button and see your router booting again.

I have faced an issue described here - NOR recovery - SPI flash failed in erase step