Nordic Semiconductor nRF51822 User Manual Download Page 45

Page 45 of 62

nRF51822 Development Kit User Guide v1.4

7 Debugging 

the 

nRF51822

For debugging with SEGGER J-Link, see 

 Appendix A 

on page 56. For general information of how to debug 

using the Keil μVision IDE, see 

http://www.keil.com/uvision/debug.asp

.

The following steps tell how to configure the debugger in Keil.

1. In the 

Project 

menu click

 Options for Target

 (

CTRL+F7

). 

2. Select

 

the

 Debug

 tab. 

3. To enter debugging mode click 

Start/Stop Debug Session

 or 

CTRL

+

F5

.

 Figure 31  

Start debugging mode

Summary of Contents for nRF51822

Page 1: ...t 2013 Nordic Semiconductor ASA All rights reserved Reproduction in whole or in part is prohibited without the prior written permission of the copyright holder nRF51822 Development Kit nRF51822 User Guide v1 4 ...

Page 2: ...2 4 Development kit configuration 14 4 1 Development environment 14 4 2 Kit setup 17 5 Hardware description 20 5 1 nRFgo nRF51422 DK modules 20 5 2 nRFready ANT USB dongle nRF2779 29 6 Flash programming and application development 31 6 1 Programming and erasing flash using nRFgo Studio 31 6 2 Application development 34 7 Debugging the nRF51422 43 7 1 nRF51422 debug features and precautions 44 8 So...

Page 3: ...User Guide follows a set of typographic rules that makes the document consistent and easy to read The following writing conventions are used Commands are written in Lucida Console Pin names are written in Consolas File names and user interface components are written in bold Internal cross references are italicized and written in semi bold 1 4 Development Kit release notes Date Kit version Descript...

Page 4: ...om www nordicsemi com 2 1 nRF51822 Development Kit hardware content Figure 1 nRF51822 DK hardware content 1 x nRF51822 DK PCB antenna module PCA10004 1 x nRF51822 DK SMA connector module PCA10005 1 x nRF51822 Development Dongle PCA10000 1 x J Link Lite CortexM 9 JTAG SWD Emulator 1 x Helical monopole SMA antenna 1 x USB cable 5 x nRF51822 chip samples 1 x 10 pin connector ...

Page 5: ...are Development Kit SDK Precompiled HEX files Source code Keil ARM project files S110 nRF51822 SoftDevice Master Control Panel 2 2 2 nRF51822 DK documentation nRF51822 Development Kit User Guide nRF51 Series Reference Manual nRF51822 PS S110 nRF51822 SoftDevice Specification nRF51 SDK nRF51822 PAN 2 2 3 Schematics Bill of Materials PCB layout files and production files The ZIP file and its subdire...

Page 6: ...ed to select the IDE that should be updated with the latest SEGGER DLLs Check the box for Keil MDK and any other IDEs you want to use with SEGGER 4 If you are using Keil MDK v4 54 go to http www segger com IDE_Integration_Keil html knownproblems Download JL2CM3 and copy it to keil ARM Segger This patch is necessary for the SEGGER debugger to work 5 Go to www nordicsemi com and log in to your Nordi...

Page 7: ...e Connect the hardware 1 Screw the antenna into the SMA connector on the nRF51822 DK SMA PCA10005 connector module 2 Ensure that header K1 has a jumper connecting pin 2 and 3 The two upper rows of P4 should have two jumpers placed vertically matching the 32 kHz marking SMA connector K1 header P4 ...

Page 8: ...m included in the nRFgo Starter Kit connect one cable between P8 PORT0 and P1 BUTTONS and one between P10 PORT1 and P2 LEDS on the nRFGo Motherboard Make sure the red marking on the cable is always connected to pin 1 as shown in the figure below 6 Connect the SEGGER J Link board to the nRF51822 module with the 10 pin flat cable 1 27 mm provided in the Development Kit 7 Connect a USB cable from the...

Page 9: ...re an update and if needed you will be prompted to begin the update If this occurs click OK and wait for the update to complete Note While updating the firmware you will see nRFgo Studio look similar to the image on the left below On completion of the update the Updating message will change to Upgrade as seen in the figure on the right however this option is not immediately available after the lat...

Page 10: ...pen the help file The nRF51822 device is capable of operating at voltages higher and lower than 3 3 V This can be tested when the debugger is not required for programming or debugging the application However for the J Link Lite Cortex M that is included in the kit to function correctly the supply voltage must be set to 3 3 V on the Motherboard At all voltages other than 3 3 V the J Link Lite Corte...

Page 11: ...ct which one you want to use 5 Click the Erase all button Load and run the Blinky project 1 Locate the Blinky project found under keil path ARM Device Nordic nRF51822 Board nrf6310 blinky_example arm 2 Open the Blinky project in Keil μVision by double clicking the blinky uvproj file 3 Select nRF51822 from the Select Target list and click Build or press F7 to compile the Blinky project 4 Click the ...

Page 12: ...ftDevice Type the product key included with the Development Kit into the Product Key field in My Page to download the S110 nRF51822 SoftDevice Follow these steps to program your device 1 Open nRFgo Studio 2 In the Device Manager select the motherboard your module is connected to 3 Select the module 4 If you have more than one SEGGER debugger connected you need to select which one you want to use 5...

Page 13: ... All Programs Nordic Semiconductor Master Control Panel 2 Make sure the Development Dongle is detected The Master Emulator item list should show COMnn xxxxxxxxx nn gives the COM port number xxxxxxxxx is the SEGGER serial number printed on the dongle Restart the application if it doesn t appear in the item list Before continuing make sure you have selected the correct device by verifying the serial...

Page 14: ... v1 4 8 Click Enable services You should see the Heart Rate Measurement characteristic and Battery Level being notified every few seconds with a different value the Heart Rate Measurement Battery Level value line will blink green for each notification ...

Page 15: ... 9 driver not included in this kit For installing drivers for the SEGGER J Link Lite CortexM 9 visit www segger com and go to the Downloads section Select the J Link Lite and download the software and documentation You must correctly install the drivers for the device to use the J Link debugger with Keil MDK See Appendix A on page 56 4 1 1 Development environment setup The nRF51822 device can be p...

Page 16: ...nfiguration for 2 4 GHz based development USB USB USB Keil µVision IDE J Link Lite Application Programming Erase Via J Link Examples and Applications written for Keil Configure Voltage nRFgo Studio nRFgo Starter Kit 10 pin Flat Cable SAMSUNG nRF51822 module nRF51822 DK nRF51 SDK ...

Page 17: ...ow show the relationship between the hardware and software components and the Motherboard s Note The Keil μVision IDE is not included in the kit content Figure 3 nRF51822 DK configuration for Bluetooth 4 0 single mode USB USB Keil µVision IDE J Link Lite Application Programming Erase Via J Link Examples and Applications written for Keil Configure Voltage nRFgo Studio nRFgo Starter Kit 10 pin Flat ...

Page 18: ...1822 Development Kit User Guide v1 4 4 2 Kit setup Figure 4 Kit setup P8 P10 P1 P2 USB connected to computer USB connected to computer 10 pin 2 54 mm flat cable 10 pin 1 27 mm flat cable J Link Lite CortexM nRF51 module ...

Page 19: ...DS are required to connect the correct I Os to the LEDs for the example projects in Chapter 3 Quick start on page 6 and for projects in the SDK Note With the nRFgo Studio application you can control the supply voltage VTG to the connected nRF51822 DK module as described in Turn on and set the supply voltage on page 9 4 2 2 nRF51822 Development Dongle PCA10000 The nRF51822 Development Dongle PCA100...

Page 20: ...4 Connect the JTAG SWD emulator using the 10 pin 1 27 mm flat cable supplied with the kit to the nRF51822 DK module at P3 and to your computer with a USB cable as shown in Figure 6 Figure 6 nRF51822 DK module connected to the SEGGER J Link Lite CortexM 9 ...

Page 21: ...0005 are delivered with an unprogrammed nRF51822 chip 5 1 1 Key features The nRF51822 DK modules have the following key features nRF51822 flash based SoC solution 2 4 GHz compatible with nRF24L devices Bluetooth low energy compatible Current Shunt Monitor CSM for current measurements nRFgo Motherboard integration PCB antenna PCA10004 only SMA connector compatibility PCA10005 only SWD interface con...

Page 22: ...Page 22 of 62 nRF51822 Development Kit User Guide v1 4 5 1 2 Hardware pictures Figure 7 nRF51822 DK module PCA10004 top Figure 8 nRF51822 DK module PCA10004 bottom ...

Page 23: ...Page 23 of 62 nRF51822 Development Kit User Guide v1 4 Figure 9 nRF51822 DK module PCA10005 top Figure 10 nRF51822 DK module PCA10005 bottom ...

Page 24: ...4 of 62 nRF51822 Development Kit User Guide v1 4 5 1 3 Block diagram Figure 11 nRF51822 DK module block diagram Ext A1 Ext B1 Analog nRF51822 Matching network SMA PCB antenna CSM SWD Osc 16 MHz Osc 32 768 kHz ...

Page 25: ... P0 05 P0 28 11 12 P0 29 P0 06 13 14 P0 07 P0 30 13 14 Not in use GND 15 16 GND GND 15 16 GND Not in use 17 18 Not in use Not in use 17 18 Not in use Not in use 19 20 Not in use Not in use 19 20 Not in use GND 21 22 GND GND 21 22 GND Not in use 23 24 Not in use BoardID 23 24 GND Not in use 25 26 RESET GND 25 26 GND Not in use 27 28 Not in use Not in use 27 28 BoardID_EE P0 08 29 30 P0 09 P0 16 29 ...

Page 26: ...ts are routed through the extension connectors to the Motherboard To avoid noise from the Motherboard the 0 resistors must be removed Figure 13 Analog inputs connector P5 on the nRF51822 DK board Table 1 Analog input connector P5 AIN0 1 2 AIN1 AIN2 3 4 AIN3 AIN4 5 6 AIN5 AIN6 7 8 AIN7 AREF0 9 10 GND Pin Label 0 resistor 1 AIN0 R7 2 AIN1 R8 3 AIN2 R9 4 AIN3 R10 5 AIN4 R11 6 AIN5 R12 7 AIN6 R13 8 AI...

Page 27: ...Figure 14 SWD interface connector P3 Table 2 SWD interface connector pin description VTG 1 2 SWDIO GND 3 4 SWDCLK GND 5 6 NC NC 7 8 NC GND 9 10 NC Pin Label Description 1 VTG Reference voltage for programmer 2 SWDIO Serial Wire Debug Data 3 GND Ground 4 SWDCLK Serial Wire Debug Clock 5 GND Ground 6 NC No Connection 7 NC No Connection 8 NC No Connection 9 GND Ground 10 NC No Connection ...

Page 28: ...n connector P4 Pin 1 and Pin 3 for XL1 and Pin 2 and Pin 4 for XL2 This is the default position of the jumpers when shipped Note The 32 768 kHz crystal has to be selected for the Bluetooth examples to work If the jumpers are placed in the position I O on connector P4 Pin 3 and Pin 5 for XL1 and Pin 4 and Pin 6 for XL2 P0 26 and P0 27 connects to the Motherboard and can be used for normal I O Figur...

Page 29: ...drop voltage For current measurements using the CSM the jumper on connector K1 must be placed on Pin 2 and Pin 3 This is the default position of the jumpers when shipped Current on the nRF51822 module is measured on connector K2 as voltage proportional to the current For current measurements using the jumper P7 on the Motherboard the jumper on connector K1 must be placed on Pin 1 and Pin 2 Figure ...

Page 30: ...ided by the SEGGER chip The PCA10000 can be loaded with Master Emulator firmware that when combined with the Master Control Panel gives you a peer device for nRF51822 that you can use to test the wireless connection Note PCA10000 can be reprogrammed if overwritten 5 2 1 Key features The PCA10000 has the following key features nRF51822 flash based SoC solution Bluetooth low energy compatible 2 4 GH...

Page 31: ...D is connected to dedicated I Os on the nRF51822 chip The connections are shown in Table 3 Table 3 LED connection The LEDs are active low meaning that writing a logical zero 0 to the output pin will illuminate the LED Figure 21 LED configuration Color GPIO Red P0 21 Green P0 22 Blue P0 23 USB Voltage regulator Matching network nRF51822 Antenna Segger OB VBUS Data UART SWD VCC_nRF Osc 32 768 kHz Os...

Page 32: ... Table 5 nRF51822 Development Dongle UART configuration Note The UART signals are routed directly to the SEGGER chip The pins should only be used for UART In order to use the USB to UART bridge the software on the nRF51822 has to enable flow control For details on how to set up the UART with flow control see the nRF51 Series Reference Manual nRF51822 SEGGER IC GPIO UART UART P0 00 RTS CTS P0 01 TX...

Page 33: ...ogram and erase the S110 nRF51822 SoftDevice or another application HEX file on the nRF51822 chip If you want to start developing on the nRF51822 chip without using the S110 nRF51822 SoftDevice see Section 6 1 4 Programming a SoftDevice on page 35 6 1 Programming and erasing flash using nRFgo Studio Use nRFgo Studio to program or erase a SoftDevice or application HEX file onto the nRF51822 chip No...

Page 34: ... and that the board is powered and configured for debugging Code memory Shows how the code memory is organized in one or two regions Region 0 and 1 and the size of each region For devices containing a SoftDevice the code memory is divided in two regions with the SoftDevice in Region 0 The tool shows you how much memory is used by the SoftDevice and how much is left for the application Memory readb...

Page 35: ...ram SoftDevice tab 2 Click Browse and select the HEX file to program 3 Select whether to enable or disable readback protection of Region 0 4 Set the SoftDevice size This sets the size of the code memory region 0 and will not be available if the size is defined by the HEX file Note The S110 nRF51822 SoftDevice can be downloaded from www nordicsemi com by logging into your MyPage account and enterin...

Page 36: ...Device before programming the chip Note This programming will not set up any memory Regions 1 Follow the steps in Section 6 1 1 Selecting a board to program on page 34 and then select the Program Application tab 2 Click Browse and select the HEX file to program 3 Select whether to enable or disable readback protection of the entire chip If you enable readback protection you will have to do an Eras...

Page 37: ... address The application data area must be placed after the SoftDevice data area Table 6 shows examples for setting up the start address and size depending on the code and data size used by the SoftDevice The example is based on a chip with 256 kB of code memory and 16 kB of RAM Table 6 SoftDevice memory layout Note See the nRF51822 Product Specification for details on the total code memory and RA...

Page 38: ...ide v1 4 6 2 1 1 Memory layout configuration in Keil IDE To access the Keil IDE memory layout 1 Click the Project menu and select Options for Target 2 Select the Linker tab 3 Check Use memory layout from Target Dialog Figure 23 Keil linker settings ...

Page 39: ...ng 128 kB of code memory and 8 kB of RAM SoftDevice B described in Table 6 on page 37 Base code memory address 0x20000 and available code memory size is 0x20000 128 kB Base RAM memory address 0x20002000 and available RAM size is 0x2000 8 kB Figure 24 Memory layout with example SoftDevice Table 7 Memory layout Memory Description IROM1 Start Specify the start address for the application code Size Sp...

Page 40: ...ck versions and is supplied in the S110 nRF51822 SoftDevice Specification The user application sets its call stack size plus the amount needed by the SoftDevice It then writes the stack pointer at the first address of the application Reset Vector Note Using Keil with the ARMCC toolchain the call stack size can be set using the Stack_Size definitions in your projects startup file typically arm_star...

Page 41: ...rom the Project menu The Options for Target dialog box appears 2 Select the Debug tab 3 Apply the Use option and select the J Link J Trace debugger from the list 4 Set Driver DLL to SARMCM3 DLL 5 Set Dialog DLL to TARMCM1 DLL Other options can be selected as needed To take full advantage of the debugger and its features the following are advised Breakpoints Load Application at Startup Memory Displ...

Page 42: ... protocol and maximum speed Select SW in the Port drop down 8 In Max Clock the maximum speed for the debugging port cannot be exceeded 1 MHz A proper configuration is shown in Figure 26 Figure 26 Target driver setup 9 Click Start Stop Debug Session CTRL F5 in the Keil IDE to start debugging Figure 27 Debugger initiation ...

Page 43: ...sed by the protocol stack Protected peripherals are described in the S110 nRF51822 SoftDevice Specification Configure the debugger and compile and link the application code Download the application using the Keil IDE download button To configure and start the download 1 Select Options for Target in the Project menu 2 Select the Utilities tab in the Options for Target dialog box 3 Click Settings 4 ...

Page 44: ... the device The code memory area available for the user application can be erased by doing the following 1 In the Target options dialog select the Utilities tab 2 Click Settings and select Erase Full Chip 3 Uncheck Program and Verify A normal download procedure will erase the device application code memory area Figure 30 Erasing Note To erase the whole device including the SoftDevice refer to Sect...

Page 45: ... general information of how to debug using the Keil μVision IDE see http www keil com uvision debug asp The following steps tell how to configure the debugger in Keil 1 In the Project menu click Options for Target CTRL F7 2 Select the Debug tab 3 To enter debugging mode click Start Stop Debug Session or CTRL F5 Figure 31 Start debugging mode ...

Page 46: ...stem Viewer windows The System Viewer enables you to select device peripherals and see their contents in separate windows In the View menu point to System Viewer and select the peripheral you want to see The peripheral register values are displayed in their respective pane in Keil as seen in Figure 32 More information on System Viewer can be found at http www keil com uvision db_view_sysview asp F...

Page 47: ...eral registers that are restricted or blocked by the SoftDevice will be invisible to the debugger as well Information on the SoftDevice configuration and memory resource mapping can be found in the S110 nRF51822 SoftDevice Specification Note Avoid single stepping to the protected area Instead set the breakpoint right after SVC calls while debugging and run the application to the actual breakpoint ...

Page 48: ...Page 48 of 62 nRF51822 Development Kit User Guide v1 4 Figure 34 Setup with breakpoint after an SVC call ...

Page 49: ...the UART on the nRF51822 module The following steps show how to get set up for DTM testing 1 Mount one of the nRF51822 modules either PCA10004 or PCA10005 onto the nRFgo Motherboard 2 Connect a double cable or two single cables between P15 and P9 on the Motherboard as shown in Figure 35 The UART data pins RXD and TXD will be present on the I O port pins P2 0 and P2 1 as shown in Table 8 on page 51...

Page 50: ...Page 50 of 62 nRF51822 Development Kit User Guide v1 4 Figure 35 UART setup for DTM USB UART S11 P15 P9 J Link Lite Cortex M ...

Page 51: ...use with Bluetooth test equipment If you don t have a Bluetooth tester you can access the interface using this Development Kit and nRFgo Studio to run the tests Note In nRFgo Studio the Program button under Direct Test Mode UART Interface will not work on the nRF51 platform P9 P15 P2 1 TXD P2 0 RXD ...

Page 52: ... device should be connected to your computer Make sure it is also connected to the nRF51822 development module to ensure the program is downloaded to the correct target 5 Go to the Flash menu and click Download to load the program or click the Load icon You are now ready to start DTM testing either using the Direct Test Mode UART interface included in nRFgo Studio or connecting 3rd party equipment...

Page 53: ...unt see Section 2 2 Downloadable content on page 5 The SDK is downloaded as a MSI file a windows installer and is installed by running the application When installing the SDK you can select Keil MDK Support Master Control Panel and or Custom install Keil MDK support installs Keil μVision example project files the code memory programming algorithm for the J Link debugger and the Nordic nRF51 series...

Page 54: ... the breakpoint or step over any SVC instructions See Section 7 1 2 Debugging an application when a readback protected SoftDevice is present on page 47 for more details I have a problem sending receiving data using the USB to UART bridge In order to use the USB to UART bridge the software on nRF51822 has to enable flow control When reconnecting the PCA10000 using the USB cable the terminal program...

Page 55: ...ntrol Panel software and the drivers for Segger OB JLinkCDCInstaller have been installed and that the nRF51 Development Dongle PCA10000 has been plugged into a USB port on your computer The Master Control Panel connects to the nRF51 Development Dongle PCA10000 but reports No response from master emulator in the Log You haven t programmed the nRF51 Development Dongle with the Master Emulator Firmwa...

Page 56: ...ith the SEGGER debugger Only the following step Download and install SEGGER drivers is needed Download and install SEGGER drivers 1 Download the latest SEGGER J Link software and documentation pack from http www segger com jlink software html 2 Download and run the J Link Software and documentation pack for Windows from http www segger com jlink software html The serial number from your SEGGER J L...

Page 57: ...4 54 Download JL2CM3 and copy it to keil ARM Segger This patch is necessary for the SEGGER debugger to work 5 Plug in the J Link Lite CortexM 9 module with USB cable The LED will blink while the driver installation occurs Wait until the LED is continuously lit Figure 37 J Link Lite CortexM 9 serial number location LED Serial number ...

Page 58: ...n IDE 2 Click Target Options on the toolbar or click Project menu and select Options for Target Figure 38 Keil Target configuration 3 Under the Debug tab in the Use list select J LINK J Trace Cortex option as shown in Figure 39 4 Click Settings as shown in Figure 39 Both the SEGGER Control Panel and the Keil Target Driver Setup will open Figure 39 Selecting J Link debugger in Keil ...

Page 59: ...mpted with the message A new firmware version is available for the connected emulator In this case click OK Figure 40 SEGGER control panel 5 Click the Debug tab shown in the figure Set Port to SW and Max Clock to 1 MHz as shown in Figure 41 Make sure that SN and IDCODE are populated properly and click OK Figure 41 Debug settings ...

Page 60: ...e J Link device for target programing Figure 42 Flash settings 7 If the J Link serial number appears in the SN field the device is properly installed The default settings can be accepted by clicking OK closing both the SEGGER Control Panel and Keil target Driver Setup ...

Page 61: ...l injury Nordic Semiconductor ASA customers using or selling these products for use in such applications do so at their own risk and agree to fully indemnify Nordic Semiconductor ASA for any damages resulting from such improper use or sale Contact details For your nearest distributor please visit http www nordicsemi com Information regarding product updates downloads and technical support can be a...

Page 62: ...nRF51822 module with DTM on page 52 July 2013 1 3 Updated content to match v2 1 0 of the hardware February 2013 1 2 Updated minor documentation errors January 2013 1 1 Updated content to match v2 0 of the hardware Updated the hardware content in Chapter 5 Hardware description on page 21 programming information in Chapter 8 Testing the physical layer with Direct Test Mode on page 49 and Chapter 9 S...

Reviews: