
Page 37 of 62
nRF51822 Development Kit User Guide v1.4
6.2
Application development
The user application is compiled, linked, and downloaded independently from the SoftDevice. This means
that developing and debugging on a chip pre-programmed with a SoftDevice is similar to that of a blank
chip. The main differences are memory layout and the call stack size.
6.2.1
Configuring memory layout
Specific SoftDevice versions and stacks could have different requirements. Please review these before
proceeding.
The applications vector table must be set up differently depending on whether it will run on a chip that is
blank or pre-programmed with a SoftDevice.
The SoftDevice program area starts at address 0x0 and has a predefined size. The application start vector
must be placed right after the SoftDevice. The available size has to be set so that it uses the remaining
memory for the application. Similarly, the SoftDevice data area starts at the lowest RAM address. The
application data area must be placed after the SoftDevice data area.
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
nRF51
8
22 Product Specification
for details on the total code memory and RAM
available in the device. The amount of code memory and RAM used by the SoftDevice is
described in the
S110 nRF51
8
22 SoftDevice Specification
.
There are two ways to configure the memory layout:
• Using Keil IDE
• Using a Scatter file (not covered in this document)
Note:
The example code given by Nordic Semiconductor configures the memory layout in the Keil
IDE. Scatter file loading is not available when using the evaluation version of Keil IDE.
Device
configuration
SoftDevice
App. code
start address
Available code
memory
App. data
start address
Available
RAM
Code memory
usage
RAM usage
Blank chip
0 kB
0 kB
0x0
0x40000
0x20000000
0x4000
SoftDevice A
64 kB
2 kB
0x10000
0x30000
0x20000800
0x3800
SoftDevice B
128 kB
8 kB
0x20000
0x20000
0x20002000
0x2000