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

need help to flash application nrf52 dk using nrfjprog

Hi, I have got my nRF52 DK. I could flash softdevice using nrfjprog. But after reading s132 specification, i have following doubts.

  1. How to flash application from the address APP_CODE_BASE and APP_RAM_BASE?
  2. Do i need to define address for application code or it is defined in S132 library?
  3. Can i flash application code using nrfprog tool?

I am using GCC compiler.

Parents
  • Hi phob,

    If you are using any compiler which generates HEX (Intel HEX format, sometimes also called ihex) then you don't need to care about code address, it's already written in the HEX file for each line of the code to load and all tools like SEGGER J-Link or NRFJPROG or nRFgo Studio will do it automatically. You don't need to care about RAM addressing at all, that's hardocoded in your code and is taken care of during every start-up (nothing to do with flashing the code to the Non Volatile Memory = flash). The only problem can be that most of the tools require to have the chip erased and then flash one binary (HEX) so if you have multiple segments (e.g. Soft Device, your APP and bootloader or some manufacturing data) you need to merge them first.

    If you prefer to use GUI tools then do it step by step in nRFgo Studio (it has nice User Guide), if you prefer to have simple batch file and command line tools then you can follow answers in this question.

    So to your questions:

    1. You don't need to care about APP-CODE_BASE and APP_RAM_BASE during flashing if you set them correctly during compilation (each linker does it specifically, e.g. Keil has it in target settings, GCC in LD script) and you use HEX output binary.
    2. You do need to set both CODE and RAM addresses correctly if you are using Soft Device. See release notes for particular SD release you are using.
    3. Sure you can, see the example in link provided above.

    Cheers Jan

Reply
  • Hi phob,

    If you are using any compiler which generates HEX (Intel HEX format, sometimes also called ihex) then you don't need to care about code address, it's already written in the HEX file for each line of the code to load and all tools like SEGGER J-Link or NRFJPROG or nRFgo Studio will do it automatically. You don't need to care about RAM addressing at all, that's hardocoded in your code and is taken care of during every start-up (nothing to do with flashing the code to the Non Volatile Memory = flash). The only problem can be that most of the tools require to have the chip erased and then flash one binary (HEX) so if you have multiple segments (e.g. Soft Device, your APP and bootloader or some manufacturing data) you need to merge them first.

    If you prefer to use GUI tools then do it step by step in nRFgo Studio (it has nice User Guide), if you prefer to have simple batch file and command line tools then you can follow answers in this question.

    So to your questions:

    1. You don't need to care about APP-CODE_BASE and APP_RAM_BASE during flashing if you set them correctly during compilation (each linker does it specifically, e.g. Keil has it in target settings, GCC in LD script) and you use HEX output binary.
    2. You do need to set both CODE and RAM addresses correctly if you are using Soft Device. See release notes for particular SD release you are using.
    3. Sure you can, see the example in link provided above.

    Cheers Jan

Children
No Data
Related