From: Dobrica Pavlinusic Date: Mon, 5 Jul 2021 14:12:02 +0000 (+0200) Subject: IMAX B6 clone with M0517 cpu over openocd X-Git-Url: http://git.rot13.org/?p=openocd-rpi2-stm32;a=commitdiff_plain;h=03c3f13e82d2a7892aca54b09fb520938f497209 IMAX B6 clone with M0517 cpu over openocd --- diff --git a/imax_b6/0.aprom b/imax_b6/0.aprom new file mode 100644 index 0000000..6dd4bbd Binary files /dev/null and b/imax_b6/0.aprom differ diff --git a/imax_b6/1.data b/imax_b6/1.data new file mode 100644 index 0000000..b6d7b94 Binary files /dev/null and b/imax_b6/1.data differ diff --git a/imax_b6/aprom.bin b/imax_b6/aprom.bin new file mode 100644 index 0000000..6dd4bbd Binary files /dev/null and b/imax_b6/aprom.bin differ diff --git a/imax_b6/config.bin b/imax_b6/config.bin new file mode 100644 index 0000000..e69de29 diff --git a/imax_b6/flash.txt b/imax_b6/flash.txt new file mode 100644 index 0000000..dc5724c --- /dev/null +++ b/imax_b6/flash.txt @@ -0,0 +1,2 @@ +FlashAprom /nuc/cheali-charger/src/hardware/nuvoton-M0517/targets/imaxB6-clone/cheali-charger-imaxB6-clone_2.01-e10.3.12-20210623_nuvoton-M0517.bin +FlashAprom /nuc/cheali-charger/src/hardware/nuvoton-M0517/targets/imaxB6-clone/cheali-charger-imaxB6-clone_2.01-e10.3.12-20210705_nuvoton-M0517.bin diff --git a/imax_b6/flash_data.bin b/imax_b6/flash_data.bin new file mode 100644 index 0000000..b6d7b94 Binary files /dev/null and b/imax_b6/flash_data.bin differ diff --git a/imax_b6/flash_data.bin-clean b/imax_b6/flash_data.bin-clean new file mode 100644 index 0000000..2eb0654 Binary files /dev/null and b/imax_b6/flash_data.bin-clean differ diff --git a/imax_b6/ldrom.bin b/imax_b6/ldrom.bin new file mode 100644 index 0000000..e69de29 diff --git a/imax_b6/openocd.sh b/imax_b6/openocd.sh new file mode 100755 index 0000000..4239b00 --- /dev/null +++ b/imax_b6/openocd.sh @@ -0,0 +1 @@ +openocd -s /nuc/cheali-charger/utils/M0517_flash_tools/tcl -f target_M0517_rpi.cfg -f M0517_flash.tcl -f M0517_unlock.tcl diff --git a/imax_b6/rpi2-swd.cfg b/imax_b6/rpi2-swd.cfg new file mode 100644 index 0000000..aeb5ed9 --- /dev/null +++ b/imax_b6/rpi2-swd.cfg @@ -0,0 +1,45 @@ +# +# Config for using Raspberry Pi's expansion header +# +# This is best used with a fast enough buffer but also +# is suitable for direct connection if the target voltage +# matches RPi's 3.3V and the cable is short enough. +# +# Do not forget the GND connection, pin 6 of the expansion header. +# + +adapter driver bcm2835gpio + +bcm2835gpio_peripheral_base 0x3F000000 + +# Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET +# These depend on system clock, calibrated for stock 700MHz +# bcm2835gpio_speed SPEED_COEFF SPEED_OFFSET +bcm2835gpio_speed_coeffs 146203 36 + +# Each of the SWD lines need a gpio number set: swclk swdio +# swd gpio pins swclk swio +bcm2835gpio_swd_nums 27 17 + +# If you define trst or srst, use appropriate reset_config +# Header pin numbers: TRST - 26, SRST - 18 + +#bcm2835gpio_trst_num 22 +#reset_config trst_only + +bcm2835gpio_srst_num 22 +# reset_config srst_only srst_push_pull + +# or if you have both connected, +# reset_config trst_and_srst srst_push_pull + +#adapter speed 100 +transport select swd + +## test which chip this is +#swd newdap chip cpu -enable +#dap create chip.dap -chain-position chip.cpu +#target create chip.cpu cortex_m -dap chip.dap +# +#init + diff --git a/imax_b6/target_M0517_rpi.cfg b/imax_b6/target_M0517_rpi.cfg new file mode 100644 index 0000000..590303d --- /dev/null +++ b/imax_b6/target_M0517_rpi.cfg @@ -0,0 +1,61 @@ +# script for nuvoton M0517 OpenOCD 0.10 on Linux using Raspberry Pi gpio pins + +# IMAX B6 clone pinout - Raspberry Pi +# +# DAT - pin 11 (gpio 17) +# CLK - pin 13 (gpio 27) +# RST - pin 15 (gpio 22) +# GND - pin 6 GND +# VCC - pin 2 5V +# + +adapter driver bcm2835gpio + +bcm2835gpio_peripheral_base 0x3F000000 + +# Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET +# These depend on system clock, calibrated for stock 700MHz +# bcm2835gpio_speed SPEED_COEFF SPEED_OFFSET +bcm2835gpio_speed_coeffs 146203 36 + +# Each of the SWD lines need a gpio number set: swclk swdio +# swd gpio pins swclk swio +bcm2835gpio_swd_nums 27 17 + +# If you define trst or srst, use appropriate reset_config +# Header pin numbers: TRST - 26, SRST - 18 + +#bcm2835gpio_trst_num 22 +#reset_config trst_only + +bcm2835gpio_srst_num 22 +# reset_config srst_only srst_push_pull + +# or if you have both connected, +# reset_config trst_and_srst srst_push_pull + +transport select swd + + +set _CHIPNAME M0517 +set _ENDIAN little +set _WORKAREASIZE 0x1000 +set _CPUTAPID 0x0bb11477 + + +swd newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID + +dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu + +target create $_CHIPNAME.cpu cortex_m -dap $_CHIPNAME.dap + +$_CHIPNAME.cpu configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 + +adapter speed 1000 +adapter srst delay 100 + +if {![using_hla]} { + # if srst is not fitted use SYSRESETREQ to + # perform a soft reset + cortex_m reset_config sysresetreq +}