adapter driver jlink

transport select swd

set WORKAREASIZE 0x400
set HT32_SRAM_SIZE 8192
set HT32_FLASH_SIZE 65536

source [find target/ht32f165x.cfg]

adapter speed 5000

proc program {file} {
    init
    reset halt
    flash write_image erase $file 0x00000000
    reset run

    echo "\n PROGRAM COMPLETE!!!"
}
