On Thu, Feb 23, 2017 at 06:05:44PM +0800, then yon wrote:
> Dear Chris,
> 
> Yes, i've followed the step you given; but after step 2 it gave me 
> "Error: Timeout reading from serial connection".
> 
> It only recover after i reset nrf52dk power and it show the result i 
> sent to you previously.
> 
> And when i tried to do step 1 again, it gave me "Error:  rc=6"

Is there anything you can do to preserve the newtmgr output in your
emails?  For some reason, the entire newtmgr response gets joined into a
single line, making it difficult to read.  I have reformatted the
responses below.

    $ newtmgr -c mynewt_serial image list
    Images:
      slot=0
        version: 1.0.0
        bootable: true
        flags: active confirmed
        hash: 6d1b9bb73f9cf223145a28e4e0d7702a1b2aaf60a7a6d66497e02a841cd72c8c
      slot=1
        version: 1.0.0
        bootable: false
        flags:
        hash: 0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b
    Split status: matching

The empty flags field in slot 1 indicates that the device is in
loader-only mode (i.e., only slot 0 is running).  It appears you have
completed step 3.  With slot 1 unused, you can overwrite it with a new
app.

    $ newtmgr -c mynewt_serial image test 
0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b
    Images:
      slot=0
        version: 1.0.0
        bootable: true
        flags: active confirmed
        hash: 6d1b9bb73f9cf223145a28e4e0d7702a1b2aaf60a7a6d66497e02a841cd72c8c
      slot=1
        version: 1.0.0
        bootable: false
        flags: pending
        hash: 0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b
    Split status: matching

The "test" command does not come until step 5.  What about step 4,
uploading the new loader?  By testing the original app image, you will
just put the device back into its original state.

    $ newtmgr -c mynewt_serial reset
    Done

    $ newtmgr -c mynewt_serial image list  ^C (cause it hang here indefinitely 
so i cancel it)

It seems like your app (slot 1) doesn't support newtmgr or lacks a
newtmgr transport.

    $ newtmgr -c mynewt_serial image upload splitty.img
    Error: Timeout reading from serial connection
    [...]

Which procedure are you following?  In the split upgrade procedure (the
one I pasted in my previous email), you only upload after issuing the
"image confirm" command.

Can you please do the following:

1. Tell me something about the target you are upgrading.  What loader
and app combo are you using?  From the above, it appears your app may
not support newtmgr.

2. Start from step 1 in the procedure I quoted, please indicate which
step you are currently on, and don't skip any steps :).

Thanks,
Chris

> 
> $ newtmgr -c mynewt_serial image list Images:  slot=0  version: 1.0.0 
> <http://1.0.0.0/> bootable: true  flags: active confirmed  hash: 
> 6d1b9bb73f9cf223145a28e4e0d7702a1b2aaf60a7a6d66497e02a841cd72c8c  slot=1 
>   version: 1.0.0 <http://1.0.0.0/> bootable: false  flags: hash: 
> 0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b  Split 
> status: matching $ newtmgr -c mynewt_serial image test 0fd 
> 6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b  Images: 
>   slot=0  version: 1.0.0 <http://1.0.0.0/> bootable: true  flags: active 
> confirmed  hash: 
> 6d1b9bb73f9cf223145a28e4e0d7702a1b2aaf60a7a6d66497e02a841cd72c8c  slot=1 
>   version: 1.0.0 <http://1.0.0.0/> bootable: false  flags: pending 
>   hash: 0fd6f020a3ff70d4cd150e6233185c6e9b8b93f60af97fb67bc728daa6573f0b 
>   Split status: matching $ newtmgr -c mynewt_serial reset  Done $ 
> newtmgr -c mynewt_serial image list  ^C (cause it hang here indefinitely 
> so i cancel it) $ newtmgr -c mynewt_serial image upload splitty.img 
> <http://plitty.img/>Error: Timeout reading from serial connection 
>   upload - Upload image to target  Usage:  newtmgr image upload [flags] 
>   Examples:  newtmgr -c olimex image upload <image_file  newtmgr -c 
> olimex image upload bin/slinky_zero/apps/slinky.img 
> <http://slinky.img/> Global Flags:  -c, --conn string connection profile 
> to use.  -l, --loglevel string log level to use (default INFO.) 
> <http://info.%29/>(default "info")  -t, --trace print all bytes 
> transmitted and received
> 
> 
> Thank you.
> 
> Regards,
> 
> Then Yoong Ze
> 
> 
> On 23/2/2017 12:44 AM, Christopher Collins wrote:
> > Hi Then,
> >
> > On Wed, Feb 22, 2017 at 02:11:36PM +0800, then yon wrote:
> >> Dear Support,
> >>
> >> I'm followed the tutorial below:
> >> https://mynewt.apache.org/latest/os/modules/split/split/
> >>
> >> But i'm stuck at image upload step; it gave me the following error:
> > [...]
> >> Error: Target error: 2
> > Error 2 indicates that there is no free slot for the new image.  In your
> > email, the "image list" output is a bit touch to read because it got
> > collapsed into a single line.  Here is my attempt to unravel it:
> >
> >> $ newtmgr -c mynewt_serial image list
> >> Images:
> >>      slot=0
> >>          version: 1.0.0
> >>          bootable: true
> >>          flags: active confirmed
> >>          hash: 
> >> 493c5e78e76a9c1b9e574ab38b7bbf0d342d928ffd0111400dbe8c2c952da68e
> >>
> >>      slot=1
> >>          version: 1.0.0
> >>          bootable: false
> >>          flags: active confirmed
> >>          hash: 
> >> 4d26a0d1596e12dab9059df3a13b4ffd54f96836cd9080d579c6afc167d58e81
> >>
> >>      Split status: matching
> > Notice that both slots have the "active" and "confirmed" flags set.
> > This indicates that both slots are currently running.  You need to run
> > the image in loader-only mode in order to replace the app in slot 1.
> > This is described in the "Image Upgrade - Split" section of the page you
> > linked to (https://mynewt.apache.org/latest/os/modules/split/split/).
> > Specifically:
> >
> >
> > 1. Disable split functionality; we need to deactivate the application
> >     image in slot 1 (newtmgr image test <current-loader-hash>).
> > 2. Reboot device (newtmgr reset).
> > 3. Make above change permanent (newtmgr image confirm).
> > 4. Upload new loader to slot 1 (newtmgr image upload <filename>).
> > 5. Tell device to "test out" the new loader on next boot (newtmgr image
> >     test <new-loader-hash>).
> > 6. Reboot device (newtmgr reset).
> > 7. Make above change of loader permanent (newtmgr image confirm).
> > 8. Upload new application to slot 1 (newtmgr image upload <filename>).
> > 9. Tell device to "test out" the new application on next boot (newtmgr
> >     image test <new-application-hash>).
> > 10. Reboot device (newtmgr reset).
> > 11. Make above change of application permanent (newtmgr image confirm).
> >
> > Steps 1 and 2 will leave the device in a state such that the app in slot
> > 1 can be replaced.
> >
> > Chris
> > .
> >
> 

Reply via email to