Upgrading app from 2.1.2 to 2.4.0 result with error code #XFOTA: 5,1,-9

Hi,

I'm trying to upgrade my SDK to 2.4.0 (so I can use the Wi-Fi location)

I'm using SDK 2.1.2

Here is how I do the FOTA:

AT+CEREG=5
OK
AT+CFUN=1
OK
+CEREG: 2,"198D","00048801",7
+CEREG: 5,"198D","00048801",7,,,"11100000","11100000"
AT#XFOTA=8
OK
AT#XFOTA=6
#XFOTA: 3,1,401580,"0.0.0+0"
OK
AT#XFOTA=1,"https://s3.amazonaws.com/firmware.v2.prod.public/app_update.bin",16842753
#XFOTA: 1,0,0
#XFOTA: 1,0,1
#XFOTA: 1,0,1
#XFOTA: 1,0,2
#XFOTA: 1,0,2
#XFOTA: 1,0,3
#XFOTA: 1,0,3
#XFOTA: 1,0,4
#XFOTA: 1,0,4
#XFOTA: 1,0,5
#XFOTA: 1,0,5
#XFOTA: 1,0,6
#XFOTA: 1,0,6
#XFOTA: 1,0,7
#XFOTA: 1,0,7
#XFOTA: 1,0,8
#XFOTA: 1,0,8
#XFOTA: 1,0,9
#XFOTA: 1,0,9
#XFOTA: 1,0,10
#XFOTA: 1,0,11
#XFOTA: 1,0,11
#XFOTA: 1,0,12
#XFOTA: 1,0,12
#XFOTA: 1,0,13
#XFOTA: 1,0,13
#XFOTA: 1,0,14
#XFOTA: 1,0,14
#XFOTA: 1,0,15
#XFOTA: 1,0,15
#XFOTA: 1,0,16
#XFOTA: 1,0,16
#XFOTA: 1,0,17
#XFOTA: 1,0,18
#XFOTA: 1,0,18
#XFOTA: 1,0,19
#XFOTA: 1,0,19
#XFOTA: 1,0,20
#XFOTA: 1,0,20
#XFOTA: 1,0,21
#XFOTA: 1,0,22
#XFOTA: 1,0,22
#XFOTA: 1,0,23
#XFOTA: 1,0,23
#XFOTA: 1,0,24
#XFOTA: 1,0,24
#XFOTA: 1,0,25
#XFOTA: 1,0,25
#XFOTA: 1,0,26
#XFOTA: 1,0,26
#XFOTA: 1,0,27
#XFOTA: 1,0,27
#XFOTA: 1,0,28
#XFOTA: 1,0,28
#XFOTA: 1,0,29
#XFOTA: 1,0,29
#XFOTA: 1,0,30
#XFOTA: 1,0,30
#XFOTA: 1,0,31
#XFOTA: 1,0,31
#XFOTA: 1,0,32
#XFOTA: 1,0,33
#XFOTA: 1,0,33
#XFOTA: 1,0,34
#XFOTA: 1,0,34
#XFOTA: 1,0,35
#XFOTA: 1,0,35
#XFOTA: 1,0,36
#XFOTA: 1,0,36
#XFOTA: 1,0,37
#XFOTA: 1,0,37
#XFOTA: 1,0,38
#XFOTA: 1,0,38
#XFOTA: 1,0,39
#XFOTA: 1,0,39
#XFOTA: 1,0,40
#XFOTA: 1,0,40
#XFOTA: 1,0,41
#XFOTA: 1,0,41
#XFOTA: 1,0,42
#XFOTA: 1,0,43
#XFOTA: 1,0,43
#XFOTA: 1,0,44
#XFOTA: 1,0,44
#XFOTA: 1,0,45
#XFOTA: 1,0,45
#XFOTA: 1,0,46
#XFOTA: 1,0,46
#XFOTA: 1,0,47
#XFOTA: 1,0,47
#XFOTA: 1,0,48
#XFOTA: 1,0,48
#XFOTA: 1,0,49
#XFOTA: 1,0,49
#XFOTA: 1,0,50
#XFOTA: 1,0,50
#XFOTA: 1,0,51
#XFOTA: 1,0,51
#XFOTA: 1,0,52
#XFOTA: 1,0,52
#XFOTA: 1,0,53
#XFOTA: 1,0,54
#XFOTA: 1,0,55
#XFOTA: 1,0,55
#XFOTA: 1,0,56
#XFOTA: 1,0,56
#XFOTA: 1,0,57
#XFOTA: 1,0,57
#XFOTA: 1,0,58
#XFOTA: 1,0,58
#XFOTA: 1,0,59
#XFOTA: 1,0,59
#XFOTA: 1,0,60
#XFOTA: 1,0,60
#XFOTA: 1,0,61
#XFOTA: 1,0,61
#XFOTA: 1,0,62
#XFOTA: 1,0,63
#XFOTA: 1,0,63
#XFOTA: 1,0,64
#XFOTA: 1,0,65
#XFOTA: 1,0,65
#XFOTA: 1,0,66
#XFOTA: 1,0,66
#XFOTA: 1,0,67
#XFOTA: 1,0,67
#XFOTA: 1,0,68
#XFOTA: 1,0,68
#XFOTA: 1,0,69
#XFOTA: 1,0,69
#XFOTA: 1,0,70
#XFOTA: 1,0,71
#XFOTA: 1,0,71
#XFOTA: 1,0,72
#XFOTA: 1,0,72
#XFOTA: 1,0,73
#XFOTA: 1,0,73
#XFOTA: 1,0,74
#XFOTA: 1,0,74
#XFOTA: 1,0,75
#XFOTA: 1,0,76
#XFOTA: 1,0,76
#XFOTA: 1,0,77
#XFOTA: 1,0,77
#XFOTA: 1,0,78
#XFOTA: 1,0,78
#XFOTA: 1,0,79
#XFOTA: 1,0,79
#XFOTA: 1,0,80
#XFOTA: 1,0,80
#XFOTA: 1,0,81
#XFOTA: 1,0,81
#XFOTA: 1,0,82
#XFOTA: 1,0,82
#XFOTA: 1,0,83
#XFOTA: 1,0,83
#XFOTA: 1,0,84
#XFOTA: 1,0,84
#XFOTA: 1,0,85
#XFOTA: 1,0,86
#XFOTA: 1,0,86
#XFOTA: 1,0,87
#XFOTA: 1,0,87
#XFOTA: 1,0,88
#XFOTA: 1,0,88
#XFOTA: 1,0,89
#XFOTA: 1,0,89
#XFOTA: 1,0,90
#XFOTA: 1,0,90
#XFOTA: 1,0,91
#XFOTA: 1,0,91
#XFOTA: 1,0,92
#XFOTA: 1,0,92
#XFOTA: 1,0,93
#XFOTA: 1,0,93
#XFOTA: 1,0,94
#XFOTA: 1,0,94
#XFOTA: 1,0,95
#XFOTA: 1,0,95
#XFOTA: 1,0,96
#XFOTA: 1,0,97
#XFOTA: 1,0,97
#XFOTA: 1,0,98
#XFOTA: 1,0,98
#XFOTA: 1,0,99
#XFOTA: 1,0,99
#XFOTA: 1,0,100
#XFOTA: 4,0
AT#XRESET
OK
Ready

And after the reset nothing happened, I waiting for about 5 minutes and reset my board and nRF didn't respond and I have to reset it at least 3-4 times and I got #XFOTA: 5,1,-9

The SDK remained 2.1.2

Any suggestions what I can do?

Parents Reply Children
  • I think this is the partition of the original

    EMPTY_0:
      address: 0xc000
      end_address: 0x10000
      placement:
        before:
        - mcuboot_pad
      region: flash_primary
      size: 0x4000
    EMPTY_1:
      address: 0xea000
      end_address: 0xeb000
      placement:
        after:
        - settings_storage
      region: flash_primary
      size: 0x1000
    EMPTY_2:
      address: 0xe0000
      end_address: 0xe8000
      placement:
        after:
        - mcuboot_secondary
      region: flash_primary
      size: 0x8000
    app:
      address: 0x1c200
      end_address: 0x78000
      region: flash_primary
      size: 0x5be00
    mcuboot:
      address: 0x0
      end_address: 0xc000
      placement:
        before:
        - mcuboot_primary
      region: flash_primary
      size: 0xc000
    mcuboot_pad:
      address: 0x10000
      end_address: 0x10200
      placement:
        align:
          start: 0x8000
        before:
        - mcuboot_primary_app
      region: flash_primary
      size: 0x200
    mcuboot_primary:
      address: 0x10000
      end_address: 0x78000
      orig_span: &id001
      - tfm
      - app
      - mcuboot_pad
      region: flash_primary
      sharers: 0x1
      size: 0x68000
      span: *id001
    mcuboot_primary_app:
      address: 0x10200
      end_address: 0x78000
      orig_span: &id002
      - app
      - tfm
      region: flash_primary
      size: 0x67e00
      span: *id002
    mcuboot_secondary:
      address: 0x78000
      end_address: 0xe0000
      placement:
        after:
        - mcuboot_primary
        align:
          start: 0x8000
      region: flash_primary
      share_size:
      - mcuboot_primary
      size: 0x68000
    nonsecure_storage:
      address: 0xe8000
      end_address: 0xff000
      orig_span: &id003
      - settings_storage
      - pgps
      region: flash_primary
      size: 0x17000
      span: *id003
    nrf_modem_lib_ctrl:
      address: 0x20008000
      end_address: 0x200084e8
      inside:
      - sram_nonsecure
      placement:
        after:
        - tfm_sram
        - start
      region: sram_primary
      size: 0x4e8
    nrf_modem_lib_rx:
      address: 0x2000a4e8
      end_address: 0x2000c4e8
      inside:
      - sram_nonsecure
      placement:
        after:
        - nrf_modem_lib_tx
      region: sram_primary
      size: 0x2000
    nrf_modem_lib_sram:
      address: 0x20008000
      end_address: 0x2000c4e8
      orig_span: &id004
      - nrf_modem_lib_ctrl
      - nrf_modem_lib_tx
      - nrf_modem_lib_rx
      region: sram_primary
      size: 0x44e8
      span: *id004
    nrf_modem_lib_tx:
      address: 0x200084e8
      end_address: 0x2000a4e8
      inside:
      - sram_nonsecure
      placement:
        after:
        - nrf_modem_lib_ctrl
      region: sram_primary
      size: 0x2000
    otp:
      address: 0xff8108
      end_address: 0xff83fc
      region: otp
      size: 0x2f4
    pgps:
      address: 0xeb000
      align:
        start: 0x8000
      end_address: 0x100000
      inside:
      - nonsecure_storage
      placement:
        before:
        - end
      region: flash_primary
      size: 0x15000
    settings_storage:
      address: 0xe8000
      end_address: 0xea000
      inside:
      - nonsecure_storage
      placement:
        align:
          start: 0x8000
        before:
        - end
      region: flash_primary
      size: 0x2000
    sram_nonsecure:
      address: 0x20008000
      end_address: 0x20040000
      orig_span: &id005
      - sram_primary
      - nrf_modem_lib_ctrl
      - nrf_modem_lib_tx
      - nrf_modem_lib_rx
      region: sram_primary
      size: 0x38000
      span: *id005
    sram_primary:
      address: 0x2000c4e8
      end_address: 0x20040000
      region: sram_primary
      size: 0x33b18
    sram_secure:
      address: 0x20000000
      end_address: 0x20008000
      orig_span: &id006
      - tfm_sram
      region: sram_primary
      size: 0x8000
      span: *id006
    tfm:
      address: 0x10200
      end_address: 0x1c200
      inside:
      - mcuboot_primary_app
      placement:
        before:
        - app
      region: flash_primary
      size: 0xc000
    tfm_nonsecure:
      address: 0x1c200
      end_address: 0x78000
      orig_span: &id007
      - app
      region: flash_primary
      size: 0x5be00
      span: *id007
    tfm_secure:
      address: 0x10000
      end_address: 0x1c200
      orig_span: &id008
      - mcuboot_pad
      - tfm
      region: flash_primary
      size: 0xc200
      span: *id008
    tfm_sram:
      address: 0x20000000
      end_address: 0x20008000
      inside:
      - sram_secure
      placement:
        after:
        - start
      region: sram_primary
      size: 0x8000
    

    I tried to put is at pm_static as suggested from your link and recompile

    I got this error

    C:\nrf\v2.4.0\nrf\modules\tfm\tfm\boards\common\assert.c:16:9: note: '#pragma message:

    !!!Partition alignment error!!!
    The non-secure start address in pm_static.yml or generated partition.yml is: 0x1c200
    which is not aligned with the SPU region size.
    Refer to the documentation section 'TF-M partition alignment requirements'
    for more information.

    '
    16 | #pragma message "\n\n!!!Partition alignment error!!!"\
    | ^~~~~~~
    C:\nrf\v2.4.0\nrf\modules\tfm\tfm\boards\common\assert.c:22:2: error: #error "TF-M non-secure start address is not aligned on SPU region size"
    22 | #error "TF-M non-secure start address is not aligned on SPU region size"
    | ^~~~~
    ninja: build stopped: subcommand failed.

    Any suggestion from here?

  • The problem is with the definition of the TF-M partitions. The requirements were tightened in an update, which is what causes the build error.

    However, we don't really need the TF-M partitions to be statically defined, just the MCUBoot and storage related partitions.

    If you change the pm_static.yml to be this, I think it should work:

    mcuboot:
      address: 0x0
      end_address: 0xc000
      placement:
        before:
        - mcuboot_primary
      region: flash_primary
      size: 0xc000
    EMPTY_0:
      address: 0xc000
      end_address: 0x10000
      placement:
        before:
        - mcuboot_pad
      region: flash_primary
      size: 0x4000
    mcuboot_primary:
      address: 0x10000
      end_address: 0x78000
      region: flash_primary
      size: 0x68000
      span: [tfm, app, mcuboot_pad]
    mcuboot_pad:
      address: 0x10000
      end_address: 0x10200
      placement:
        align:
          start: 0x8000
        before:
        - mcuboot_primary_app
      region: flash_primary
      size: 0x200
    tfm:
      address: 0x10200
      inside:
      - mcuboot_primary_app
      placement:
        before:
        - app
      region: flash_primary
      size: 0xfe00
    tfm_secure:
      address: 0x10000
      orig_span: &id008
      - mcuboot_pad
      - tfm
      region: flash_primary
      size: 0x10000
      span: *id008
    tfm_nonsecure:
      address: 0x20000
      end_address: 0x78000
      orig_span: &id007
      - app
      region: flash_primary
      size: 0x58000
      span: *id007
    mcuboot_secondary:
      address: 0x78000
      end_address: 0xe0000
      placement:
        after:
        - mcuboot_primary
        align:
          start: 0x8000
      region: flash_primary
      share_size:
      - mcuboot_primary
      size: 0x68000
    EMPTY_1:
      address: 0xe0000
      end_address: 0xe8000
      placement:
        after:
        - mcuboot_secondary
      region: flash_primary
      size: 0x8000
    nonsecure_storage:
      address: 0xe8000
      end_address: 0xff000
      region: flash_primary
      size: 0x17000
      span: [settings_storage, pgps]
    settings_storage:
      address: 0xe8000
      end_address: 0xea000
      inside:
      - nonsecure_storage
      placement:
        align:
          start: 0x8000
        before:
        - end
      region: flash_primary
      size: 0x2000
    EMPTY_2:
      address: 0xea000
      end_address: 0xeb000
      placement:
        after:
        - settings_storage
      region: flash_primary
      size: 0x1000
    settings_storage:
      address: 0xe8000
      end_address: 0xea000
      inside:
      - nonsecure_storage
      placement:
        align:
          start: 0x8000
        before:
        - end
      region: flash_primary
      size: 0x2000
    EMPTY_3:
      address: 0xea000
      size: 0x16000

    There's a couple of things to note:

    Firstly, there are quite a few empty partitions. These are needed to fill the "gaps" left between your old partitions. It might be possible to use them for application storage, but not for getting more space for the application itself.

    Secondly, I've increased the TF-M partition. This is to avoid getting a flash overflow in the TF-M partition, but depending on the size of TF-M, you might be able to reduce it by 32kB, thus freeing that space for the application.

    This configuration reduces the size of the TF-M partition, which makes the application partition bigger:

    mcuboot:
      address: 0x0
      end_address: 0xc000
      placement:
        before:
        - mcuboot_primary
      region: flash_primary
      size: 0xc000
    EMPTY_0:
      address: 0xc000
      end_address: 0x10000
      placement:
        before:
        - mcuboot_pad
      region: flash_primary
      size: 0x4000
    mcuboot_primary:
      address: 0x10000
      end_address: 0x78000
      region: flash_primary
      size: 0x68000
      span: [tfm, app, mcuboot_pad]
    mcuboot_pad:
      address: 0x10000
      end_address: 0x10200
      placement:
        align:
          start: 0x8000
        before:
        - mcuboot_primary_app
      region: flash_primary
      size: 0x200
    tfm:
      address: 0x10200
      inside:
      - mcuboot_primary_app
      placement:
        before:
        - app
      region: flash_primary
      size: 0x7e00
    tfm_secure:
      address: 0x10000
      orig_span: &id008
      - mcuboot_pad
      - tfm
      region: flash_primary
      size: 0x8000
      span: *id008
    tfm_nonsecure:
      address: 0x18000
      end_address: 0x78000
      orig_span: &id007
      - app
      region: flash_primary
      size: 0x60000
      span: *id007
    mcuboot_secondary:
      address: 0x78000
      end_address: 0xe0000
      placement:
        after:
        - mcuboot_primary
        align:
          start: 0x8000
      region: flash_primary
      share_size:
      - mcuboot_primary
      size: 0x68000
    EMPTY_1:
      address: 0xe0000
      end_address: 0xe8000
      placement:
        after:
        - mcuboot_secondary
      region: flash_primary
      size: 0x8000
    nonsecure_storage:
      address: 0xe8000
      end_address: 0xff000
      region: flash_primary
      size: 0x17000
      span: [settings_storage, pgps]
    settings_storage:
      address: 0xe8000
      end_address: 0xea000
      inside:
      - nonsecure_storage
      placement:
        align:
          start: 0x8000
        before:
        - end
      region: flash_primary
      size: 0x2000
    EMPTY_2:
      address: 0xea000
      end_address: 0xeb000
      placement:
        after:
        - settings_storage
      region: flash_primary
      size: 0x1000
    settings_storage:
      address: 0xe8000
      end_address: 0xea000
      inside:
      - nonsecure_storage
      placement:
        align:
          start: 0x8000
        before:
        - end
      region: flash_primary
      size: 0x2000
    EMPTY_3:
      address: 0xea000
      size: 0x16000

    If you are able to build your project successfully with this configuration, you might want to use this one instead.

    Also, you should note that I have only tested these configurations by building the hello_world sample, so you need to check that they work for your project.

  • Hi Didrik,

    Thanks for replying

    I changed according to your suggestions

    If you change the pm_static.yml to be this, I think it should work:

    I've tried this and received:

    [407/427] Linking C static library zephyr\kernel\libkernel.a
    [408/427] Linking C executable zephyr\zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map
    cmd.exe /C "cd . && C:\nordic\toolchains\31f4403e35\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -gdwarf-4 @CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf && cmd.exe /C "cd /D C:\nrf\v2.4.0\nrf\applications\serial_lte_modem\build\zephyr && C:\nordic\toolchains\31f4403e35\opt\bin\cmake.exe -E echo ""
    c:/nordic/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr\zephyr_pre0.elf section `text' will not fit in region `FLASH'
    c:/nordic/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: region `FLASH' overflowed by 95500 bytes
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.

    This configuration reduces the size of the TF-M partition, which makes the application partition bigger:

    and for this I received:

    [406/427] Linking C static library modules\nrfxlib\nrfxlib\nrf_security\src\zephyr\libmbedtls_zephyr.a
    [407/427] Linking C static library zephyr\kernel\libkernel.a
    [408/427] Linking C executable zephyr\zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map
    cmd.exe /C "cd . && C:\nordic\toolchains\31f4403e35\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -gdwarf-4 @CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf && cmd.exe /C "cd /D C:\nrf\v2.4.0\nrf\applications\serial_lte_modem\build\zephyr && C:\nordic\toolchains\31f4403e35\opt\bin\cmake.exe -E echo ""
    c:/nordic/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr\zephyr_pre0.elf section `text' will not fit in region `FLASH'
    c:/nordic/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: region `FLASH' overflowed by 62732 bytes
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\nordic\toolchains\31f4403e35\opt\bin\cmake.EXE' --build 'c:\nrf\v2.4.0\nrf\applications\serial_lte_modem\build'

    We wont use PGPS only AGPS, maybe this can help?

  • I'm trying to reduce the application size with no success

    Could you help with that?

    Attaching my prj

    BTW when I do CONFIG_NRF_CLOUD_PGPS=n or comment it, the application wont build

    #
    # Copyright (c) 2020 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    # General config
    #CONFIG_LOG=y
    #CONFIG_LOG_DEFAULT_LEVEL=3
    CONFIG_STACK_SENTINEL=y
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_RING_BUFFER=y
    
    # Segger RTT
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=n
    CONFIG_UART_CONSOLE=n
    CONFIG_LOG=n
    CONFIG_LOG_BACKEND_RTT=n
    CONFIG_LOG_BACKEND_UART=n
    
    # Network
    CONFIG_NETWORKING=y
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_NATIVE=n
    
    # Modem library
    CONFIG_NRF_MODEM_LIB=y
    # Align the max FD entry to NRF_MODEM_MAX_SOCKET_COUNT(8)
    CONFIG_POSIX_MAX_FDS=8
    # Enable below for modem trace
    #CONFIG_NRF_MODEM_LIB_TRACE=y
    # Handle modem fault
    CONFIG_NRF_MODEM_LIB_ON_FAULT_APPLICATION_SPECIFIC=y
    
    # Use GPIO
    CONFIG_GPIO=y
    CONFIG_GPIO_NRFX=y
    
    # UART interface
    CONFIG_SERIAL=y
    CONFIG_UART_ASYNC_API=y
    CONFIG_NRFX_TIMER2=y
    
    # Stacks and heaps
    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_HEAP_MEM_POOL_SIZE=16384
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
    CONFIG_AT_MONITOR_HEAP_SIZE=4096
    
    # Device power management
    CONFIG_PM_DEVICE=y
    
    # FOTA
    CONFIG_HTTP_PARSER_URL=y
    CONFIG_FOTA_DOWNLOAD=y
    CONFIG_FOTA_DOWNLOAD_PROGRESS_EVT=y
    CONFIG_DFU_TARGET=y
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_IMG_MANAGER=y
    
    # FLASH
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_STREAM_FLASH=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y
    
    # Settings
    CONFIG_SETTINGS=y
    CONFIG_SETTINGS_FCB=y
    CONFIG_FCB=y
    
    # nRF Cloud
    #CONFIG_NRF_CLOUD_IPV6=y
    CONFIG_NRF_CLOUD_MQTT=y
    #CONFIG_NRF_CLOUD_FOTA=n
    CONFIG_NRF_CLOUD_AGPS=y
    CONFIG_NRF_CLOUD_AGPS_FILTERED=n
    CONFIG_NRF_CLOUD_PGPS=y
    CONFIG_NRF_CLOUD_LOCATION=y
    #CONFIG_NRF_CLOUD_LOG_LEVEL_INF=y
    #CONFIG_NRF_CLOUD_GPS_LOG_LEVEL_INF=y
    CONFIG_DATE_TIME=y
    CONFIG_MODEM_INFO=y
    CONFIG_MODEM_INFO_ADD_DATE_TIME=n
    CONFIG_AT_MONITOR=y
    CONFIG_MODEM_JWT=y
    CONFIG_NRF_CLOUD_CLIENT_ID_SRC_INTERNAL_UUID=y
    
    #
    # SLM-specific configurations
    #
    CONFIG_SLM_CUSTOMIZED=n
    #CONFIG_SLM_LOG_LEVEL_INF=n
    CONFIG_SLM_EXTERNAL_XTAL=n
    CONFIG_SLM_START_SLEEP=n
    #CONFIG_SLM_DATAMODE_URC=n
    
    # nRF Cloud based location services
    CONFIG_SLM_AGPS=y
    CONFIG_SLM_PGPS=n
    CONFIG_SLM_LOCATION=y
    CONFIG_MQTT_CLEAN_SESSION=y
    CONFIG_SLM_NATIVE_TLS=y
    
    # Serial DFU support
    #CONFIG_SLM_NRF52_DFU=n
    #CONFIG_SLM_NRF52_DFU_LEGACY=n
    
    CONFIG_TFM_CRYPTO_PARTITION_STACK_SIZE=0x2500

  • Hi Didrik,

    I changed the partition to this:

    EMPTY_0:
      address: 0xc000
      end_address: 0x10000
      placement:
        before:
        - mcuboot_pad
      region: flash_primary
      size: 0x4000
    EMPTY_1:
      address: 0xea000
      end_address: 0xeb000
      placement:
        after:
        - settings_storage
      region: flash_primary
      size: 0x1000
    EMPTY_2:
      address: 0xe0000
      end_address: 0xe8000
      placement:
        after:
        - mcuboot_secondary
      region: flash_primary
      size: 0x8000
    app:
      address: 0x1c200
      end_address: 0x78000
      region: flash_primary
      size: 0x5be00
    mcuboot:
      address: 0x0
      end_address: 0xc000
      placement:
        before:
        - mcuboot_primary
      region: flash_primary
      size: 0xc000
    mcuboot_pad:
      address: 0x10000
      end_address: 0x10200
      placement:
        align:
          start: 0x8000
        before:
        - mcuboot_primary_app
      region: flash_primary
      size: 0x200
    mcuboot_primary:
      address: 0x10000
      end_address: 0x78000
      orig_span: &id001
      - tfm
      - app
      - mcuboot_pad
      region: flash_primary
      sharers: 0x1
      size: 0x68000
      span: *id001
    mcuboot_primary_app:
      address: 0x10200
      end_address: 0x78000
      orig_span: &id002
      - app
      - tfm
      region: flash_primary
      size: 0x67e00
      span: *id002
    mcuboot_secondary:
      address: 0x78000
      end_address: 0xe0000
      placement:
        after:
        - mcuboot_primary
        align:
          start: 0x8000
      region: flash_primary
      share_size:
      - mcuboot_primary
      size: 0x68000
    nonsecure_storage:
      address: 0xe8000
      end_address: 0xff000
      orig_span: &id003
      - settings_storage
      - pgps
      region: flash_primary
      size: 0x17000
      span: *id003
    otp:
      address: 0xff8108
      end_address: 0xff83fc
      region: otp
      size: 0x2f4
    pgps:
      address: 0xeb000
      align:
        start: 0x8000
      end_address: 0x100000
      inside:
      - nonsecure_storage
      placement:
        before:
        - end
      region: flash_primary
      size: 0x15000
    settings_storage:
      address: 0xe8000
      end_address: 0xea000
      inside:
      - nonsecure_storage
      placement:
        align:
          start: 0x8000
        before:
        - end
      region: flash_primary
      size: 0x2000

    The application successfully compiled and FOTA return 5,0 so everything is good now

    Thanks for you help and information

    should I use this partition every time we want to move SDK?

Related