IMAX B6 clone with M0517 cpu over openocd
[openocd-rpi2-stm32] / imax_b6 / target_M0517_rpi.cfg
1 # script for nuvoton M0517 OpenOCD 0.10 on Linux using Raspberry Pi gpio pins
2
3 # IMAX B6 clone pinout - Raspberry Pi
4 #
5 # DAT - pin 11 (gpio 17)
6 # CLK - pin 13 (gpio 27)
7 # RST - pin 15 (gpio 22)
8 # GND - pin 6 GND
9 # VCC - pin 2 5V
10 #
11
12 adapter driver bcm2835gpio
13
14 bcm2835gpio_peripheral_base 0x3F000000
15
16 # Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET
17 # These depend on system clock, calibrated for stock 700MHz
18 # bcm2835gpio_speed SPEED_COEFF SPEED_OFFSET
19 bcm2835gpio_speed_coeffs 146203 36
20
21 # Each of the SWD lines need a gpio number set: swclk swdio
22 # swd gpio pins      swclk swio
23 bcm2835gpio_swd_nums 27    17
24
25 # If you define trst or srst, use appropriate reset_config
26 # Header pin numbers: TRST - 26, SRST - 18
27
28 #bcm2835gpio_trst_num 22
29 #reset_config trst_only
30
31 bcm2835gpio_srst_num 22
32 # reset_config srst_only srst_push_pull
33
34 # or if you have both connected,
35 # reset_config trst_and_srst srst_push_pull
36
37 transport select swd
38
39
40 set _CHIPNAME M0517
41 set _ENDIAN little
42 set _WORKAREASIZE 0x1000
43 set _CPUTAPID 0x0bb11477
44
45
46 swd newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
47
48 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
49
50 target create $_CHIPNAME.cpu cortex_m -dap $_CHIPNAME.dap
51
52 $_CHIPNAME.cpu configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
53
54 adapter speed 1000
55 adapter srst delay 100
56
57 if {![using_hla]} {
58    # if srst is not fitted use SYSRESETREQ to
59    # perform a soft reset
60    cortex_m reset_config sysresetreq
61 }