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

nrf52840 + S140 6.1.1 + DFU example IAR + nRFGO

Good evening,

We are trying to flash the bootloader DFU debug example using 10056 ble debug example code to our nRF52840 based board.

Everytime we try to flash, we get an error message about writing in the SoftDevice area.

End of Softdevice address is 0X26000 for S140 6.1.1. We are not sure how to configure IAR to make it work.

We can flash Softdevice S140 6.1.1 with nRFGO studio + our application and it works.

However, we struggle to flash the bootloader nRF52840 BLE DFU debug example from the latest SDK (15.3.0)

We need to flash softdevice before flashing the DFU example right?  

Our chip is BL654 from Laird.

What has to be changed from the SDK files to make it work? What configuration in IAR?

Taking the SDK files without touching anything and trying to compile on IAR straight away gives us a mistake.

Do we only need to change the addresses in the linker configuration? If yes, could you guide us with the memory addresses we need to put? Do we need to manually modify the linker configuration document?

Where can we find the memory allocation for nrf52840 and S140 softdevice 6.1.1? we have found 6.0.X and read the migration documents but couldn't figure out the table as shown in the documentation.

Thank you!

Francois

Parents
  • I work with Francois.

    More details:

    When compiling secure_bootloader_ble_s140_pca10056_debug, we get no error message.

    However, when trying to flash the hex on the nRF52840 using nRFGo Studio, after flashing SoftDevide S140 6.1.1, we get this error message:

    "This hex file has data in softdevice region. Try programming using "Program SoftDevice", or erase all before programming.

    Is this related to RAM/ROM configurations?

    FYI, IAR linker conf.

    .intvec start 0xf1000

    Memory regions

    ROM 0xf1000  0xfdfff

    RAM 0x200057b8   0x2003ffff

    CSTACK 2048 HEAP 0

    in sdk_config.h

    #ifndef NRF_DFU_APP_DATA_AREA_SIZE
    #define NRF_DFU_APP_DATA_AREA_SIZE 12288
    #endif

    in nrf_mbr.h

    /** @addtogroup NRF_MBR_DEFINES Defines
    * @{ */

    /**@brief MBR SVC Base number. */
    #define MBR_SVC_BASE (0x18)

    /**@brief Page size in words. */
    #define MBR_PAGE_SIZE_IN_WORDS (1024)

    /** @brief The size that must be reserved for the MBR when a SoftDevice is written to flash.
    This is the offset where the first byte of the SoftDevice hex file is written. */
    #define MBR_SIZE (0x1000)

    /** @brief Location (in the flash memory) of the bootloader address. */
    #define MBR_BOOTLOADER_ADDR (0xFF8)

    /** @brief Location (in UICR) of the bootloader address. */
    #define MBR_UICR_BOOTLOADER_ADDR (&(NRF_UICR->NRFFW[0]))

    /** @brief Location (in the flash memory) of the address of the MBR parameter page. */
    #define MBR_PARAM_PAGE_ADDR (0xFFC)

    /** @brief Location (in UICR) of the address of the MBR parameter page. */
    #define MBR_UICR_PARAM_PAGE_ADDR (&(NRF_UICR->NRFFW[1]))

    Where 0XFF8 and 0XFFC comes from?

    Would changing any of these values would make it work?

Reply
  • I work with Francois.

    More details:

    When compiling secure_bootloader_ble_s140_pca10056_debug, we get no error message.

    However, when trying to flash the hex on the nRF52840 using nRFGo Studio, after flashing SoftDevide S140 6.1.1, we get this error message:

    "This hex file has data in softdevice region. Try programming using "Program SoftDevice", or erase all before programming.

    Is this related to RAM/ROM configurations?

    FYI, IAR linker conf.

    .intvec start 0xf1000

    Memory regions

    ROM 0xf1000  0xfdfff

    RAM 0x200057b8   0x2003ffff

    CSTACK 2048 HEAP 0

    in sdk_config.h

    #ifndef NRF_DFU_APP_DATA_AREA_SIZE
    #define NRF_DFU_APP_DATA_AREA_SIZE 12288
    #endif

    in nrf_mbr.h

    /** @addtogroup NRF_MBR_DEFINES Defines
    * @{ */

    /**@brief MBR SVC Base number. */
    #define MBR_SVC_BASE (0x18)

    /**@brief Page size in words. */
    #define MBR_PAGE_SIZE_IN_WORDS (1024)

    /** @brief The size that must be reserved for the MBR when a SoftDevice is written to flash.
    This is the offset where the first byte of the SoftDevice hex file is written. */
    #define MBR_SIZE (0x1000)

    /** @brief Location (in the flash memory) of the bootloader address. */
    #define MBR_BOOTLOADER_ADDR (0xFF8)

    /** @brief Location (in UICR) of the bootloader address. */
    #define MBR_UICR_BOOTLOADER_ADDR (&(NRF_UICR->NRFFW[0]))

    /** @brief Location (in the flash memory) of the address of the MBR parameter page. */
    #define MBR_PARAM_PAGE_ADDR (0xFFC)

    /** @brief Location (in UICR) of the address of the MBR parameter page. */
    #define MBR_UICR_PARAM_PAGE_ADDR (&(NRF_UICR->NRFFW[1]))

    Where 0XFF8 and 0XFFC comes from?

    Would changing any of these values would make it work?

Children
No Data
Related