[flashrom] Flashrom with Serprog/Arduino on nano v3

flashrom at secure-proxy.org flashrom at secure-proxy.org
Thu Oct 10 09:41:19 CEST 2013


Hello,

i try to read SPI flash from a bricked wifi access point.  For that purpose I have unsoldered the 4M SPI flash, soldered it onto an ssop-breakout board where I connected it to an Arduino-Nano.

I use flashrom out of my ubuntu distribution, and compiled serprog-duino myself.

Running flashrom to detect the device works as expected:

------------
$ flashrom  -p serprog:dev=/dev/ttyUSB0:2000000
flashrom v0.9.5.2-r1517 on Linux 3.2.0-54-generic-pae (i686), built with libpci 3.1.8, GCC 4.6.3, little endian
flashrom is free software, get the source code at http://www.flashrom.org

Calibrating delay loop... OK.
serprog: Programmer name is "serprog-duino"
Found Macronix flash chip "MX25L3205" (4096 kB, SPI) on serprog.
No operations were specified.
------------

However when I add the "-r filename" Option, to read the content of the flash, the program get stuck.
I tried the master and the ftdi-branch from serprog-duino [the only difference is, that in the ftdi-branch the 10us delay is missing], with no difference in behaviour.  
I tried both versions with both cabling-recommendations:  firsthand with the resistors as voltage-dividers, than with direct 5cm cables. 

In all combinations flashrom is hanging during a read-statement.


The strace looks in all cases like (+-5 lines):

------------
write(1, "Note: serprog_delay used, but th"..., 67Note: serprog_delay used, but the programmer doesn't support delay
) = 67
write(3, "\23", 1)                      = 1
write(3, "\1\0\0\2\0\0\5", 7)           = 7
read(3, "\6", 1)                        = 1
read(3, "\0\0", 2)                      = 2
mmap2(NULL, 4198400, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7104000
write(1, "Reading flash... ", 17Reading flash... )       = 17
write(3, "\23", 1)                      = 1
write(3, "\4\0\0\0\0\1\3\0\0\0", 10)    = 10
read(3, "\6", 1)                        = 1
read(3, "'\5\31V\267\205%\3Q\332+\3\0\1\257\10\200 \0\0\200 \0\0\207\312\302\340\5\5\1\0"..., 65536) = 339
read(3, "\0\20\0\0\0\0\255\1\0\20\0\0\0\0\253\1\0\20\0\0\0\0\251\1\0\20\0\0\0\0\247\1"..., 65197) = 429
read(3, "\0\20\0\0\0\0\27\1\0\20\0\0\0\0\25\1\0\20\0\0\0\0\24\1\0\20\200\3\32$\21\1"..., 64768) = 391
read(3, "\0\0\0\313\275\377\377\357!\375\377\340\25 p\313\1\0\200\v@\200]\v\0B_\v\0\1\0\17"..., 64377) = 385
read(3, "\0\0\0\0\0,\257\343\254!0\240\0\10\0\340\3!\20\300\0\2\0\34<\220\240\234'!\340\231"..., 63992) = 395
read(3, "\0'!\340\231\3\340\377\275'\30\0\277\257\20\0\274\257\20\0\204\217L\4\231\217\t\370 \3\364i"..., 63597) = 387
read(3, "\0\t\370 \3! `\2\20\0\274\217!0@\0! \0\2\240\3\231\217\t\370 \3!(`"..., 63210) = 408
read(3, "\0\200\0\6$\t\370 \3\230\0\276'\20\0\274\217! \300\3!(\0\0\234\1\231\217\200\0\6"..., 62802) = 424
read(3, "\0!\20 \0#\20A\0\6\0@\20\370\377\242&h\1\203\217\0\0b\214\1\0B$\0\0b"..., 62378) = 293
read(3, "\0\244'\20\0\274\217L\4\231\217\230\0\260'!(\0\2\t\370 \3`k\344&\20\0\274\217\354"..., 62085) = 465
read(3, "\0\0@\20\30\0\274\217\20\0\220\217L\4\231\217\t\370 \3\330l\4&\30\0\274\217\20\0\204\217"..., 61620) = 309
read(3, "\0\0\274\217\20\0\204\217L\4\231\217\t\370 \3\24m\204$\377\377\0\20\0\0\0\0$\0c\256"..., 61311) = 478
read(3, "\0\204$\t\370 \3 n\306$\30\0\274\217\20\0\5$\20\0\204\217L\4\231\217\t\370 \3$"..., 60833) = 386
read(3, "\0\2\20\246p\20\0\204\217L\4\231\217!8\0\1Do\204$\2\0\23$\2\20Hp\t\370 "..., 60447) = 408
read(3, "\0\4p\204$\10\0\0\20\30\0\274\217\20\2\231\217\1\0001&\t\370 \3\20'\4$d\0\""..., 60039) = 411
read(3, "\0\0\0\0B\214!\20\\\0\10\0@\0L\4\231\217\20\0\204\217\1\0\5$H\0\260'\t\370"..., 59628) = 390
read(3, "\0\30\0\274\217!8 \2! \200\2\244\2\231\217!(\0\0p\0\0\20\1\0\6$\20\0\204"..., 59238) = 352
read(3, "\0!(\0\0\30\0\274\217!8\0\2! \200\2\244\2\231\217!(\0\0\v\0\0\20\3\0\6"..., 58886) = 352
read(3, "\0$\20\0\302\24\334\0\231\217\10\0\4\216!(\0\0\t\370 \3\n\0\6$\20\0\274\217\f\0"..., 58534) = 351
read(3, "\234'!\340\231\3\320\377\275'(\0\277\257$\0\263\257 \0\262\257\34\0\261\257\30\0\260\257\20\0"..., 58183) = 401
read(3, "$!\30\220\0\1\0\204$\20\0\202(\374\377@\24\10\0`\240P\3\202\217\0\0#\216\0\0D"..., 57782) = 390
read(3, "\3\330s\204$!(@\0\20\0\274\217\32\0@\20!\210\0\0\20\0\202\217! \240\0`pB"..., 57392) = 400
read(3, "\0\0,\0\206\217T\4\220\217\0\0\303\214#\30C\0\271\3\2<\240\254B4+\20C\0\30\0"..., 56992) = 470
read(3, "\0\0\260\217\10\0\340\0030\0\275'\1\0\34<\204y\234'!\340\231\3\270\377\275'@\0\277\257"..., 56522) = 465
read(3, "\0\10\0\340\3\v\20\203\0\0\0\242\220\"\0\7$\3\0G\24\0\0\0\0\1\0\245$\377\377\306"..., 56057) = 462
read(3, "\232\1I\20\356\377\10%\16\0\244\226\20\0\245\226\377\0\2030\377\0\2420\0\32\3\0\2\"\4\0"..., 55595) = 207
read(3, "\0000\0\32\3\0\2\22\2\0%\30b\0\0\10\2$\7\0b\20\20\0\204\217L\4\231\217\214t"..., 55388) = 392
read(3, "\0\3\30\0\242\257 \0\274\217,\0\244'\16\0\205&\240\3\231\217\t\370 \3\4\0\6$ \0"..., 54996) = 405
read(3, "\0\t\370 \3\4\0\6$ \0\274\217\4\4\202\217\0\0B\214\5\0@\0200\0\243\217\3\0b"..., 54591) = 419
read(3, "\0\240\0\20\0\205\217\377\17\3460\10\0\343\24\320u\245$\0\0\1\221\1\0\10%\0\0A\240\374"..., 54172) = 408
read(3, "\0\4\231\217\t\370 \0030v\204$\20\0\274\217\304\0\231\217\t\370 \3! \240\2\5\0A\4"..., 53764) = 407
read(3, "\0\370 \3\6\0\6$ \0@\24\20\0\274\217\364\0\231\217\t\370 \3\0\0\0\0!(@\0"..., 53357) = 420
read(3, "\0\245'\20\0\204\217\f\2\231\217\t\370 \3|w\204$\20\0\274\217\320\3\231\217\t\370 \3\0"..., 52937) = 448
read(3, "\0b\20\330\3\202\217\30\3\231\217\310\2\204\217\0\0E\214\f\0\202\217p\260F\214\f\0\202\217t"..., 52489) = 446
read(3, "\0\217|\260C\216\200\260\202\214\v\0b\24<\4\231\217\20\0\204\217L\4\231\217(\0\277\217$\0"..., 52043) = 452
read(3, "\0\217\220\260\20&\240\2600\256\20\0\204\217L\4\231\217!(\0\2\t\370 \3\334x\204$\2\0"..., 51591) = 397
read(3, "\0\0\261\257 \0\260\257\20\0\274\257!\200\200\0!\230\240\0!\210\0\0!\220q\2\334\0\231\217"..., 51194) = 386
read(3, "\0\t\370 \3\250y\204$\20\0\274\217!\210@\0\20\0\203\217\260bb$\3\0D\210\5\0E"..., 50808) = 372
read(3, "\0(\0\260\217\10\0\340\3@\0\275'\1\0\34<\350W\234'!\340\231\3\260\377\275'L\0\277"..., 50436) = 497
read(3, "\0\20\0\274\217\377\377\2$ \0\277\217\34\0\261\217\30\0\260\217\10\0\340\3(\0\275'\1\0\34"..., 49939) = 352
read(3, "\0\0\0\0\0\1\0\34<@S\234'!\340\231\3\340\377\275'\34\0\277\257\30\0\260\257\20\0\274"..., 49587) = 352
read(3, "\0\t\370 \3\370z\204$\337\0 \26\30\0\274\217\240\3\231\217\4\4\204\217\20\0E&\t\370 "..., 49235) = 370
read(3, "\377\0b0\0\22\2\0\10\0\0\20\2\32\3\0\4\0\2$&\0\302\24+\20t\2\2\0#\216"..., 48865) = 393
read(3, "\0\0E\214\370\0\225\217`{\204$\1\0\245$\t\370 \3\0\0E\254\30\0\274\217\0\0\260\216"..., 48472) = 419
read(3, "\0\4\231\217\t\370 \3\254]\245$\30\0\274\217\10\0\204\217\310\0\231\217\t\370 \3\344U\204$"..., 48053) = 416
read(3, "\0\4\2\t\370 \3\34\0\245$\20\0\274\217\271\3\4<\240\254\2044\10\0\205\217<\4\231\217\t"..., 47637) = 426
read(3, "\0\205\254\5\0\0\20\0\0\205\254\20\0\204\217\t\370 \3\304{\204$\20\0\274\217!\20\0\2\34"..., 47211) = 455
read(3, "\0\204\217!\30r\0!0\302\0!(`\0\254ay&\4\0f\254\10\0`\254\t\370 \3\377"..., 46756) = 389
read(3, "\0\0\0\22\6\0%\20E\0\20\0\274\217%\240\202\2\f\f\2044\0\0\224\254!\250\0\0\f\0"..., 46367) = 389
read(3, "\0\0\0\365\254\0\0\n\256\0\0\2\255\1\0\2<\0\0003\255\364\1\4$\0\0\2\255\t\370 "..., 45978) = 384
read(3, "\0\20\0\5$(\2\231\217\t\370 \3\204\6\6$\20\0\274\217! \0\0\21\0\5$(\2\231"..., 45594) = 388
read(3, "\0\217\16\0@\20\f\0\223\217<\0\2$#\20P\0\10\0@\30!(\0\0!0\24\2! "..., 45206) = 385
read(3, "\274\217\f\0\206\217\377\17\3<\377\377c4\300\260\306$\4\0\302\214$(\203\2\10\0\231\217$\20"..., 44821) = 399
read(3, "\0\0\202\217\300\266C\214\1\0\2$\266\0b\24\240\266\2\216\360\377\0\20\260\266\343\216\20\2\231\217"..., 44422) = 403
read(3, "\0\3124\0\21\2\0!\20\202\0\f\0@\254\240\266\342\214\0\t\3064\0\21\2\0!\20\202\0\4"..., 44019) = 455
read(3, "\0\t\370 \3! \0\0\20\0\274\217 \0\242\257\21\260\2<\304\0C4\0\0b\214B\20\2"..., 43564) = 426
read(3, "\0\0\263\257(\0\262\257$\0\261\257 \0\260\257\20\0\274\257!\230\200\0!\200\240\0!\220\300\0"..., 43138) = 408
read(3, "\0B4$\30b\0\30\0\243\257\0\0\203\254\f\0\204\217t\3\231\217\\\200\204$\t\370 \3\0"..., 42730) = 456
read(3, "\0\246'\10\0@\24\20\0\274\217\f\0\204\217L\4\231\217\t\370 \3 \201\204$\20\0\274\217X"..., 42274) = 407
read(3, "\0\217$@\3\1!\210\240\0!\240\200\0!\250\300\0!\220\340\0\0\0H\254\24\0\240\30!\200"..., 41867) = 399
read(3, "\0\20<`\0\0046\0\0\202\214\375\377\3$4\0\0216$\20C\0\0\0\202\254\0\0\"\216\20"..., 41468) = 384
read(3, "\0\217!0@\0!\30\0\0\f\0\204\217\20\0\205\217L\4\231\217\260\203\204$\5\0@\20\360b"..., 41084) = 406
read(3, "\0\2\350\377\340\24\260\242\"%\f\0\204\217L\4\231\217\t\370 \3\f\204\204$ \0\274\217!\20"..., 40678) = 408
read(3, "\0$\"\0\244'\1\0\5$!0\0\0!8\0\0!\310\300\2\t\370 \3\"\0\242\243\20\0"..., 40270) = 402
read(3, "\0!\210\240\0!\230\300\0TcE$\214\204\204$!0 \2\t\370 \3!8`\2!\260\0"..., 39868) = 453
read(3, "\0\20!\2102\2\f\0\204\217L\4\231\217\t\370 \3L\200\204$\20\0\274\217\264\2\202\217\0\0"..., 39415) = 420
read(3, "\0\300\26*\20\261\2G\0@\20\30\0\246\217l\3\231\217\t\370 \3!  \2!\220@\0\342"..., 38995) = 452
read(3, "\0$\0\261\217 \0\260\217\10\0\340\3H\0\275'\1\0\34<\314\27\234'!\340\231\3\330\377\275"..., 38543) = 412
read(3, "\0\5<!(%\2c\0\0\20\5\0\4<! \340\0\314\205B$\0\0\203\220\0\0A\220\1"..., 38131) = 402
read(3, "\0\370 \3\334\233\204$\0\0\"\216\20\0\274\217\377\377B$*\30\2\2\367\377`\24\0\0\"\256"..., 37729) = 353
read(3, "\0\0\0\20\24\0\203\217\f\0\204\217t\3\231\217\0\0 \242\t\370 \3,\206\204$\30\0\274\217"..., 37376) = 385
read(3, "\0\377 \24\1\0\204$t\3\231\217\t\370 \3x\4\204\217\30\0\274\217\204\0\231\217\t\370 \3"..., 36991) = 385
read(3, "\0\261\0\0\20\0\0@\254\204\0\231\217!\230\200\0\t\370 \3\30\1\261'!\240@\0\20\0\274"..., 36606) = 352
read(3, "\0\0C\220\r\0@\22\1\0B$\0\0#\242\0\0C\220\377\377R&\1\0001&\371\377`\24"..., 36254) = 384
read(3, "$\20\0\0\20\20\0\274\217\f\0\31\216\214\3\245\217!0 \2!8@\2\t\370 \3! \0"..., 35870) = 394
read(3, "\0\0\20X\37@\240\0\0\0\0\0\0\0\0\0\0\0\0\1\0\34<`\7\234'!\340\231\3\330"..., 35476) = 384
read(3, "\0\257(\0\242\2178\0\246\2174\0\247\217\30\0\242\257\t\370 \3\264\210\204$ \0\274\217\f\0"..., 35092) = 392
read(3, "\0\217\3\0\2$\n\0b\20\0\0\0\0\v\0\0\20\f\0\202\217\f\0\202\217\t\0\0\20\224\212"..., 34700) = 415
read(3, "\0\0!\210\300\0!\240\240\0!\220\340\0\n\0\20$\4\0b\24\3\0\304\220\340\0\2020\5\0"..., 34285) = 471
read(3, "\0\0\t\370 \3\20\0\6$ \0\274\217!\210@\0\f\0\204\217L\4\231\217!( \2\t\370"..., 33814) = 384
read(3, "\0\310\377\0\20D\214\204$\f\0\204\217t\3\231\217\t\370 \3d\214\204$ \0\274\217\35\0e"..., 33430) = 407
read(3, "\0t\3\231\217\"\0\0\20\24\215\204$\f\0\204\217L\4\231\217!(\0\2\t\370 \3\370\214\204"..., 33023) = 397
read(3, "\0|\0\277\217x\0\276\217t\0\267\217p\0\266\217l\0\265\217h\0\264\217d\0\263\217`\0\262"..., 32626) = 403
read(3, "\0\0c\220! \0\2\34\0\277\217\5\0\3\242\30\0\260\217\10\0 \3 \0\275'\1\0\34<"..., 32223) = 348
read(3, "\0\202\217#\0\36$\23\0c&\30\0\244\257\0\0\340\254\0\0\300\242\0\0^\240\3\0\243\24\3"..., 31875) = 397
read(3, "\0\0\2$\1\0\5\242\2\0\3\242\3\0\2\242a \204$\t\370 \3\0\0 \242\20\0\274\217"..., 31478) = 387
read(3, "\0\370 \3\0\0\0\0!\30@\0\1\0\2$\6\0b\20\20\0\274\217\3\0\2$\367\377b\24"..., 31091) = 410
read(3, "\0\0\0\0.\2\0\3.\5\0\r\0\2$\10\0\242\20\20\0\274\217@\3\231\217\t\370 \3\0"..., 30681) = 409
read(3, "\0\20\0\274\217!\230\0\0\20\0\204\217\334\3\231\217\t\370 \0030m\204$! @\0\10\0@"..., 30272) = 399
read(3, "\0 \3\30\0\245'\20\0\274\217\30\0\245'\20\0\204\217\f\2\231\217\t\370 \3pv\204$\20"..., 29873) = 293
read(3, "\0`\24!\20`\2h\1\203\217\0\0B\2164\0\240\257\0\0c\214\21\0`\0200\0\242\257\20"..., 29580) = 293
read(3, "\0\0\261\257\30\0\260\257\20\0\274\257\1\0\2$!\360\300\0!\270\0\0#\0\302\20!\230\0\0"..., 29287) = 390
read(3, "\0L\0\277\257H\0\276\257D\0\267\257@\0\266\257<\0\265\2578\0\264\2574\0\263\2570\0\262"..., 28897) = 350
read(3, "\0\0\3\0`\24\f\0\202\217\16\0\0\20\1\0\22$! \0\2\204\222B$\0\0\203\220\0\0"..., 28547) = 415
read(3, "\0\0\7\0\200\24\3\0\342*0\2\231\217\10\0\305\216\t\370 \3! \300\0\20\0\274\217\3\0"..., 28132) = 400
read(3, "\0&! \0\2 \0\245'\n\0\6$\0\212\21\0\4\0\0\22!\20\0\0\t\370 \3\0\0"..., 27732) = 384
read(3, "\0\0Y\216\t\370 \3! \0\2\20\0\274\217\371\377@\24\0\20\3*\20\0\231\217!( \2"..., 27348) = 465
read(3, "\0<\220\330\234'!\340\231\3\310\377\275',\0\276\257!\360\240\0030\0\277\257(\0\264\257$\0"..., 26883) = 384
read(3, "\0\2!\350\300\0030\0\277\217,\0\276\217(\0\264\217$\0\263\217 \0\262\217\34\0\261\217\30\0"..., 26499) = 448
read(3, "\0\214\10\0 \3\0\0\0\0\10\0\340\3\0\0\0\0\1\0\34<\314\323\234'!\340\231\3\300\376"..., 26051) = 354
read(3, "\0\20\0\274\217\v\0@\20\244\3\231\217\t\370 \3\0\0\0\0\3\0\3$\20\0\274\217\5\0C"..., 25697) = 468
read(3, "\0\277\217(\0\264\217$\0\263\217 \0\262\217\34\0\261\217\30\0\260\217\377\377\2$\10\0\340\0030"..., 25229) = 293
read(3, "\0\10\0\340\0030\0\275'\1\0\34<\220\315\234'!\340\231\3\340\377\275'\30\0\277\257\20\0\274"..., 24936) = 472
read(3, "\0\216\20\0\274\217# \21\0!\30p\0\270\1\231\217\"\0C\24!8\0\0\t\370 \3\0\0"..., 24464) = 384
read(3, "\22\0\0\0208\0D$\20\0@\24[\0d$U\0b,\4\0@\20U\1b,\2\23\10\0"..., 24080) = 396
read(3, "\25\0b,\202\21\f\0\25\0\0\0208\0K$\23\0@\24[\0k$U\0b,\4\0@\20"..., 23684) = 401
read(3, "\0e$U\0b,\4\0@\20U\1b,\2\23\10\0\n\0\0\20n\0E$\4\0@\20U"..., 23283) = 398
read(3, "\0\20\377\377)%\10\0\202\214\373\377D\20\3\0\"1\4\0\243\215@(\5\0+\20e\0\17\0"..., 22885) = 386
read(3, "\310 \303\216\f\0\205\217#\20\220\0!\20Q\0!\30q\0\204\244\244$\1\0B4\310 \303\256"..., 22499) = 400
read(3, "\0\204\244B$\10\0G\214!\30\354\0\4\0\344\254\10\0C\254\4\0e\254\10\0\353$D\0\277"..., 22099) = 422
read(3, "\0$\0\303,\20\0$&\20\0b\256\f\0\"\216\30\0g&\7\0`\24\24\0b\256\20\0\""..., 21677) = 427
read(3, "\0\0D&\7\0`\24\f\0B\256\20\0\"\216\30\0%&\30\0D&\20\0B\256\24\0\"\216"..., 21250) = 401
read(3, "\0\0@\24\10\0B&\1\0b4! S\2\4\0\202\254\4\0B\2164\0\231\217\10\0\204$"..., 20849) = 298
read(3, "\0\0\263\217 \0\262\217\34\0\261\217\30\0\260\217\10\0\340\0030\0\275'\1\0\34<h\270\234'"..., 20551) = 434
read(3, "\231\217\f\0\204\217\240\0\203\217<\3\202\217!0 \3h\225\204$\370\3\231\217\32\0\240\24\0\0"..., 20117) = 399
read(3, "\370 \3!\220\200\0\20\0\274\217\10\0\4$l\3\231\217\t\370 \3!\210@\0\20\0\274\217!"..., 19718) = 402
read(3, "$$\0\277\217 \0\262\217\34\0\261\217\30\0\260\217!\20`\0\10\0\340\3(\0\275'\1\0\34"..., 19316) = 199
read(3, "\0\277\257,\0\265\257(\0\264\257$\0\263\257 \0\262\257\34\0\261\257\30\0\260\257\20\0\274\257\0"..., 19117) = 407
read(3, "\234'!\340\231\3\377\377\2$\3\0\302\24\0\0\0\0\5\0\0\20\1\0\6$\3\0\300\24\0\0"..., 18710) = 401
read(3, "\217\210\2\202\217!(\0\0\30\0B\257\34\0@\257\34\0\277\217\30\0\260\217!\20\240\0\10\0\340"..., 18309) = 399
read(3, "\0\202\217 \4\231\217\0\20\6$\0\0D\214\f\0\202\217\10\0 \3\340\236E\214\0\0\0\0\0"..., 17910) = 398
read(3, "\0\20\4\0\326&\f\0\204\217\2\0\2$L\4\231\217\6\0B\26\244\227\204$\0\0%\226\0\0"..., 17512) = 262
read(3,   <===STUCK HERE!!
------------

The Nano is a V3 with Atmega328 and a FT232RL chip.


Any suggestions ?



Pictor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.flashrom.org/pipermail/flashrom/attachments/20131010/6167c9db/attachment.html>


More information about the flashrom mailing list