pinetime

flashing pinetime with infinitime

You can flash the pinetime with the swd interface. Which is based on the jtag standard but only uses 4 pins. This interface can be found on the inside of the pinetime.

I bought the following st-link programmer on aliexpress

connect the wires

st-probe

You can use the stlink software from github to inspect you device. I installed the stlink package on archlinux to install it

st-info --probe
Found 1 stlink programmers
  version:    V2J37S7
  serial:     300014000A0000393333574E
  flash:      0 (pagesize: 0)
  sram:       0
  chipid:     0x0000
  descr:      unknown device

openocd

run

openocd \
    -c 'source [find interface/stlink.cfg]' \
    -c 'transport select hla_swd' \
    -c 'source [find target/nrf52.cfg]' \
    -c 'init'

connect to the running openocd instance

telnet 127.0.0.1 4444

in the telnet console you can type commands like:

> targets
    TargetName         Type       Endian TapName            State
--  ------------------ ---------- ------ ------------------ ------------
 0* nrf52.cpu          hla_target little nrf52.cpu          running

> flash banks
#0 : nrf52.flash (nrf5) at 0x00000000, size 0x00000000, buswidth 1, chipwidth 1
#1 : nrf52.uicr (nrf5) at 0x10001000, size 0x00000000, buswidth 1, chipwidth 1
 reset halt
[nrf52.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x000000d8 msp: 0x20010000
> program /home/user/Downloads/pinetime/infinitime/pinetime-mcuboot-app-image-1.14.0.bin 0x8000 verify reset
[nrf52.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x000000d8 msp: 0x20010000
** Programming Started **
nRF52832-QFAA(build code: E1) 512kB Flash, 64kB RAM
Adding extra erase range, 0x00062858 .. 0x00062fff
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
> reset run