This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

JTAG Programmer (under $100, not a DK)

Hi Folks,

We have 6 factories that will be programming custom boards that use the nRF52832.  I'm one of the software developers and have been using a dev kit to program and debug the boards.

We want to now create a commissioner for the board and want to use something more "factory ready" for programming the boards via the JTAG port other than a development kit.

I've looked at: https://www.segger.com/products/debug-probes/j-link/models/model-overview/   And all the options seem to be an order of magnitude more expensive than the DK.  (Except for the education units which are off limits to us since we don't qualify.)

Has anyone found a programmer that is under $100?  Seems silly that there isn't one available.  (The factory workers don't need debug capability.)

thanks,

Bob

Parents Reply Children
  • Hi Bill,

    I appreciate all the detail.  We actually have other boards the use the ST-Link to program them.  Does the link you reference at the end of your post also deal with getting the ST-Link V2 to program the nRF52830 via JTAG header?

    (I tried using the ST-Link V2 4 months ago and couldn't get it to work, inside SES or from the command line.)

    thanks,

    Bob

  • I didn't write anything about that in that file, no. However I do have one of the knock-off ST-Link V2 dongles (similar to the Adafruit one) and I have gotten it to work with the nRF52 chip using OpenOCD. (In my case the nRF52840, but that doesn't matter.)

    The main problem with the cheap knockoff ones is cabling it up to the board properly. The nRF52 boards I have all use the mini 10-pin SWD header, while the ST-Link dongles come with a 4-wire patch cable which doesn't fit the pins. I have yet to find a proper cable to go directly from the dongle to the SWD header. I have another 20-pin to 10-pin adapter which has a 20-pin socket, and I was able to fit the patch cable connectors to the pins on that socket, and then connect the 10-pin cable on the other end to my nRF52 board. It was a bit awkward because the patch cable doesn't grip the pins very well and you have to hold it still or else it'll lose connectivity.

    In my case I connected the GND, Reset, SWDIO and SWCLK pins. Really GND, SWDIO and SWCLK are the only 3 pins that matter. I don't have it set up now, but I can try to set it up later and post a picture. I didn't document that specifically because I wasn't sure what cabling to recommend since I basically just kludged something up with what I had available.

    -Bill

  • Below is a photo showing how I connected up the ST-Link V2 to the 20/10 pin adapter:

    The 20-pin connector has the standard ARM pinout, as shown below:

    The connections from the ST-Link to the 20-pin connector are:

    RST <--> pin 15

    SWDIO <--> pin 7

    SWCLK <--> pin 9

    GND <--> pin 10

    I use the following command with OpenOCD:

    openocd -f interface/stlink.cfg -f target/nrf52.cfg -c "gdb_flash_program enable" -c "gdb_breakpoint_override hard"

    When I run I get this:

    Open On-Chip Debugger 0.10.0+dev-00871-g11e5f022-dirty (2019-05-22-09:20)
    Licensed under GNU GPL v2
    For bug reports, read
    openocd.org/.../bugs.html
    Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
    Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
    force hard breakpoints
    Info : Listening on port 6666 for tcl connections
    Info : Listening on port 4444 for telnet connections
    Info : clock speed 1000 kHz
    Info : STLINK V2J21S4 (API v2) VID:PID 0483:3748
    Info : Target voltage: 3.231012
    Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
    Info : Listening on port 3333 for gdb connections

    This is with an OpenOCD built from the current git repo. My host system is FreeBSD/amd64 11-RELEASE. From here I use GDB to debug and flash the chip. (I built my own GDB with --target=arm-none-eabi.) Again, this is with an nRF52840 chip, but it works the same with the nRF52832.

    I don't use SES so I don't know if there's any special configuration needed for it.

    -Bill

Related