Changes between Version 31 and Version 32 of expansion/gw16126


Ignore:
Timestamp:
08/06/2019 10:45:43 PM (4 months ago)
Author:
Tim Harvey
Comment:

update nina-b3 programming steps to use PPA

Legend:

Unmodified
Added
Removed
Modified
  • expansion/gw16126

    v31 v32  
    680680To program you can use OpenOCD with the {{{sysfsgpio}}} interface as long as you have a kernel that supports GPIO in the ftdi-sio driver (Linux 4.20+).
    681681
    682 The following will create a gw16126.cfg OpenOCD interface file specifying SWD and mapping the SWCLK/SWDIO pins to the FT231X CBUS2/CBUS1 pins:
    683  1. Create an OpenOCD interface file for the GW16126 that defines the Linux gpio signals for SWD:
     682Note that the OpenOCD package from Ubuntu lacks the necessary nRF52840 support so we must either build OpenOCD from source manually or use the Gateworks Ubuntu PPA:
     683 * Installing from Gateworks Ubuntu PPA:
     684{{{#!bash
     685sudo add-apt-repository ppa:gateworks-software/packages
     686apt update
     687apt install openocd
     688}}}
     689 * Building from source:
     690{{{#!bash
     691apt install build-essential libusb-1.0-0-dev autoconf libtool pkg-config git
     692git clone git://git.code.sf.net/p/openocd/code openocd
     693cd openocd
     694./bootstrap
     695./configure --enable-sysfsgpio
     696make install
     697}}}
     698
     699Next you will need a gw16126.cfg OpenOCD interface file specifying SWD and mapping the SWCLK/SWDIO pins to the FT231X CBUS2/CBUS1 pins:
    684700{{{#!bash
    685701base=$(for i in $(ls -1d /sys/class/gpio/gpiochip*); do [ "ftdi-cbus" = "$(cat $i/label)" ] && cat $i/base; done)
     
    688704interface sysfsgpio
    689705transport select swd
    690 Show quoted text
    691706sysfsgpio_swd_nums $((base + 2)) $((base + 1))
    692707EOF
    693708}}}
    694  2. Build OpenOCD from git master for nRF52840 support:
    695 {{{#!bash
    696 apt-get install build-essential git flex bison pkg-config libtool autoconf automake texinfo libusb-1.0-0-dev
    697 git clone git://git.code.sf.net/p/openocd/code openocd
    698 cd openocd
    699 ./bootstrap
    700 ./configure --enable-sysfsgpio
    701 make install
    702 }}}
    703   - alternatively you can fetch from a zip archive via {{{wget --no-check-certificate
    704  https://repo.or.cz/openocd.git/snapshot/refs/heads/master.zip}}} but note that the bootstrap script which checkout jimtcl as git submodules so this doesn't really help
    705   - I've been having issues on bionic because NTP isn't working right which leads to certificate issues. You can disable by {{{git config --global http.sslverify false}}}
    706  3. Program firmware:
     709
     710Now you can program an Intel HEX file with OpenOCD:
    707711{{{#!bash
    708712# openocd -f gw16126.cfg -f target/nrf52.cfg \
    709    -c init -c "reset init" -c halt -c "nrf5 mass_erase" -c "program zephyr_uart_hci.hex verify" -c reset -c exit
     713 -c init -c "reset init" -c halt -c "nrf5 mass_erase" -c "program zephyr_uart_hci.hex verify" -c reset -c exit
    710714Open On-Chip Debugger 0.10.0+dev-00563-gda4b2d5b (2018-10-20-01:03)
    711715Licensed under GNU GPL v2