diff options
-rw-r--r-- | SConstruct | 2 | ||||
-rw-r--r-- | openocd.cfg | 23 |
2 files changed, 24 insertions, 1 deletions
@@ -36,6 +36,6 @@ sources = \ firmware = env.Program('suzumebachi.elf', Glob('*.cpp') + Glob('*.c') + sources)
env.Depends(firmware, 'ch.ld')
-env.Command('prog', ['suzumebachi.elf'], 'stm32loader -p /dev/tty.usbmodemfd1412 -ewv suzumebachi.elf')
+env.Command('prog', ['suzumebachi.elf'], 'openocd -f openocd.cfg -c flash_chip')
Default('suzumebachi.elf')
diff --git a/openocd.cfg b/openocd.cfg new file mode 100644 index 0000000..2343753 --- /dev/null +++ b/openocd.cfg @@ -0,0 +1,23 @@ +telnet_port 4444
+gdb_port 3333
+
+interface ft2232
+
+ft2232_vid_pid 0x1457 0x5118
+ft2232_layout "jtagkey_prototype_v1"
+ft2232_device_desc "USB<=>JTAG&RS232"
+
+reset_config trst_and_srst
+
+source [find target/stm32.cfg]
+
+proc flash_chip {} {
+ halt
+ stm32x mass_erase 0
+ reset halt
+ flash write_image suzumebachi.elf 0 elf
+ reset
+ shutdown
+}
+
+init
|