question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UpdaterShell : bk w fails with large/long key

See original GitHub issue

Thanks for the new ‘bk’ commands. Testing with an AS100, it works with single byte values

>bk r 0x013e0003
01
>bk w 0x013e0003 0
Success
>bk r 0x013e0003  
00

But fails when I try a multi-byte value

>bk w 0x013e0002 01000001054449524543542d444f4c303a524d2d4c565231000000000000000000000000000012767a602a1549522f4119572313180326434e052510195a2f46445b29134001211f1f00741e1c5177424e50264c4e06231f420e2e4146522a421a5c261d18050001
Error: byte must be in range(0, 256)
>bk w 0x013e0002 01 00 00 01 05 44 49 52 45 43 54 2d 44 4f 4c 30 3a 52 4d 2d 4c 56 52 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 76 7a 60 2a 15 49 52 2f 41 19 57 23 13 18 03 26 43 4e 05 25 10 19 5a 2f 46 44 5b 29 13 40 01 21 1f 1f 00 74 1e 1c 51 77 42 4e 50 26 4c 4e 06 23 1f 42 0e 2e 41 46 52 2a 42 1a 5c 26 1d 18 05 00 01
Error: Unknown error

Reading that particular key works, but I note that the key is a lot longer than the number of bytes I’m trying to write. Do I need to fill all the bytes? UpdaterShell should perhaps zero-fill the rest, as ‘bk.elf’ does.

From ‘fwtool.py -printbackup’ id=0x013e0002, size=0x05dc, attr=0x44:

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mungewellcommented, Dec 10, 2017

Seems that a work around is:

$ stty -icanon
$ sudo python3 pmca-console.py updatershell

And then the ‘bk w’ command succeeds

>bk w 0x00030039 80 80 80 80 80 ... 00 00 00 00 00 01 08 02 02 02 02 10 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Len:4143
ID = 196665 (30039)
<class 'list'> 1376
last 10 items: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Success
0reactions
mungewellcommented, Dec 10, 2017

Oh Crap!.

Input() is returning a string of 4095 characters (plus the ‘\x00’ I guess), and silently truncating the block of data. https://stackoverflow.com/questions/30315957/string-from-input-is-limited

(I’m running on Xubuntu/Linux)

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found