@@ -225,6 +225,44 @@ As you can see above, as we loop through, we can see *i* changing. Cool huh?
225
225
If you want to learn how to use GDB I highly recommend [ Art of debugging] [ 5 ] by
226
226
Norman Matloff and Peter Jay Salzman.
227
227
228
+ # Loading code with Softdevice
229
+
230
+ In the above example, we used the * blinky* code which did not have a Softdevice.
231
+ Since most of our use of this chip will use BLE and hence a Nordic Softdevice, let's
232
+ take the SDK example * ble_app_hrs* and see how to load it.
233
+
234
+ First, build * ble_app_hrs* to generate the program hex file. Then use the
235
+ Nordic * mergehex* tool to combine the softdevice and program as given below.
236
+ The softdevice cam be found in * components/softdevice* folder of the SDK.
237
+
238
+ ```
239
+ c:\mahesh\tmp>mergehex -m s132_nrf52_3.0.0_softdevice.hex nrf52832_xxaa.hex -o out.hex
240
+ Parsing input hex files.
241
+ Merging files.
242
+ Storing merged file.
243
+
244
+ c:\mahesh\tmp>ls -l
245
+ total 467
246
+ -rw-r--r-- 1 info Administ 130859 May 8 08:33 nrf52832_xxaa.hex
247
+ -rw-r--r-- 1 info Administ 476926 May 8 08:35 out.hex
248
+ -rw-r--r-- 1 info Administ 346118 Jul 25 2016 s132_nrf52_3.0.0_softdevice.hex
249
+ ```
250
+
251
+ Now load it using our Black Magic Probe clone as shown before.
252
+
253
+ ```
254
+ (gdb) load out.hex
255
+ Loading section .sec1, size 0x964 lma 0x0
256
+ Loading section .sec2, size 0xf000 lma 0x1000
257
+ Loading section .sec3, size 0xe740 lma 0x10000
258
+ Loading section .sec4, size 0x1000 lma 0x1f000
259
+ Loading section .sec5, size 0xa5a4 lma 0x20000
260
+ Start address 0x0, load size 169544
261
+ Transfer rate: 17 KB/sec, 968 bytes/write.
262
+ (gdb) run
263
+ ```
264
+
265
+ And now you'll see the HRS app running happily on ** bluey** !
228
266
229
267
# Using GDB in the Atom editor
230
268
0 commit comments