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
  • Hi Rod,

    I am looking into this and will get back to you later today.

    Best Regards,

    Håkon

  • Thanks Håkon,

    Thanks for the update; I will look forward to your updates

    Has this changed between releases? Why am I just seeing this problem now?

    Rod

  • RodWatt said:
    Is there an easy way to check the tag?

    Here is one way to check:

    The west.yml file will list which revision of Zephyr you are on. Since your application printed out 'v2.3.0-rc1-ncs1' then we can search the older NCS folders to see which version of NCS that was using this fork. When I checked v1.3.0/nrf/west.yml under 'projects' I found that the NCS v1.3.0 tag is using the Zephyr v2.3.0-rc1-ncs1 fork.

        - namezephyr
          repo-pathsdk-zephyr
          revisionv2.3.0-rc1-ncs1
  • Update: I now also installed nRF Connect SDK v1.3.0-rc1 on my computer and checked the corresponding west.yml file. This tag is also using Zephyr v2.3.0-rc1-ncs1.

    If you have been on the master branch of NCS you may also at some point have been using this Zephyr fork.

  • I have another board, nRF52833DK, which does run code. I have just built the Hello World code and see this

    *** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***

  • 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.

Reply
  • 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.

Children
Related