Hi all,
Just want to share a host side program which talks to K210's serial bootloader to load firmware into the K210 without having to download it to the flash then boot from it.
The reason I want after this path is because I want to reduce board size and BOM, by eliminating an extra flash chip.
Also, K210 is pretty particular to flash chips. It has to be 1.8V, and it has to support QSPI. That basically means no small 2mm*3mm chips for me under $1.
So, instead of using more PCB area, I chose to bootload it from a host system, in this case, ESP32.
The current program was tested under Ubuntu 20.04 + Sipeed MAIX Bit, and it uses RTS/DTR logic to set boot mode and reset. There is a glitch prevention circuit just like on ESP32 boards.
This program is tailored for little-endian systems (due to some memcpy functions used to copy uint32_t directly to uint8_t), but you can easily swap the orders or use logic shifting to do the copies.
Have fun.