This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ot_flash_data in nrf_connect_sdk

Hi,

In my application, I am writing in flash.

But when I do so, my openthread data in flash gets overwritten, the node doesn't retain its commissioning data.

In nrf_SDK_For_Thread_and_Zigbee, thread_secure_dfu_client_gcc_nrf52.ld files, it specifies 

FLASH (rx) : ORIGIN = 0x1000, LENGTH = 0xf3000
ot_flash_data (r) : ORIGIN = 0xf4000, LENGTH = 0x4000

So I have used 0x000F2B00 this location and this used to work fine in my previous application.

But in my current application, which is upon nRF_Connect_SDK, I am unable to figure out this address.
Please suggest where I can find the address of ot_flash_data in nRF_Connect_SDK?
  • Hello,

    By default, it looks like it will use 0x000F8000 -> 0x000F8FFF (you can check this by using nRF Connect for Desktop -> Programmer).

    But I guess it is not always the case. Depending on whether you would use a bootloader, 

    Do you intend to have a bootloader to make sure it doesn't collide in the future, or is it enough to know what it is in this particular case? (because then I have to investigate where it is decided what flash address to use). 

    Best regards,

    Edvin

  • I want to implement DFU in my application in the future, so I understand bootloader will be essential at that point.

    So this is not enough in my case, bootloader will come into the picture in the next development phase. 

    Please investigate further and suggest accordingly. 

  • I understand,

    In the case where you have a bootloader, the story is a bit different, actually. Adding the bootloader (CONFIG_BOOTLOADER_MCUBOOT=y), will also create a file called partitions.yml inside your build folder. There you should see a partition called "settings_storage", and the start and end address of that partition:

    app:
      address: 0xc200
      end_address: 0x85000
      region: flash_primary
      size: 0x78e00
    mcuboot:
      address: 0x0
      end_address: 0xc000
      placement:
        before:
        - mcuboot_primary
      region: flash_primary
      size: 0xc000
    mcuboot_pad:
      address: 0xc000
      end_address: 0xc200
      placement:
        align:
          start: 0x1000
        before:
        - mcuboot_primary_app
      region: flash_primary
      size: 0x200
    mcuboot_primary:
      address: 0xc000
      end_address: 0x85000
      orig_span: &id001
      - app
      - mcuboot_pad
      region: flash_primary
      sharers: 0x1
      size: 0x79000
      span: *id001
    mcuboot_primary_app:
      address: 0xc200
      end_address: 0x85000
      orig_span: &id002
      - app
      region: flash_primary
      size: 0x78e00
      span: *id002
    mcuboot_secondary:
      address: 0x85000
      end_address: 0xfe000
      placement:
        after:
        - mcuboot_primary
        align:
          start: 0x1000
      region: flash_primary
      share_size:
      - mcuboot_primary
      size: 0x79000
    settings_storage:
      address: 0xfe000
      end_address: 0x100000
      placement:
        align:
          start: 0x1000
        before:
        - end
      region: flash_primary
      size: 0x2000
    sram_primary:
      address: 0x20000000
      end_address: 0x20040000
      region: sram_primary
      size: 0x40000
    

    Best regards,
    Edvin

Related