'ktool.py' - enhanced 'kflash.py'



  • Ktool is the enhanced version of kflash.py utility.

    It is compatible with kflash.py but introduces many new features and enhancement.

    Full sources of the enhanced 2nd stage ISP are available.
    More information and build instructions available here.

    How it works

    • On start, K210 board is reset into bootloader ISP mode by holding the K210 IO16 low and asserting the reset pin.
    • After reset, if IO16 is low, K210 executes the 1st stage ISP from ROM.
      1st stage ISP is only capable of loading K210 program to the requested SRAM address and execute it.
    • After the communication with the 1st stage ISP is established, ktool.py uploads the 2nd stage ISP to the K210 SRAM and executes it.
    • All further communication is performed via 2nd stage ISP

    Features:

    • Compatible with standard kflash.py, the same command line options are supported
    • Uses highly optimized 2nd stage ISP binary which loads in less than a second and supports many new features
    • Write firmware or data to any SPI Flash address
    • Write firmware/data using 4K chunks and 4K alignment
      (kflash always writes 64K chunks and the firmware address must be 64KB aligned)
    • Read Flash content to file is supported
    • Erase the SPI Flash chip
    • Reports SPI Flash chip manufacturer's JEDEC ID, 64-bit unique serial number and size
    • Optionally swap endianess on data write (useful when writing some kind of data, for example filesystem image)
    • Load the firmware to K210 SRAM end execute it.
      Loading is done by the 2nd stage ISP and can be performed at any baudrate supported by the board.
      It is now possible to load and start large firmwares at high speed...

    More on GitHub.