Using JTAG Wiggler with STM32

There was a problem programming STM32 boards with the JTAG Wiggler device, specifically the stm32f10x_pp.cfg file located under the Scripts directory of any generated project needs some alterations:

Replace everything after the interface section (which ends with the “jtag_speed 0” line) with the following:

  1. #use combined on interfaces or targets that can't set TRST/SRST separately
  2. reset_config trst_and_srst
  3.  
  4. #jtag scan chain
  5. #format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
  6. jtag_device 4 0x1 0xf 0xe
  7. jtag_device 5 0x1 0x1 0x1e
  8.  
  9. #target configuration
  10. daemon_startup reset
  11.  
  12. #target <type> <startup mode>
  13. #target cortex_m3 <endianness> <reset mode> <chainpos> <variant>
  14. target cortex_m3 little run_and_halt 0
  15. run_and_halt_time 0 30
  16.  
  17. working_area 0 0x20000000 16384 nobackup
  18.  
  19. #flash bank <driver> <base> <size> <chip_width> <bus_width>
  20. flash bank stm32x 0x08000000 0x00010000 0 0 0