Author Topic: K210 serial bootloader host program  (Read 2760 times)

0 Members and 1 Guest are viewing this topic.

Offline blueskullTopic starter

  • Supporter
  • ****
  • !
  • Posts: 367
  • Country: cn
  • BA7LKP
K210 serial bootloader host program
« on: May 04, 2020, 12:01:21 pm »
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.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17830
  • Country: fr
Re: K210 serial bootloader host program
« Reply #1 on: May 04, 2020, 12:54:43 pm »
That's interesting.

I have decided against using K210 CPUs a while ago for a number of reasons I already mentioned, but this is still an interesting chip and your approach is certainly interesting. Do you have some figures regarding the typical throughput (say in KBytes/s) to load code into K210's RAM?

The approach could be not only useful to avoid a Flash chip, but could also be used to "re-purpose" the K210 on the fly, and if download times are reasonably short, that could definitely allow pretty interesting stuff.

Just took a quick look at your code and it seems simple enough that porting it to a non-hosted target should be straightforward too.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17830
  • Country: fr
Re: K210 serial bootloader host program
« Reply #2 on: May 04, 2020, 04:11:11 pm »
K210 can download at a faster speed, but the bootloader is fixed at 115200.
I can theoratically download a small SPL, then use the SPL to load a much larger program at a higher baudrate.

OK thanks. Wasn't sure if the bootloader rate could be changed or not.

So yeah, 10 KB/s seems pretty slow, but yes, writing a small executive should not be hard to do. I think this is what the flash application provided by Kendryte does already (but yes it's just meant to program flash.)
 

Offline ali_asadzadeh

  • Super Contributor
  • ***
  • Posts: 2147
  • Country: ca
Re: K210 serial bootloader host program
« Reply #3 on: May 05, 2020, 06:17:00 am »
Thanks for sharing, I could not find datasheet and User Manual for this K210,I always wanted to work with it, where did you find the docs?
ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 

Offline OwO

  • Super Contributor
  • ***
  • Posts: 1248
  • Country: cn
  • RF Engineer.
Re: K210 serial bootloader host program
« Reply #4 on: May 05, 2020, 07:01:13 am »
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.
W25Q64FW? 1.8V and supports QSPI.
 
The following users thanked this post: blueskull


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->