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: 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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?

  • 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