在使用SBL和SFW完成OTA升级后,重新复位板子,app会回退到升级之前的旧版本,猜测可能和swap的几种模式有关,恳请知道问题在哪儿的人员一些指导和建议,相关打印信息如下:
/*开发板已经提前烧写过sbl和app1.bin*/
hello sbl.
Bootloader Version 1.1.0
Primary image: magic=good, swap_type=0x4, copy_done=0x1, image_ok=0x1
Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
Boot source: none
Swap type: none
Bootloader chainload address offset: 0x100000
Reset_Handler address offset: 0x100400
Jumping to the image
hello sfw.
Current image verison: 1.1.0
U-Disk updating task enable.
Hello world1.
Hello world2.
Please plug in a u-disk to board.
Hello world1.
Hello world2.
Hello world1.
Hello world2.
Hello world1.
Hello world2.
Hello world1.
Hello world2.
Hello world1.
Hello world2.
Hello world1.
/*插入U盘*/
mass storage device attached:pid=0x6545vid=0x30de address=1
U-Disk OTA test
fatfs mount as logiacal driver 1......success
reading...
new img verison: 1.2.0
updating...
finished
write update type = 0x2
write magic number offset = 0x2fffe0
Please unplug the u-disk!
sys rst...
/*拔出U盘*/
Hello world1.
Hello world2.
Hello world1.
Hello world2.
Hello world1.
Hello world2.
Hello world1.
Hello world2.
Hello world1.
Hello world2.
hello sbl.
Bootloader Version 1.1.0
Primary image: magic=good, swap_type=0x4, copy_done=0x1, image_ok=0x1
Secondary image: magic=good, swap_type=0x1, copy_done=0x3, image_ok=0x3
Boot source: none
Swap type: test
erasing trailer; fa_id=1
initializing status; fa_id=1
writing swap_info; fa_id=1 off=0xlx (0xlx), swap_type=0xfffd8 image_num=0x1fffd8
writing swap_size; fa_id=1 off=0xlx (0xlx)
writing magic; fa_id=1 off=0xlx (0xlx)
erasing trailer; fa_id=2
writing copy_done; fa_id=1 off=0xlx (0xlx)
Bootloader chainload address offset: 0x100000
Reset_Handler address offset: 0x100400
Jumping to the image
/*正常升级*/
hello sfw.
Current image verison: 1.2.0
U-Disk updating task enable.
Hello world3.
Hello world4.
Please plug in a u-disk to board.
Hello world4.
Hello world3.
Hello world4.
Hello world4.
Hello world3.
Hello world4.
Hello world3.
Hello world4.
Hello world3.
Hello world4.
/*重新上电*/
hello sbl.
Bootloader Version 1.1.0
Primary image: magic=good, swap_type=0x2, copy_done=0x1, image_ok=0x3
Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
Boot source: none
Swap type: revert
Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
erasing trailer; fa_id=2
writing image_ok; fa_id=2 off=0xlx (0xlx)
writing swap_size; fa_id=2 off=0xlx (0xlx)
writing magic; fa_id=2 off=0xlx (0xlx)
erasing trailer; fa_id=1
initializing status; fa_id=1
writing swap_info; fa_id=1 off=0xlx (0xlx), swap_type=0xfffd8 image_num=0x1fffd8
writing image_ok; fa_id=1 off=0xlx (0xlx)
writing swap_size; fa_id=1 off=0xlx (0xlx)
writing magic; fa_id=1 off=0xlx (0xlx)
erasing trailer; fa_id=2
writing copy_done; fa_id=1 off=0xlx (0xlx)
Bootloader chainload address offset: 0x100000
Reset_Handler address offset: 0x100400
Jumping to the image
/*按道理应该升级过后直接启动高版本,但实际情况是重新上电又回退到低版本*/
hello sfw.
Current image verison: 1.1.0
U-Disk updating task enable.
Hello world1.
Hello world2.
Please plug in a u-disk to board.
Hello world1.
Hello world2.
Hello world1.
Hello world2.
Hello world1.
Hello world2.
Hello world1.
Hello world2.
Hello world1.
Hello world2.
Hello world1.
Hello world2