#target chip set _CHIPNAME riscv jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x20000c05 set _TARGETNAME $_CHIPNAME.cpu target create $_TARGETNAME.0 riscv -chain-position $_TARGETNAME $_TARGETNAME.0 configure -work-area-phys 0x22020000 -work-area-size 0x10000 -work-area-backup 1 $_TARGETNAME.0 configure -rtos auto echo "Ready for Remote Connections" $_TARGETNAME.0 configure -event reset-assert-pre { echo "reset-assert-pre" adapter_khz 100 } $_TARGETNAME.0 configure -event reset-deassert-post { echo "reset-deassert-post" adapter_khz 4000 #reg mstatus 0x80000000 #reg pc 0x21000000 } $_TARGETNAME.0 configure -event reset-init { echo "reset-init" # 4MHz for FPGA adapter_khz 4000 } gdb_memory_map enable gdb_flash_program disable riscv set_prefer_sba on riscv set_command_timeout_sec 1 init #reset init #jtag arp_init #resume #exit