Closed minux closed 5 years ago
Some comments on my own ideas.
What about a multi-stage bootloader? K210's bootrom only use default uart frequency -- 115200 so if the isp rom is too complex it will take a lot of time on download this rom into board. We can first have a tiny rom, maybe only few hundred bytes that: 1. config uart baudrate 2. download other parts of isp rom from accelerated uart. And, for exmaple I don't want to use encrypted rom or compression, they can be excluded from the second rom.
@Yangff
After commit https://github.com/kendryte/kflash.py/commit/030de69064c961139952ac9a890a46eee19aeccc , it more fast than before. But very sorry that CH340 not support very well.
For fast programming,
# This will enable opoenec super-baudrate!
python3 kflash.py -b 4500000 -B goE firmware.bin
# Trainer could use 8000000 baudrate!
python3 kflash.py -b 8000000 -B trainer firmware.bin
# Dan could use 3000000 baudrate!
python3 kflash.py -b 3000000 -B dan firmware.bin
Although there are still many things that have not been done, the PyPI package upload is complete.
https://pypi.org/project/kflash/
Usage:
sudo usermod -a -G dialout $(whoami)
sudo pip3 install kflash
kflash --help
kflash -b 115200 -B goE -s -t hello_world.bin
kflash -b 8000000 -B trainer firmware.bin
kflash -p /dev/ttyUSB0 firmware.bin
Cool! Thanks!
And we can split the script into two parts.
Also, we should consider adding the source code and build files for the embedded ISP program to this repository. (I'd also like to support compression for unencrypted serial downloads. Use lzip for the best compression ratio and speed up; but that means adding yet another host dependency. probably we should just stick with deflate.)