summaryrefslogtreecommitdiff
path: root/nrf51.md
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-05-31 15:48:15 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2015-05-31 15:48:15 +0200
commit8f45739d02f02c226452f7f62c4dc195e6e13b38 (patch)
tree4531e03453f54da36d865b3bfe6b23253edb9dbe /nrf51.md
parent4d0ab32f13438f7f911062088d9bdfb786a3dfce (diff)
downloadphone_remote_nrf51-8f45739d02f02c226452f7f62c4dc195e6e13b38.tar.gz
phone_remote_nrf51-8f45739d02f02c226452f7f62c4dc195e6e13b38.tar.bz2
phone_remote_nrf51-8f45739d02f02c226452f7f62c4dc195e6e13b38.tar.xz
phone_remote_nrf51-8f45739d02f02c226452f7f62c4dc195e6e13b38.zip
o Party functional LCD code.
Diffstat (limited to 'nrf51.md')
-rw-r--r--nrf51.md101
1 files changed, 88 insertions, 13 deletions
diff --git a/nrf51.md b/nrf51.md
index 765af1e..0737ca0 100644
--- a/nrf51.md
+++ b/nrf51.md
@@ -1,5 +1,17 @@
# NRF51 Firmware Development Notes
+# Documentation
+
+nRF51-specific documentation:
+
+* [nRF51822 Product Specification](http://www.nordicsemi.com/eng/nordic/Products/nRF51822/nRF51822-PS/20339)
+* [nRF51822 Reference Manual](http://www.nordicsemi.com/eng/nordic/Products/nRF51822/nRF51-RM/20337)
+
+Generic ARM documentation:
+
+* [Cortex™-M0 Devices Generic User Guide](http://infocenter.arm.com/help/topic/com.arm.doc.dui0497a/DUI0497A_cortex_m0_r0p0_generic_ug.pdf)
+* [Cortex™-M0 Technical Reference Manual](http://infocenter.arm.com/help/topic/com.arm.doc.ddi0432c/DDI0432C_cortex_m0_r0p0_trm.pdf)
+
# Chip Details
## Address Map
@@ -21,26 +33,89 @@
### Flash and RAM Areas
-* nRF51822-xxAA flash: 0x0000 0000 => 0x0002 0000, RAM: 0x2000 0000 => 0x2000 4000
-* nRF51822-xxAB flash: 0x0000 0000 => 0x0001 0000, RAM: 0x2000 0000 => 0x2000 4000
-* nRF51822-xxAC flash: 0x0000 0000 => 0x0002 0000, RAM: 0x2000 0000 => 0x2000 8000
+| Device | Flash ||| RAM |||
+Device | Size | Start | End | Size | Start | End |
+ ------- | ------ | ----------- | ----------- | ------ | ----------- | ----------- |
+`xxAA` | 256kB | 0x0000 0000 | 0x0002 0000 | 16kB | 0x2000 0000 | 0x2000 4000 |
+`xxAB` | 128kB | 0x0000 0000 | 0x0001 0000 | 16kB | 0x2000 0000 | 0x2000 4000 |
+`xxAC` | 256kB | 0x0000 0000 | 0x0002 0000 | 32kB | 0x2000 0000 | 0x2000 8000 |
+[Available resources for chip variants]
# Debugging
screen /dev/ttyACM0 115200,-ixon,-ixoff
-## Documentation
+## GDB
-### Nordic
+ (gdb) print <symbol>
-* [inRF51822 Product Specification](http://www.nordicsemi.com/eng/nordic/Products/nRF51822/nRF51822-PS/20339)
-* [inRF51822 Reference Manual](http://www.nordicsemi.com/eng/nordic/Products/nRF51822/nRF51-RM/20337)
+ (gdb) info registers
-### Generic ARM
+## Remote Debugging
-* [Cortex™-M0 Devices Generic User Guide](http://infocenter.arm.com/help/topic/com.arm.doc.dui0497a/DUI0497A_cortex_m0_r0p0_generic_ug.pdf)
-* [Cortex™-M0 Technical Reference Manual](http://infocenter.arm.com/help/topic/com.arm.doc.ddi0432c/DDI0432C_cortex_m0_r0p0_trm.pdf)
+* `target remote localhost:2331`
+* `disconnect` or `detach`
+* the generic `monitor` commands sends jlink-specific commands. `monitor reset`
+
+When using GDB, make sure you use the version for arm:
+
+ arm-none-eabi-gdb
+
+I often start GDB like this:
+
+ arm-none-eabi-gdb -ex "file build/*.out" -ex "target remote localhost:2331" -ex "monitor reset"
+
+This select the correct image so you can say `break main`, connects to the JLink remote GDB server and performs a reset of the board.
+
+# The JLink tools
+
+## JLinkGDBServer
+
+This program is normally executed as
+
+ JLinkGDBServer -if SWD
+
+It should find the target and wait for an TCP connection on port 2331.
+
+Sometimes it will refuse to listen to the socket, just waiting (around 10 seconds) for a while seems to fix the problem.
+
+Example output:
+
+ $ JLinkGDBServer -if SWD
+ SEGGER J-Link GDB Server V4.98e Command Line Version
+
+ JLinkARM.dll V4.98e (DLL compiled May 5 2015 11:49:35)
+
+ -----GDB Server start settings-----
+ GDBInit file: none
+ GDB Server Listening port: 2331
+ SWO raw output listening port: 2332
+ Terminal I/O port: 2333
+ Accept remote connection: yes
+ Generate logfile: off
+ Verify download: off
+ Init regs on start: off
+ Silent mode: off
+ Single run mode: off
+ Target connection timeout: 0 ms
+ ------J-Link related settings------
+ J-Link Host interface: USB
+ J-Link script: none
+ J-Link settings file: none
+ ------Target related settings------
+ Target device: unspecified
+ Target interface: SWD
+ Target interface speed: 1000kHz
+ Target endian: little
-* nRF51822-xxAA flash: 256 kB, ram: 16kB
-* nRF51822-xxAB flash: 128 kB, ram: 16kB
-* nRF51822-xxAC flash: 256 kB, ram: 32kB
+ Connecting to J-Link...
+ J-Link is connected.
+ Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled May 4 2015 13:48:48
+ Hardware: V1.00
+ S/N: 681084376
+ Checking target voltage...
+ Target voltage: 3.30 V
+ Listening on TCP/IP port 2331
+ Connecting to target...WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.
+ Connected to target
+ Waiting for GDB connection...