This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Firmware flashing using JLinkExe

I'm using JLinkExe (J link commander) for Linux to flash the application firmware on NRF51822_QF_AA target. The following have worked so far, but I'd like to confirm and have some doubts. The typical JLinkExe session invoked as root on my Linux system is as below:

$ sudo JLinkExe
.....................
Info: Found Cortex-M0 r0p0, Little endian.
Info: FPUnit: 4 code (BP) slots and 0 literal slots
Info: CoreSight components:
Info: ROMTbl 0 @ F0000000
.......................
......................
......................
Cortex-M0 identified.
Target interface speed: 100 kHz

J-Link>si 1
J-Link>speed 2000
J-Link>device nrf51822
J-Link>loadbin testing.bin 0x16000
J-Link>r
J-Link>g
J-Link>exit

The reason, I pass

0x16000

as the address to loadbin, because this is the same load address that I've set in my linker configuration file under ~/nrf_sdk_v6.1.0/nrf51822/Source/templates/gcc/gcc_nrf51_s110_xxab.ld.

snip from gcc_nrf51_s110_xxab.ld:

SEARCH_DIR(.)
GROUP(-lgcc -lc -lnosys)

MEMORY
{
  FLASH (rx) : ORIGIN = 0x00016000, LENGTH = 0xA000 
  RAM (rwx) :  ORIGIN = 0x20002000, LENGTH = 0x2000 
}


INCLUDE "gcc_nrf51_common.ld"

I see the same load address in the final map file. snip from testing.map:

Memory Configuration

Name             Origin             Length             Attributes
FLASH            0x00016000         0x0002a000         xr
RAM              0x20002000         0x00002000         xrw
*default*        0x00000000         0xffffffff

My questions are:

  1. Is it correct way of doing, or Am I missing something ? According to this thread, I should invoke loadbin as

    J-Link>loadbin testing.bin 0
    
  2. In that same thread, what does, w4 4001e504 1 stands for and why is it needed? I'm not sure if I invoked it for the first time or not, but all other times, I'm not invoking that (w4 4001e504 1) command during flashing the application firmware .

    J-Link>w4 
    Syntax: w4 <Addr>, <Data>
    

My environment is:

  • Linux + ARM GNU Toolchain
  • Target: nrf51822QF_AA (256kB flash memory)
  • Flash utility: JLinkExe for Linux
  • Segger J-link interface between the target board and PC
  • Softdevice s110
  • Custom application firmware
Parents Reply Children
No Data
Related