Difference between revisions of "BMD301"

From HiveTool
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Install OpenOCD:
+
==Install OpenOCD==
  
 
  https://learn.adafruit.com/programming-microcontrollers-using-openocd-on-raspberry-pi/wiring-and-test
 
  https://learn.adafruit.com/programming-microcontrollers-using-openocd-on-raspberry-pi/wiring-and-test
  
  openocd -f interface/raspberrypi-native.cfg -c "transport select swd; set WORKAREASIZE 0" -f target/nrf51.cfg
+
  # openocd -f interface/raspberrypi-native.cfg -c "transport select swd; set WORKAREASIZE 0" -f target/nrf51.cfg
 +
# openocd -f interface/raspberrypi2-native.cfg -c "transport select swd; set WORKAREASIZE 0" -f target/nrf52.cfg
  
 
+
  # openocd
openocd -f interface/raspberrypi2-native.cfg -c "transport select swd; set WORKAREASIZE 0" -f target/nrf52.cfg
 
 
 
  # openocd                                                                                                                                          
 
 
  Open On-Chip Debugger 0.10.0+dev-00096-gf605a23 (2017-04-05-19:26)                                                                                                                   
 
  Open On-Chip Debugger 0.10.0+dev-00096-gf605a23 (2017-04-05-19:26)                                                                                                                   
 
  Licensed under GNU GPL v2                                                                                                                                                           
 
  Licensed under GNU GPL v2                                                                                                                                                           
Line 36: Line 34:
  
  
Telnet in to the OCD server
+
==Telnet in to the OCD server==
 
  telnet localhost 4444
 
  telnet localhost 4444
 
(must first apt-get install telnet)
 
(must first apt-get install telnet)
  
  
Need to turn off access port protection:
+
==Need to turn off access port protection==
  
 
https://devzone.nordicsemi.com/question/98540/how-do-i-disable-control-access-port-protection-on-nrf52-using-openocd/
 
https://devzone.nordicsemi.com/question/98540/how-do-i-disable-control-access-port-protection-on-nrf52-using-openocd/
Line 50: Line 48:
  
  
To cross compile on pi:
+
==To cross compile on Pi==
 
  gcc -mcpu=cortex-m4 -nostdlib <What Do YOU WANT>
 
  gcc -mcpu=cortex-m4 -nostdlib <What Do YOU WANT>
 
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=78649
 
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=78649
 +
 +
Simple, but doesn't work:
 +
error:target CPU does not support ARM mode
 +
 +
 +
==Flashing the nRF5x==
 +
https://devzone.nordicsemi.com/question/124061/how-to-load-hex-to-nrf51-with-openocd/
 +
 +
 +
==Alternative BLE software stacks==
 +
*http://mynewt.apache.org

Latest revision as of 17:30, 7 April 2017

Install OpenOCD

https://learn.adafruit.com/programming-microcontrollers-using-openocd-on-raspberry-pi/wiring-and-test
# openocd -f interface/raspberrypi-native.cfg -c "transport select swd; set WORKAREASIZE 0" -f target/nrf51.cfg
# openocd -f interface/raspberrypi2-native.cfg -c "transport select swd; set WORKAREASIZE 0" -f target/nrf52.cfg
# openocd
Open On-Chip Debugger 0.10.0+dev-00096-gf605a23 (2017-04-05-19:26)                                                                                                                  
Licensed under GNU GPL v2                                                                                                                                                           
For bug reports, read                                                                                                                                                               

BCM2835 GPIO nums: swclk = 25, swdio = 24
BCM2835 GPIO config: srst = 18
srst_only separate srst_gates_jtag srst_push_pull connect_deassert_srst
adapter speed: 10000 kHz
cortex_m reset_config sysresetreq
srst_only separate srst_nogate srst_push_pull connect_deassert_srst
adapter_nsrst_delay: 100
adapter_nsrst_assert_width: 100
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 4061 kHz
Info : SWD DPIDR 0x2ba01477
Error: Could not find MEM-AP to control the core
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* nrf52.cpu          cortex_m   little nrf52.cpu          unknown
Error: Could not find MEM-AP to control the core
Error: Target not examined, will not halt after reset!
TARGET: nrf52.cpu - Not halted
in procedure 'reset' called at file "openocd.cfg", line 14
in procedure 'ocd_bouncer'


Telnet in to the OCD server

telnet localhost 4444

(must first apt-get install telnet)


Need to turn off access port protection

https://devzone.nordicsemi.com/question/98540/how-do-i-disable-control-access-port-protection-on-nrf52-using-openocd/

dap apreg 1 0x0c
dap apreg 1 0x04 0x01
reset


To cross compile on Pi

gcc -mcpu=cortex-m4 -nostdlib <What Do YOU WANT>

https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=78649

Simple, but doesn't work:

error:target CPU does not support ARM mode


Flashing the nRF5x

https://devzone.nordicsemi.com/question/124061/how-to-load-hex-to-nrf51-with-openocd/


Alternative BLE software stacks