Uploaded image for project: 'Mynewt'
  1. Mynewt
  2. MYNEWT-572

newtmgr reset command succeeds under the hood, yet fails to recover

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • None
    • v1_0_0_rel
    • Newtmgr
    • Security Level: Public (Viewable by anyone)
    • None
    • develop branch
      macos
      nrf51-16kbram target

    Description

      The reset after image confirm is successful, but newtmgr is having trouble recovering from the command:

      Ive seen it error like this:
      Jacobs-MacBook-Air:mynewt-hr-observer jacobrosenthal$ newtmgr reset -cserial1 -t -ldebug
      2017/01/25 17:13:31 [DEBUG] Writing newtmgr request &

      {Op:2 Flags:0 Len:2 Group:0 Seq:0 Id:5 Data:[123 125]}

      2017/01/25 17:13:31 [DEBUG] Serializing request &

      {Op:2 Flags:0 Len:2 Group:0 Seq:0 Id:5 Data:[123 125]}

      into buffer [2 0 0 2 0 0 0 5 123 125]
      2017/01/25 17:13:31 [DEBUG] Tx packet dump:
      00000000 02 00 00 02 00 00 00 05 7b 7d |........{}|

      2017/01/25 17:13:31 [INFO] Outgoing:
      00000000 06 09 |..|

      2017/01/25 17:13:31 [DEBUG] Writing [6 9] to data channel
      2017/01/25 17:13:31 [INFO] Outgoing:
      00000000 41 41 77 43 41 41 41 43 41 41 41 41 42 58 74 39 |AAwCAAACAAAABXt9|
      00000010 4c 67 41 3d |LgA=|

      2017/01/25 17:13:31 [DEBUG] Writing [65 65 119 67 65 65 65 67 65 65 65 65 66 88 116 57 76 103 65 61] to data channel
      2017/01/25 17:13:31 [INFO] Outgoing:
      00000000 0a |.|

      2017/01/25 17:13:31 [DEBUG] Writing [10] to data channel
      2017/01/25 17:13:44 [INFO] Incoming:
      00000000 06 09 41 41 77 43 41 41 41 43 41 41 41 41 42 58 |..AAwCAAACAAAABX|
      00000010 74 39 4c 67 41 3d 31 3a |t9LgA=1:|

      2017/01/25 17:13:44 [DEBUG] Reading [6 9 65 65 119 67 65 65 65 67 65 65 65 65 66 88 116 57 76 103 65 61 49 58] from data channel
      2017/01/25 17:13:44 [INFO] Message: base64 decode error

      2017/01/25 17:13:44 [DEBUG] goroutine 1 [running]:
      mynewt.apache.org/newt/newtmgr/vendor/mynewt.apache.org/newt/util.NewNewtError(0xc420160380, 0xdd, 0xc42004bb50)
      /Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newt/newtmgr/vendor/mynewt.apache.org/newt/util/util.go:75 +0x111
      mynewt.apache.org/newt/newtmgr/transport.(*ConnSerial).ReadPacket(0xc420140870, 0xc420146c00, 0x4080a8a, 0xc420140870)
      /Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newt/newtmgr/transport/connserial.go:149 +0x7b2
      mynewt.apache.org/newt/newtmgr/protocol.(*CmdRunner).ReadResp(0xc42015f210, 0xc4201468c0, 0x0, 0x0)
      /Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newt/newtmgr/protocol/cmdrunner.go:42 +0x9c
      mynewt.apache.org/newt/newtmgr/cli.resetRunCmd(0xc42016c240, 0xc420140630, 0x0, 0x3)
      /Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newt/newtmgr/cli/reset.go:50 +0x1ab
      mynewt.apache.org/newt/newtmgr/vendor/github.com/spf13/cobra.(*Command).execute(0xc42016c240, 0xc420140480, 0x3, 0x3, 0xc42016c240, 0xc420140480)
      /Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newt/newtmgr/vendor/github.com/spf13/cobra/command.go:636 +0x443
      mynewt.apache.org/newt/newtmgr/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc420166000, 0xc420166b40, 0xc420166240, 0xc42015eec0)
      /Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newt/newtmgr/vendor/github.com/spf13/cobra/command.go:722 +0x367
      mynewt.apache.org/newt/newtmgr/vendor/github.com/spf13/cobra.(*Command).Execute(0xc420166000, 0x40d65bc, 0xc4200001a0)
      /Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newt/newtmgr/vendor/github.com/spf13/cobra/command.go:681 +0x2b
      main.main()
      /Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newt/newtmgr/newtmgr.go:25 +0x2f

      goroutine 17 [syscall, locked to thread]:
      runtime.goexit()
      /usr/local/Cellar/go/1.7.4_1/libexec/src/runtime/asm_amd64.s:2086 +0x1

      goroutine 5 [syscall]:
      os/signal.signal_recv(0x0)
      /usr/local/Cellar/go/1.7.4_1/libexec/src/runtime/sigqueue.go:116 +0x157
      os/signal.loop()
      /usr/local/Cellar/go/1.7.4_1/libexec/src/os/signal/signal_unix.go:22 +0x22
      created by os/signal.init.1
      /usr/local/Cellar/go/1.7.4_1/libexec/src/os/signal/signal_unix.go:28 +0x41

      Error: Couldn't decode base64 string: AAwCAAACAAAABXt9LgA=1:
      Packet hex dump:
      00000000 06 09 41 41 77 43 41 41 41 43 41 41 41 41 42 58 |..AAwCAAACAAAABX|
      00000010 74 39 4c 67 41 3d 31 3a |t9LgA=1:|

      reset - Send reset request to remote endpoint using newtmgr

      Usage:
      newtmgr reset [flags]

      Global Flags:
      -c, --conn string connection profile to use.
      -l, --loglevel string log level to use (default INFO.) (default "info")
      -t, --trace print all bytes transmitted and received
      Jacobs-MacBook-Air:mynewt-hr-observer jacobrosenthal$

      And Ive seen it hang forever:
      Jacobs-MacBook-Air:apache-mynewt-core jacobrosenthal$ newtmgr -lDEBUG -c serial1 reset
      2017/01/26 16:00:25 [DEBUG] Writing newtmgr request &

      {Op:2 Flags:0 Len:2 Group:0 Seq:0 Id:5 Data:[123 125]}

      2017/01/26 16:00:25 [DEBUG] Serializing request &

      {Op:2 Flags:0 Len:2 Group:0 Seq:0 Id:5 Data:[123 125]}

      into buffer [2 0 0 2 0 0 0 5 123 125]
      2017/01/26 16:00:25 [DEBUG] Tx packet dump:
      00000000 02 00 00 02 00 00 00 05 7b 7d |........{}|

      2017/01/26 16:00:25 [DEBUG] Writing [6 9] to data channel
      2017/01/26 16:00:25 [DEBUG] Writing [65 65 119 67 65 65 65 67 65 65 65 65 66 88 116 57 76 103 65 61] to data channel
      2017/01/26 16:00:25 [DEBUG] Writing [10] to data channel

      Attachments

        Issue Links

          Activity

            People

              ccollins476 Christopher Collins
              jacobrosenthal Jacob Rosenthal
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: