I'm doing some tests with newtmgr over serial since this is the lowest
cost mechanism for many users (no J-Link required), and the update
process as I understand it is as follows:
- $ newtmgr -c serial1 image upload mysignedimage.img
^ This will write the new image in slot=1 with no flags set
- $ newtmgr -c serial1 image test
4d0ff81e083f8cc9d428e8bb70ed86ae98f237ce8dd59bfd33f7493874addd1d
^ This will set the flags to 'pending' and when you reset, the image
will be moved into slot 0 and the old image will be switched to slot 1
- $ newtmgr -c serial1 reset
^ Wait for the flash switch to finish ...
The new image is now marked as 'active' but the old image has the
'confirmed' flag set so resetting again will cause the device to revert
to the old image if no action is taken, so first we need to ...
- $ newtmgr -c serial1 image confirm
4d0ff81e083f8cc9d428e8bb70ed86ae98f237ce8dd59bfd33f7493874addd1d
^ This will 'confirm' the new image (I don't think the hash is
necessary though), and then the old image will no longer be marked as
'confirmed' and resetting will maintain the new image. Notice no more
'confirmed' flag on slot 1 here, and slot 0 is now 'confirmed'
$ newtmgr -c serial1 image list
Images:
slot=0
version: 0.7.0
bootable: true
flags: active confirmed
hash:
4d0ff81e083f8cc9d428e8bb70ed86ae98f237ce8dd59bfd33f7493874addd1d
slot=1
version: 0.6.0
bootable: true
flags:
hash:
9a8fce478019c5e806253c307d32ddeab559ff6dc2577670ff6e0b1cb72f929b
Split status: N/A (0)
What confused me is that no matter if I use the has or not with 'image
confirm' I always get 'Error: 1' in the output, which is confusing.
$ newtmgr -c serial1 image confirm
4d0ff81e083f8cc9d428e8bb70ed86ae98f237ce8dd59bfd33f7493874addd1d
Error: 1
$ newtmgr -c serial1 image confirm
Error: 1
Is there a logical explanation for this? I'm running the 1.1 binaries
installed via brew on OS X 10.11.6.
Kevin