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

Programming nRF52832 with OpenOCD on Raspberry Pi3

Hello,

I'm trying to use raspberry pi to program nRF52832 on mass production. Because it's easy to do some test job with raspberry pi.

But there are still some issue I have no idea how to resolve them.

Env:

  • Raspberry Pi 3B+ (Software up-to-date)

  • OpenOCD (compile from github repo)

  • nRF52832 (Custom dev board, works fine with keil and SES on windows)

I tested the OpenOCD with programming a STM32 board, it works fine. So I think that it may not be the OpenOCD's issue.

When I'm trying programming nRF52832, the stdio printed these lines:

pi@raspberrypi:~/openocd_test/test $ sudo openocd -f nrf52test.cfg
 Open On-Chip Debugger 0.10.0+dev-00908-g9879f9bf (2019-06-13-13:35)
 Licensed under GNU GPL v2
 For bug reports, read
 http://openocd.org/doc/doxygen/bugs.html
 Info : BCM2835 GPIO JTAG/SWD bitbang driver
 Info : SWD only mode enabled (specify tck, tms, tdi and tdo gpios to add JTAG mode)
 Info : clock speed 1001 kHz
 Info : SWD DPIDR 0x2ba01477
 Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
 Info : Listening on port 3333 for gdb connections
 target halted due to debug-request, current mode: Thread
 xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
 Info : nRF52832-QFAA(build code: E0) 512kB Flash
 target halted due to debug-request, current mode: Thread
 xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
 target halted due to debug-request, current mode: Thread
 xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
 ** Programming Started **
 Info : Padding image section 0 at 0x00000964 with 1692 bytes
 Info : Padding image section 1 at 0x0001e7c0 with 2112 bytes
 Info : Flash write discontinued at 0x00033c5c, next section at 0x00078000
 Info : SWD DPIDR 0x2ba01477
 Error: Failed to read memory at 0x4001e400
 Error: Couldn't read NVMC_READY register
 Error: Failed to erase reg: 0x4001e508 val: 0x00006000
 Error: failed erasing sectors 0 to 51
 embedded:startup.tcl:449: Error: ** Programming Failed **
 in procedure 'script'
 at file "embedded:startup.tcl", line 26
 in procedure 'program' called at file "nrf52test.cfg", line 13
 in procedure 'program_error' called at file "embedded:startup.tcl", line 508
 at file "embedded:startup.tcl", line 449

The content of nrf52test.cfg shows below:

source ./raspi3.cfg
transport select swd

set WORKAREASIZE 0x2000

source [find target/nrf52.cfg]

init
reset halt
nrf5 mass_erase
reset halt
program ./firmware.hex verify reset exit
reset run
exit

And the config file raspi3.cfg:

interface 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
bcm2835gpio_swd_nums 25 24

Because I have tested programming STM32 board, so the connection problems could be exclude.

And I have tried to use `set WORKAREASIZE 0` instead of `0x2000`, it didn't work.

Parents Reply Children
No Data
Related