We are using nRF51822 in our custom board. We just remain two pin ------ SCLK and SWDIO Can we programming by STLink ? what's the step? 1.using nrfgo studio to programming SoftDevice 2.using keil to download? thanks!
We are using nRF51822 in our custom board. We just remain two pin ------ SCLK and SWDIO Can we programming by STLink ? what's the step? 1.using nrfgo studio to programming SoftDevice 2.using keil to download? thanks!
I can program via OpenOCD trunk. Also could program softdevice by hand using by downloading binary to correct addresses.
openocd -f interface/stlink-v2.cfg -f target/nrf51_stlink.tcl -c "program <path_of_the_bin> <address>"
I use jlink at last .
I use Eclipse with GCC, GDB and OpenOCD to program the nrf51
using the ST-Link/V2.
To flash the SoftDevice using OpenOCD and any compatible Jtag (tested with ST-Link/V2), you can do:
$ openocd -f interface/stlink-v2.cfg -c "transport select hla_swd; set WORKAREASIZE 0x4000;" -f target/nrf51.cfg -c "init ; reset halt ; nrf51 mass_erase ; sleep 500 ; flash write_image .bin 0x0 ; verify_image .bin 0x0 ; mww 0x4001e504 1 ; mww 0x10001000 $(STARTADDRESS) ; mww 0x4001e504 0 ; shutdown"
The application start address depends on the SoftDevice you use. The address value is given in the SoftDevice release notes (0x16000
for s110 v. 7.3.0 for instance). Do not forget to change your linker script with this offset value.
Have a look at this Makefile to see other targets to program your application or to erase the flash.
Regards, Christopher
You can use IDAP-Link with a simple command to flash all 3 parts without needing mergehex.
IDAPnRFProg s110_nrf51_8.0.0_softdevice.hex Blinky_ble.hex dfu_nrf51.hex
It also works with OpenOCD, Keil, Crossworks, etc. Full CMSIS-DAP with Drag & Drop feature
I am able to flash the BLE SDK on nrf51 Soc in Linux environment using openocd by below command.
openocd -c "set WORKAREASIZE 0;" -f /usr/share/openocd/scripts/interface/ftdi/SWD_FT.cfg -f /usr/share/openocd/scripts/target/nrf51.cfg -c "init; reset halt; program <<path of your file>> 0X0 verify; shutdown;"
Now I am looking to flash BLE application on different flash address but not sure how to proceed with openocd. Anyone have idea regarding the same.