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

Is the Memory Layout correct?

Dear

I am trying to locate the data area of application code from device (nRF52840).

From here, it show me the bootloader will locate at from 0x000F 8000 – 0x000F E000(24KB) and application data will locate from some where of application area to 0x0007 7FFF.

So I do some thing below:

Step 1. Erase a dongle by " nrfjprog  --e" and flash "nRF5_SDK_16.0.0_98a08e2\examples\dfu\open_bootloader \pca10059_usb_debug"

Step 2. To take look the MBR and bootloader area by Programmer tools:

            MBR: 0x0000 0000  --- 0x0000 0FFF                           4096 Byte

            BL : 0x000E 0000   ---- 0x000F DFFF                          122880 Byte  

Step 3: Add hex of SD: S140 v7.0.1 in Programmer tools

           MBR或APP: 0x0000 0000  ---- 0x0000 0AFF          2816 Byte

           SD:  0x0000 1000  ---- 0x0002 6597                       152984 Byte 

Step 4: Add hex of Light-switch server for PCA10059 in Programmer tools:

           APP1:0x0002 7000  ---- 0x0004 6009                          126986 Byte

           APP2:0x0004 600C  ---- 0x0004 87bBB                                10160 Byte

Step 5: Write them to device(nrf52840), works,then take look the memory layout of the dongle:

               MBR: 0x0000 0000  --- 0x0000 0FFF                     4096 Byte

              SD: 0x0000 1000  --- 0x0002 6FFF                         155648 Byte

              APP: 0x0002 7000   --- 0x0004 87BB                     137148 Byte

              BL : 0x000E 0000   ---- 0x000F DFFF                      122880 Byte

Step 6: Provision  the dongle as a mesh node and bonding keys , Then take look the memory layout of the dongle again.

Nothing be changed.

I have some question about the  result above.

Q1: Why the bootloader area is not at from 0x000F 8000 – 0x000F E000(24KB) ? Why it need more 96KB?

Q2: The bootloader  occupy the application area which should be  application data.  Doesn't it have any effect on the application data?  How and when inform application code to make tit getting data area address?  How and from where I can get the address?

Q3: I noticed that when the application is loaded in, the application code is split into two parts. Can you explain why?Are there any special differences between the two parts?

Q4: After step 6, the application should have some data to be saved to data area, but the data do not be displayed in programmer tools. Does the data do not be read by programmer tools or they be written into the 96KB area which be occupied  by  bootloader ?  

Q5: Same as Q4 , The application be loaded by bootloader, so the bootloaser setting page should be created. The bootloader setting area and MBR parameter is empty too. Is there any link fro bootloader setting page and MBR parameter format.

Q6. Where and how I can get the application data size?

 

Thanks,

Di-sheng

  • Hi,

    Not sure if your link was going to the correct page. There are some good overviews of flash layout here: Dual-bank and single-bank updates. (Use "Copy URL" link on top right on the documentation page to get correct URL; URLs on Infocenter unfortunately do not update when navigating the menu.)

    The above page also show how flash is used during DFU, for different types of updates (application or SoftDevice/bootloader, single- or dual-bank).

    I see that you use the nRF52840 Dongle. It comes preprogrammed with a USB bootloader, and in order to program direclty you need to connect to programmer pins from a programmer. What setup are you using for that?

    You refer to "Programmer tools", what exactly is that?

    If you have a segger J-Link programmer connected to the Dongle, you can use the command "nrfjprog --readcode --readuicr dump.hex" to dump the flash contents to a hex file, for further examination.

    Regards,
    Terje

  • Hi Terje

    Thanks for your replay. I am sorry the link is not right as you said.

    I have dongle and DK for nrf52840. I do not have a J-link, so I connect dongle to DK(p19) as a extra chips for erase the dongle by nrfjprog command and also can program the dongle by SES. Of course, the dongle still can be programmed by PC's  nRF Connect-->Programmer (This is the Programmer Tools I said in last post), when the dongle just connect to USB interface of PC.

    The correct link is here.(https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v16.0.0%2Flib_bootloader.html&cp=7_5_0_3_5_0_7&anchor=lib_bootloader_memory)

    The enclosure is the pictures for those operation steps last post. I find the memory layer is difference with the link.

    So I got those 6 problems last post. Would you like to give me those answers.

    Thanks,

    Di-sheng For Memory Layout post.docx

     

Related