Skip to content

Commit 6c4c01a

Browse files
committed
Add erase-all directive
1 parent 8f67597 commit 6c4c01a

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,25 @@ you must do.
8787
brew tap ArmMbed/homebrew-formulae
8888
brew install arm-none-eabi-gcc
8989

90-
2. Install the JLink [software](https://www.segger.com/jlink-software.html)
90+
2. Install Nordic's [command line
91+
tools](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf5x_cltools%2FUG%2Fcltools%2Fnrf5x_installation.html)
92+
`mergehex` and `nrfjprog`. Ensure these tools are extracted and added to your path.
93+
94+
3. Install the JLink [software](https://www.segger.com/jlink-software.html)
9195
for your platform. You want the "Software and documentation pack".
9296

93-
3. Acquire a [JLink JTAG programmer](https://www.segger.com/jlink-general-info.html).
97+
4. Acquire a [JLink JTAG programmer](https://www.segger.com/jlink-general-info.html).
9498
The "EDU" edition works fine.
9599

96-
4. Program an app! With the JLink box attached to the target board:
100+
5. Program an app! With the JLink box attached to the target board:
97101

98102
make flash
99103

104+
will write the app and softdevice to the device. You can erase
105+
a chip with:
106+
107+
make erase-all
108+
100109
See the [make](https://github.com/lab11/nrf5x-base/tree/master/make) folder
101110
for a complete list of commands.
102111

make/Program.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ erase: $(BUILDDIR)
118118
$(Q)printf "w4 4001e504 2\nw4 4001e50c 1\nsleep 100\nr\nexit\n" > $(BUILDDIR)erase.jlink
119119
$(Q)$(JLINK) $(JLINK_FLAGS) $(BUILDDIR)erase.jlink
120120

121+
.PHONY: erase-all
122+
erase-all: $(BUILDDIR)
123+
$(Q)printf "erase\nsleep 100\nr\nexit\n" > $(BUILDDIR)erase.jlink
124+
$(Q)$(JLINK) $(JLINK_FLAGS) $(BUILDDIR)erase.jlink
125+
121126
.PHONY: gdb
122127
gdb:
123128
ifeq ($(UNAME_S),Darwin)

0 commit comments

Comments
 (0)