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

nRF52840 Memory Map

Hi,

I recently updated my toolchain using the nRFConnect tool chain manager.

(I was seeing problems after an OS update)

This update fixed my problem but when I build code now, it looks as though the memory map has changed.

Before the update, my code was starting at 0x0 as shown below.

but since the update, my code has now moved to 0x1000 as shown below.

my build is very straight forward.

rm -R build
mkdir build
 west build -b nrf52840dongle_nrf52840
 west flash

the code is just the "Hello World" sample.

Would appreciate your thoughts

Rod

Parents Reply Children
  • Hi Rod,

    The first few lines contain a solution, the rest is an attempt to understand everything.

    Here is the solution when you want your application to start at 0x000: Simply add this line to the prj.conf file located in your hello_world project folder.

    CONFIG_BOARD_HAS_NRF5_BOOTLOADER=n

    (Since this is s public case: When using Segger Embedded Studio, remember to reload the project before you build: SES->Project->Reload hello_world)
    You will need to add this line to every project where you want this change to be applied. A solution for how to change the defualt value for future projects is described below.
    hello_world built using CONFIG_BOARD_HAS_NRF5_BOOTLOADER=n:

    RodWatt said:
    Has this changed between releases?

    The few things I have checked does not indicate any changes affecting the default start address for a while. Below are some thoughts to why you are experiencing the inconsistency between your previously built project and the fresh installation.

    The nRF52840 Dongle is factory programmed with an MBR and bootloader to allow flashing the device through the USB connector. Letting the application start at 0x1000 by default keeps these intact when flashing the dongle and lowers the chances of accidentally overwriting these.

    Since you want your code to start at 0x000(overwriting the MBR and bootloader) I assume you have soldered a connector to the board and are using an external debug probe. When you previously set this up, you might have followed the steps under 'Option 3' when flashing the dongle.

    The instructions under Option 3 includes changing BOARD_HAS_NRF5_BOOTLOADER to be default n. in the Kconfig file in the folder v1.3.1\zephyr\boards\arm\nrf52840dongle_nrf52840. If you make this change to your boards folder, then you do not have to worry about adding CONFIG_BOARD_HAS_NRF5_BOOTLOADER=n to the prj.conf file of any new project for your dongle. Keep in mind that when you move to a new NCS tag you will have to modify the boards folder again. An explanation to your situation could be that these changes in your board folder were lost after you started using a fresh copy of NCS. 

    The dongle I am using today does not have any debug cable attached so I am only assuming the application works.

Related