0

[workaround] Feather nrf52 Pro mynewt bootloader unresponsiv
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

[workaround] Feather nrf52 Pro mynewt bootloader unresponsiv

by mlampert on Wed Jan 10, 2018 2:46 am

Got my nrf52 Pro today and cannot program the feather board using the newtmgr as indicated in the tutorials (https://learn.adafruit.com/adafruit-nrf ... er/newtmgr).

The red LED flashes with about 1Hz, if hit the DFU button and try to upload the image the flash frequency of the LED doubles but the upload fails with a timeout:

Code: Select all | TOGGLE FULL SIZE
markus@occ7:/usr/share/openocd$ newtmgr conn show
Connection profiles:
  usb0: type=serial, connstring='/dev/ttyUSB0'
markus@occ7:~/projects/newt/blinky$ newtmgr -c usb0 image upload bin/targets/feather/app/apps/blinky/blinky.img
 0 B / 11.30 KiB [-----------------------------------------------------]   0.00%
Error: Timeout reading from serial connection


I can connect to the board over /dev/ttyUSB0 with picocom and run manual commands but I cannot download images and reprogram it.

Any help appreciated, thanks
Markus

PS: using Debian testing, newt tools installed binary from the runtimeco repository

mlampert
 
Posts: 3
Joined: Thu May 12, 2016 12:09 am

Re: [workaround] Feather nrf52 Pro mynewt bootloader unrespo

by mlampert on Thu Jan 11, 2018 12:02 am

Got a workaround on the newt slack channel and it works like a charm:
Code: Select all | TOGGLE FULL SIZE
newtmgr --conntype serial --connextra 'dev=/dev/ttyUSB0,mtu=128' image upload -e bin/targets/feather/app/apps/blinky/blinky.img


The changes to the documented command are mtu=128 and -e, and here's the background I got provided:

Just to explain why those two changes are needed:
*MTU* - the serial boot loader used to have a smaller receive buffer (128 bytes). The newtmgr tool sends larger image chunks by default.
*No erase* - the serial boot loader doesn't support the standalone "erase image" command, so it drops the request. The `newtmgr image upload` command starts by sending an erase command, then times out when it doesn't receive a response.
The older version of newtmgr would use a smaller chunk size for images, and it did not send the standalone erase command. When newtmgr was changed in 1.2 or 1.3, the serial boot loader changed along with it. The latest newtmgr is not compatible with an older version of the boot loader (which your board was probably shipped with) without the above workarounds.


HTH, and happy BLE'ing!

mlampert
 
Posts: 3
Joined: Thu May 12, 2016 12:09 am

Re: [workaround] Feather nrf52 Pro mynewt bootloader unrespo

by svanschalkwyk on Fri Jan 12, 2018 10:33 pm

I received mine today and have run into the same problem.
This is my result:
newtmgr --conntype serial --connextra 'dev=/dev/ttyUSB0,mtu=128' image upload -e /home/steph/Projects/NEWT/Adafruit_Mynewt/bin/targets/blinky/app/apps/blinky/blinky.img
0 B / 15.83 KiB [---------------------------------------------------------------------------------------------------------------------------] 0.00%Error: Timeout reading from serial connection
Any other ideas?

svanschalkwyk
 
Posts: 14
Joined: Fri Jan 12, 2018 9:44 pm

Re: [workaround] Feather nrf52 Pro mynewt bootloader unrespo

by svanschalkwyk on Sat Jan 13, 2018 1:45 pm

steph@swartjie ~/Projects/NEWT/Adafruit_Mynewt $ newtmgr --conntype serial --connextra 'dev=/dev/ttyUSB0,mtu=128' image upload -e bin/targets/bleuart/app/apps/bleuart/bleuart.img -l debug
DEBU[2018-01-13 11:42:20.106] Using connection profile: name=unnamed type=serial connstring=dev=/dev/ttyUSB0,mtu=128
DEBU[2018-01-13 11:42:20.107] {add-oic-listener} [transceiver.go:62] token=[]
DEBU[2018-01-13 11:42:20.107] {add-oic-listener} [transceiver.go:62] token=[]
0 / 157608 [--------------------------------------------------------------------------------------------------------------------------------] 0.00%DEBU[2018-01-13 11:42:20.107] Encoded &{NmpBase:{hdr:{Op:2 Flags:0 Len:0 Group:1 Seq:66 Id:1}} Off:0 Len:157608 Data:[]} to:
00000000 a3 64 64 61 74 61 f6 63 6c 65 6e 1a 00 02 67 a8 |.ddata.clen...g.|
00000010 63 6f 66 66 00 |coff.|

DEBU[2018-01-13 11:42:20.107] Encoded:
00000000 02 00 00 15 00 01 42 01 a3 64 64 61 74 61 f6 63 |......B..ddata.c|
00000010 6c 65 6e 1a 00 02 67 a8 63 6f 66 66 00 |len...g.coff.|

DEBU[2018-01-13 11:42:20.107] Encoded &{NmpBase:{hdr:{Op:2 Flags:0 Len:0 Group:1 Seq:67 Id:1}} Off:0 Len:157608 Data:[61 184 243 150 0 0 0 0 32 0 0 0 96 103 2 0 0 0 0 0 1 3 0 0 0 0 0 0 0 0 0 0 0 0 1 32 249 128 0 0 85 129 0 0 87 129 0 0 0 0 0 0 0 0]} to:
00000000 a3 64 64 61 74 61 58 36 3d b8 f3 96 00 00 00 00 |.ddataX6=.......|
00000010 20 00 00 00 60 67 02 00 00 00 00 00 01 03 00 00 | ...`g..........|
00000020 00 00 00 00 00 00 00 00 00 00 01 20 f9 80 00 00 |........... ....|
00000030 55 81 00 00 57 81 00 00 00 00 00 00 00 00 63 6c |U...W.........cl|
00000040 65 6e 1a 00 02 67 a8 63 6f 66 66 00 |en...g.coff.|

DEBU[2018-01-13 11:42:20.107] Encoded:
00000000 02 00 00 4c 00 01 43 01 a3 64 64 61 74 61 58 36 |...L..C..ddataX6|
00000010 3d b8 f3 96 00 00 00 00 20 00 00 00 60 67 02 00 |=....... ...`g..|
00000020 00 00 00 00 01 03 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 01 20 f9 80 00 00 55 81 00 00 57 81 00 00 |... ....U...W...|
00000040 00 00 00 00 00 00 63 6c 65 6e 1a 00 02 67 a8 63 |......clen...g.c|
00000050 6f 66 66 00 |off.|

DEBU[2018-01-13 11:42:20.107] {add-nmp-listener} [serial_sesn.go:143] seq=68
DEBU[2018-01-13 11:42:20.107] Encoded &{NmpBase:{hdr:{Op:2 Flags:0 Len:0 Group:1 Seq:68 Id:1}} Off:0 Len:157608 Data:[61 184 243 150 0 0 0 0 32 0 0 0 96 103 2 0 0 0 0 0 1 3 0 0 0 0 0 0 0 0 0 0 0 0 1 32 249 128 0 0 85 129 0 0 87 129 0 0 0 0 0 0 0]} to:
00000000 a3 64 64 61 74 61 58 35 3d b8 f3 96 00 00 00 00 |.ddataX5=.......|
00000010 20 00 00 00 60 67 02 00 00 00 00 00 01 03 00 00 | ...`g..........|
00000020 00 00 00 00 00 00 00 00 00 00 01 20 f9 80 00 00 |........... ....|
00000030 55 81 00 00 57 81 00 00 00 00 00 00 00 63 6c 65 |U...W........cle|
00000040 6e 1a 00 02 67 a8 63 6f 66 66 00 |n...g.coff.|

DEBU[2018-01-13 11:42:20.107] Encoded:
00000000 02 00 00 4b 00 01 44 01 a3 64 64 61 74 61 58 35 |...K..D..ddataX5|
00000010 3d b8 f3 96 00 00 00 00 20 00 00 00 60 67 02 00 |=....... ...`g..|
00000020 00 00 00 00 01 03 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 01 20 f9 80 00 00 55 81 00 00 57 81 00 00 |... ....U...W...|
00000040 00 00 00 00 00 63 6c 65 6e 1a 00 02 67 a8 63 6f |.....clen...g.co|
00000050 66 66 00 |ff.|

DEBU[2018-01-13 11:42:20.107] Tx NMP request: 00000000 02 00 00 4b 00 01 44 01 a3 64 64 61 74 61 58 35 |...K..D..ddataX5|
00000010 3d b8 f3 96 00 00 00 00 20 00 00 00 60 67 02 00 |=....... ...`g..|
00000020 00 00 00 00 01 03 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 01 20 f9 80 00 00 55 81 00 00 57 81 00 00 |... ....U...W...|
00000040 00 00 00 00 00 63 6c 65 6e 1a 00 02 67 a8 63 6f |.....clen...g.co|
00000050 66 66 00 |ff.|

DEBU[2018-01-13 11:42:20.107] Base64 encoding request:
00000000 02 00 00 4b 00 01 44 01 a3 64 64 61 74 61 58 35 |...K..D..ddataX5|
00000010 3d b8 f3 96 00 00 00 00 20 00 00 00 60 67 02 00 |=....... ...`g..|
00000020 00 00 00 00 01 03 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 01 20 f9 80 00 00 55 81 00 00 57 81 00 00 |... ....U...W...|
00000040 00 00 00 00 00 63 6c 65 6e 1a 00 02 67 a8 63 6f |.....clen...g.co|
00000050 66 66 00 |ff.|

DEBU[2018-01-13 11:42:20.107] Tx serial
00000000 06 09 |..|

DEBU[2018-01-13 11:42:20.107] Tx serial
00000000 41 46 55 43 41 41 42 4c 41 41 46 45 41 61 4e 6b |AFUCAABLAAFEAaNk|
00000010 5a 47 46 30 59 56 67 31 50 62 6a 7a 6c 67 41 41 |ZGF0YVg1PbjzlgAA|
00000020 41 41 41 67 41 41 41 41 59 47 63 43 41 41 41 41 |AAAgAAAAYGcCAAAA|
00000030 41 41 41 42 41 77 41 41 41 41 41 41 41 41 41 41 |AAABAwAAAAAAAAAA|
00000040 41 41 41 41 41 41 45 67 2b 59 41 41 41 46 57 42 |AAAAAAEg+YAAAFWB|
00000050 41 41 42 58 67 51 41 41 41 41 41 41 41 41 42 6a |AABXgQAAAAAAAABj|
00000060 62 47 56 75 47 67 41 43 5a 36 68 6a 62 32 5a 6d |bGVuGgACZ6hjb2Zm|
00000070 41 4e 6f 61 |ANoa|

DEBU[2018-01-13 11:42:20.107] Tx serial
00000000 0a |.|

0 B / 153.91 KiB [--------------------------------------------------------------------------------------------------------------------------] 0.00%DEBU[2018-01-13 11:42:20.615] Rx serial:
00000000 30 3a 5b 74 73 3d 30 73 73 62 2c 20 6d 6f 64 3d |0:[ts=0ssb, mod=|
00000010 31 37 33 20 6c 65 76 65 6c 3d 31 5d 20 5b 42 4c |173 level=1] [BL|
00000020 45 44 49 53 5d 20 4d 6f 64 65 6c 20 4e 75 6d 62 |EDIS] Model Numb|
00000030 65 72 20 61 64 64 65 64 |er added|

DEBU[2018-01-13 11:42:20.63] Rx serial:
00000000 31 3a 5b 74 73 3d 37 38 31 32 73 73 62 2c 20 6d |1:[ts=7812ssb, m|
00000010 6f 64 3d 31 37 33 20 6c 65 76 65 6c 3d 31 5d 20 |od=173 level=1] |
00000020 5b 42 4c 45 44 49 53 5d 20 53 65 72 69 61 6c 20 |[BLEDIS] Serial |
00000030 4e 75 6d 62 65 72 20 61 64 64 65 64 |Number added|

DEBU[2018-01-13 11:42:20.639] Rx serial:
00000000 33 3a 5b 74 73 3d 32 33 34 33 36 73 73 62 2c 20 |3:[ts=23436ssb, |
00000010 6d 6f 64 3d 31 37 33 20 6c 65 76 65 6c 3d 31 5d |mod=173 level=1]|
00000020 20 5b 42 4c 45 44 49 53 5d 20 46 69 72 6d 77 61 | [BLEDIS] Firmwa|
00000030 72 65 20 52 65 76 69 73 69 6f 6e 20 61 64 64 65 |re Revision adde|
00000040 64 |d|

DEBU[2018-01-13 11:42:20.652] Rx serial:
00000000 34 3a 5b 74 73 3d 33 31 32 34 38 73 73 62 2c 20 |4:[ts=31248ssb, |
00000010 6d 6f 64 3d 31 37 33 20 6c 65 76 65 6c 3d 31 5d |mod=173 level=1]|
00000020 20 5b 42 4c 45 44 49 53 5d 20 4d 61 6e 75 66 61 | [BLEDIS] Manufa|
00000030 63 74 75 72 65 72 20 61 64 64 65 64 |cturer added|

0 B / 153.91 KiB [--------------------------------------------------------------------------------------------------------------------------] 0.00%DEBU[2018-01-13 11:42:30.649] {remove-nmp-listener} [serial_sesn.go:143] seq=68
DEBU[2018-01-13 11:42:30.65] goroutine 1 [running]:
mynewt.apache.org/newtmgr/vendor/mynewt.apache.org/newt/util.NewNewtError(0x55a0d9485096, 0x26, 0x26)
/tmp/mynewt.Y5S7Pee2zvi/src/mynewt.apache.org/newtmgr/vendor/mynewt.apache.org/newt/util/util.go:77 +0x111
mynewt.apache.org/newtmgr/vendor/mynewt.apache.org/newt/util.ChildNewtError(0x55a0d995d680, 0xc420126660, 0xc4201beaa0)
/tmp/mynewt.Y5S7Pee2zvi/src/mynewt.apache.org/newtmgr/vendor/mynewt.apache.org/newt/util/util.go:103 +0xb1
mynewt.apache.org/newtmgr/newtmgr/cli.imageUploadCmd(0xc4201b9680, 0xc420140780, 0x1, 0x8)
/tmp/mynewt.Y5S7Pee2zvi/src/mynewt.apache.org/newtmgr/newtmgr/cli/image.go:202 +0x487
mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra.(*Command).execute(0xc4201b9680, 0xc420140600, 0x8, 0x8, 0xc4201b9680, 0xc420140600)
/tmp/mynewt.Y5S7Pee2zvi/src/mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra/command.go:654 +0x47b
mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc4201b8000, 0xc4201b8480, 0xc4201b8240, 0xc4201380f0)
/tmp/mynewt.Y5S7Pee2zvi/src/mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra/command.go:729 +0x367
mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra.(*Command).Execute(0xc4201b8000, 0x55a0d94b8e38, 0xc420150240)
/tmp/mynewt.Y5S7Pee2zvi/src/mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra/command.go:688 +0x2b
main.main()
/tmp/mynewt.Y5S7Pee2zvi/src/mynewt.apache.org/newtmgr/newtmgr/newtmgr.go:102 +0xfa

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/lib/go-1.7/src/runtime/asm_amd64.s:2086 +0x1

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

goroutine 18 [select, locked to thread]:
runtime.gopark(0x55a0d94bb038, 0x0, 0x55a0d946f761, 0x6, 0x18, 0x2)
/usr/lib/go-1.7/src/runtime/proc.go:259 +0x13a
runtime.selectgoImpl(0xc420036730, 0x0, 0x18)
/usr/lib/go-1.7/src/runtime/select.go:423 +0x11d9
runtime.selectgo(0xc420036730)
/usr/lib/go-1.7/src/runtime/select.go:238 +0x1c
runtime.ensureSigM.func1()
/usr/lib/go-1.7/src/runtime/signal1_unix.go:304 +0x2f3
runtime.goexit()
/usr/lib/go-1.7/src/runtime/asm_amd64.s:2086 +0x1

goroutine 34 [chan receive]:
main.main.func1(0xc420150240)
/tmp/mynewt.Y5S7Pee2zvi/src/mynewt.apache.org/newtmgr/newtmgr/newtmgr.go:88 +0x57
created by main.main
/tmp/mynewt.Y5S7Pee2zvi/src/mynewt.apache.org/newtmgr/newtmgr/newtmgr.go:100 +0xe8

goroutine 35 [select]:
mynewt.apache.org/newtmgr/nmxact/omp.(*Dispatcher).addOmpListener.func1(0xc4201367e0, 0xc42013c640)
/tmp/mynewt.Y5S7Pee2zvi/src/mynewt.apache.org/newtmgr/nmxact/omp/dispatch.go:72 +0x3e5
created by mynewt.apache.org/newtmgr/nmxact/omp.(*Dispatcher).addOmpListener
/tmp/mynewt.Y5S7Pee2zvi/src/mynewt.apache.org/newtmgr/nmxact/omp/dispatch.go:90 +0xac

goroutine 36 [select]:
mynewt.apache.org/newtmgr/nmxact/omp.(*Dispatcher).addOmpListener.func1(0xc420136960, 0xc42013c780)
/tmp/mynewt.Y5S7Pee2zvi/src/mynewt.apache.org/newtmgr/nmxact/omp/dispatch.go:72 +0x3e5
created by mynewt.apache.org/newtmgr/nmxact/omp.(*Dispatcher).addOmpListener
/tmp/mynewt.Y5S7Pee2zvi/src/mynewt.apache.org/newtmgr/nmxact/omp/dispatch.go:90 +0xac

goroutine 37 [select]:
mynewt.apache.org/newtmgr/vendor/github.com/cheggaaa/pb.(*ProgressBar).refresher(0xc4201c82c0)
/tmp/mynewt.Y5S7Pee2zvi/src/mynewt.apache.org/newtmgr/vendor/github.com/cheggaaa/pb/pb.go:462 +0x10c
created by mynewt.apache.org/newtmgr/vendor/github.com/cheggaaa/pb.(*ProgressBar).Start
/tmp/mynewt.Y5S7Pee2zvi/src/mynewt.apache.org/newtmgr/vendor/github.com/cheggaaa/pb/pb.go:123 +0xc7

Error: Timeout reading from serial connection
steph@swartjie ~/Projects/NEWT/Adafruit_Mynewt $

svanschalkwyk
 
Posts: 14
Joined: Fri Jan 12, 2018 9:44 pm

Re: [workaround] Feather nrf52 Pro mynewt bootloader unrespo

by svanschalkwyk on Tue Jan 16, 2018 5:09 pm

Solved. Have to hold DFU low and use
newtmgr --conn serial1 --conntype serial --connextra 'dev=/dev/ttyUSB0,mtu=128' image upload -e /home/steph/Projects/NEWT/first/bin/targets/bleuart/app/apps/bleuart/bleuart.img
None of the other newtmgr commands work though. All time out.

svanschalkwyk
 
Posts: 14
Joined: Fri Jan 12, 2018 9:44 pm

Please be positive and constructive with your questions and comments.