Hi,
Based on your suggestions I now have images in both slots. Why does the Bootloader boot from the image in the Secondary Slot and delete header of inactive image in primary slot (downgrade support for direct-xip) instead of moving the image in the Secondary Slot to the Primary Slot?
The Readme document says the image in the Secondary Slot should be moved to the Primary Slot.
- After new image is installed and booted, again use the 'image' command to make sure that the image moved from secondary slot into primary slot and image state is now set as "Testing".
Can you explain the discrepancy between the documentation and the actual result?
Disabling flash remapping function
Bootloader Version 1.10.0
Primary slot: version=2.1.0+0
Image 0 Secondary slot: Image not found
Found a candidate in slot 0
writing copy_done; fa_id=0 off=0x1fffe0 (0x23ffe0)
Image 0 loaded from the primary slot
Bootloader chainload address offset: 0x40000
Reset_Handler address offset: 0x40400
Jumping to the image
Booting the primary slot - flash remapping is disabled
OTA HTTPS client demo V1V1V1 (Ethernet)
Initializing PHY...
Obtaining IP address from DHCP...
************************************************
OTA HTTPS Client Example
************************************************
IPv4 Address : 10.1.15.110
IPv4 Subnet mask : 255.255.255.0
IPv4 Gateway : 10.1.15.1
************************************************
Copyright 2022 NXP
$ image info
Image 0; name APP; state None:
Slot 0; slotAddr 30040000; slotSize 2097152
<IMAGE APP_PRIMARY: size 253664; version 2.1.0.0>
Slot 1; slotAddr 30240000; slotSize 2097152
<EMPTY>
$ ota 0 /ota.bin 10.1.15.119 4433
Started OTA with:
image = 0
file = /ota.bin
host = 10.1.15.119
port = 4433
. Seeding the random number generator...
. Loading the CA root certificate... ok (0 skipped)
. Loading the client cert. and key... ok
. Connecting to 10.1.15.119:4433
. Setting up the SSL/TLS structure... ok
. SSL state connect : 0
. Performing the SSL/TLS handshake...
[ Protocol is TLSv1.2 ]
[ Ciphersuite is TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384 ]
[ Record expansion is 29 ]
. Verifying peer X.509 certificate... SKIPPED
Getting size of requested file '/ota.bin'
Determined file size is 255024 bytes
Starting download of 255024 bytes with block size of 4096 bytes
...............................................................
Download loop completed with size 255024, expected 255024
MD5 hexdump of downloaded data:
00000000 D0 B2 1D E5 3E CD 0C EE D5 DE 5B D3 4B F5 95 49 |....>.....[.K..I|
MD5 hexdump of flashed data:
00000000 D0 B2 1D E5 3E CD 0C EE D5 DE 5B D3 4B F5 95 49 |....>.....[.K..I|
OTA image was downloaded successfully.
$ image info
Image 0; name APP; state None:
Slot 0; slotAddr 30040000; slotSize 2097152
<IMAGE APP_PRIMARY: size 253664; version 2.1.0.0>
Slot 1; slotAddr 30240000; slotSize 2097152
<IMAGE APP_SECONDARY: size 253664; version 2.2.0.0>
$ image test 0
write magic number offset = 0x43ff00
$ image info
Image 0; name APP; state ReadyForTest:
Slot 0; slotAddr 30040000; slotSize 2097152
<IMAGE APP_PRIMARY: size 253664; version 2.1.0.0>
Slot 1; slotAddr 30240000; slotSize 2097152
<IMAGE APP_SECONDARY: size 253664; version 2.2.0.0>
$ hello sbl.
Disabling flash remapping function
Bootloader Version 1.10.0
Primary slot: version=2.1.0+0
Secondary slot: version=2.2.0+0
Found a candidate in slot 1
writing copy_done; fa_id=1 off=0x1fffe0 (0x43ffe0)
Image 0 loaded from the secondary slot
Bootloader chainload address offset: 0x240000
Reset_Handler address offset: 0x240400
Jumping to the image
Booting the secondary slot - flash remapping is enabled
OTA HTTPS client demo V2V2V2 (Ethernet)
Initializing PHY...
Obtaining IP address from DHCP...
************************************************
OTA HTTPS Client Example
************************************************
IPv4 Address : 10.1.15.110
IPv4 Subnet mask : 255.255.255.0
IPv4 Gateway : 10.1.15.1
************************************************
Copyright 2022 NXP
$ image info
Image 0; name APP; state Testing:
Slot 0; slotAddr 30040000; slotSize 2097152
<IMAGE APP_PRIMARY: size 253664; version 2.1.0.0>
Slot 1; slotAddr 30240000; slotSize 2097152
<IMAGE APP_SECONDARY: size 253664; version 2.2.0.0>
$ image accept 0
Deleting header of inactive image in primary slot (downgrade support for direct- xip)
$ hello sbl.
Disabling flash remapping function
Bootloader Version 1.10.0
Image 0 Primary slot: Image not found
Secondary slot: version=2.2.0+0
Image 0 loaded from the secondary slot
Bootloader chainload address offset: 0x240000
Reset_Handler address offset: 0x240400
Jumping to the image
Booting the secondary slot - flash remapping is enabled
OTA HTTPS client demo V2V2V2 (Ethernet)
Initializing PHY...
Obtaining IP address from DHCP...
************************************************
OTA HTTPS Client Example
************************************************
IPv4 Address : 10.1.15.110
IPv4 Subnet mask : 255.255.255.0
IPv4 Gateway : 10.1.15.1
************************************************
Copyright 2022 NXP
$ image info
Image 0; name APP; state Permanent:
Slot 0; slotAddr 30040000; slotSize 2097152
<EMPTY>
Slot 1; slotAddr 30240000; slotSize 2097152
<IMAGE APP_SECONDARY: size 253664; version 2.2.0.0>
$