01:59.08 | *** join/#openjtag RobNC (n=NSLU2-IR@user-0c8ha9e.cable.mindspring.com) |
02:01.02 | *** join/#openjtag RobNC (n=NSLU2-IR@user-0c8ha9e.cable.mindspring.com) |
02:01.11 | RobNC | Anyone ever used BDI2000? |
02:13.56 | *** join/#openjtag purl (i=ibot@pdpc/supporter/active/TimRiker/bot/apt) |
02:13.56 | *** topic/#openjtag is this is the place to discuss bootloaders and JTAG |
02:17.03 | *** join/#openjtag purl (i=ibot@pdpc/supporter/active/TimRiker/bot/apt) |
02:17.03 | *** topic/#openjtag is this is the place to discuss bootloaders and JTAG |
02:20.02 | wookey_ | RobNC: not me personally, but I know it is popular |
02:20.55 | RobNC | Thanks, trying to hack something I read on bdi website about it to reprogram flash of NSLU2. |
03:29.04 | *** join/#openjtag muasch|swiss (n=muasch@31.14.3.213.fix.bluewin.ch) |
05:15.06 | *** join/#openjtag muasch|swiss (n=muasch@31.14.3.213.fix.bluewin.ch) |
05:42.13 | *** join/#openjtag aproemel (n=aproemel@www-cache.bocholt.fh-gelsenkirchen.de) |
06:28.45 | *** join/#openjtag rd_ (n=redragon@segfault.net) |
13:06.20 | *** join/#openjtag bullet (n=bullet@237.219.62.81.cust.bluewin.ch) |
13:35.45 | *** join/#openjtag prpplague^2 (n=dave@mail.americanmicrosystems.com) |
13:50.39 | *** join/#openjtag xela (n=chatzill@p549ca2a8.dip0.t-ipconnect.de) |
13:50.56 | xela | hello vmaster... |
13:51.33 | vmaster | hey xela |
13:51.59 | xela | debugging works fine so far (i uploaded my config to openfacts) |
13:52.24 | xela | but on larger files i get the error "could not allocate... workspace..." |
13:52.30 | xela | do you have an idea for this? |
14:04.37 | vmaster | where's that error from? |
14:04.45 | vmaster | OpenOCD? |
14:04.48 | xela | from openocd |
14:04.50 | xela | yes |
14:05.30 | vmaster | do you have a log, or a screenshot? |
14:05.40 | vmaster | gotta run, i'll be back in 30minutes or so |
14:24.37 | *** join/#openjtag bullet (n=bullet@237.219.62.81.cust.bluewin.ch) |
14:34.35 | vmaster | ok, i'm back |
14:48.04 | xela | sorry, have to go for a meeting :-( |
14:48.07 | xela | will ask again |
16:18.15 | *** join/#openjtag bullet (n=bullet@125.248.62.81.cust.bluewin.ch) |
16:26.04 | *** join/#openjtag xela (n=chatzill@p549ca2a8.dip0.t-ipconnect.de) |
16:26.11 | xela | vmaster: i am back |
16:26.15 | xela | you still there? |
16:26.58 | vmaster | yeah |
16:27.27 | xela | > flash erase 0 0 9 |
16:27.29 | xela | erased sectors 0 through 9 on flash bank 0 in 3s 984375us |
16:27.30 | xela | > flash write 0 ../app/src/output/app.bin 0 |
16:27.31 | xela | > flash write 0 ../app/src/output/app.bin 0 |
16:27.33 | xela | failed writing file ../app/src/output/app.bin to flash bank 0 at offset 0x00000000 |
16:27.34 | xela | flash program error |
16:27.40 | xela | and in the openocd window i got: |
16:27.55 | xela | Warning: target.c:537 target_alloc_working_area(): not enough working area available |
16:27.56 | xela | Error: armv4_5.c:584 armv4_5_run_algorithm(): timeout waiting for algorithm to complete, trying to halt target |
16:27.58 | xela | Error: str7x.c:539 str7x_write_block(): error executing str7x flash write algorithm |
16:27.59 | xela | Error: str7x.c:627 str7x_write(): flash writing failed with error code: 0x0 |
16:28.09 | vmaster | do you have a "working_area" line your .cfg? |
16:28.28 | xela | working_area 0 0x40000000 0x4000 nobackup |
16:29.08 | xela | too big? (stack issues?) |
16:29.14 | xela | disable irqs? |
16:29.26 | vmaster | irqs should be disabled |
16:29.44 | vmaster | you're using the str750 iirc? |
16:29.47 | xela | yep |
16:31.47 | vmaster | ok, the working_area msg isn't critical. the code first tries to allocate a 8kb buffer and then decreases the size |
16:31.56 | xela | ah ok |
16:32.27 | xela | since our last conversation i have flash the bootloader (which has 2 x 16KB) several dozen times without an error |
16:32.47 | xela | but the app has 232KB and I have a hard time to get it flashed |
16:35.16 | *** join/#openjtag aproemel (n=aproemel@p508ABCEA.dip0.t-ipconnect.de) |
16:36.06 | vmaster | could you try again with "-d -l <logfile>" - that should show us where the algorithm execution stopped |
16:36.23 | xela | ok |
16:41.44 | *** join/#openjtag rd_ (n=redragon@vnsecurity.net) |
16:42.23 | xela | ok |
16:42.26 | xela | it worked several times |
16:42.33 | xela | but now i have the reset again |
16:42.52 | xela | sorry, error |
16:42.59 | xela | the file is pretty big... |
16:43.10 | xela | interested in a special portion? |
16:43.42 | vmaster | it should compress quite well |
16:43.51 | xela | Error: armv4_5.c:584 armv4_5_run_algorithm(): timeout waiting for algorithm to complete, trying to halt target |
16:44.09 | vmaster | yeah, mostly the stuff after that |
16:44.58 | xela | how can i send it to you? |
16:45.14 | vmaster | Dominic <dot> Rath <at> gmx <dot> de |
16:45.23 | vmaster | or pastebin.ca |
16:46.19 | xela | sent |
16:47.07 | vmaster | ok, got it... let me check what's in there |
16:54.58 | vmaster | hum, looks like interrupts were indeed enabled - but i remember fixing that more than half a year ago |
16:56.03 | xela | the executable is from openocd-2007re131 |
17:05.04 | xela | what i dont understand... |
17:07.50 | xela | who enables the interrupts? |
17:07.58 | xela | if i issue an "soft_reset_halt" |
17:08.23 | xela | and then "flash write..." i would think there is no such thing like enabled interrupts |
17:09.37 | vmaster | yeah, the interrupts should be disabled, and there should also be a bit in the EmbeddedICE control register set to keep interrupts disabled, no matter what's in CPSR |
17:10.17 | xela | can i set this in openocd? at least as a workaround for now? |
17:31.58 | vmaster | there are several things that i don't understand with this log |
17:32.22 | xela | anything i can help? information you need from me? |
17:32.28 | vmaster | CPSR has I and F set to zero, i.e. interrupts enabled, but the soft_reset_halt should have set them |
17:33.21 | vmaster | can you show me the telnet log from when the flashing failed? |
17:33.36 | xela | openocd crashed several times in the meantime... |
17:33.43 | xela | but i will retry it |
17:36.13 | xela | Open On-Chip Debugger |
17:36.14 | xela | > soft_reset_halt |
17:36.16 | xela | requesting target halt and executing a soft reset |
17:36.17 | xela | Target 0 halted |
17:36.19 | xela | target halted in ARM state due to debug request, current mode: Supervisor |
17:36.21 | xela | cpsr: 0x600000d3 pc: 0x00000000 |
17:36.22 | xela | > flash erase 0 0 9 |
17:36.23 | xela | erased sectors 0 through 9 on flash bank 0 in 3s 843750us |
17:36.25 | xela | > flash write 0 ../app/src/output/app.bin 0 |
17:36.26 | xela | failed writing file ../app/src/output/app.bin to flash bank 0 at offset 0x00000000 |
17:36.28 | xela | flash program error |
17:36.30 | xela | > |
17:36.31 | xela | i just sent the log to your email address |
17:38.06 | vmaster | ok, thanks |
17:41.01 | xela | when i retry flashing after this i get: |
17:41.03 | xela | > flash write 0 ../app/src/output/app.bin 0 |
17:41.04 | xela | failed writing file ../app/src/output/app.bin to flash bank 0 at offset 0x00000000 |
17:41.05 | xela | flash program error |
17:41.07 | xela | > flash write 0 ../app/src/output/app.bin 0 |
17:41.09 | xela | failed writing file ../app/src/output/app.bin to flash bank 0 at offset 0x00000000 |
17:41.10 | xela | flash program error |
17:41.12 | xela | > flash write 0 ../app/src/output/app.bin 0 |
17:41.13 | xela | failed writing file ../app/src/output/app.bin to flash bank 0 at offset 0x00000000 |
17:41.15 | xela | flash program error |
17:41.16 | xela | > |
17:43.25 | vmaster | ok, this time the CPSR was ok, so it isn't interrupt related |
17:45.47 | xela | when i try flashing from within gdb i get something like |
17:46.11 | xela | (gdb) monitor flash write 0 ../app/src/output/app.bin 0 |
17:46.13 | xela | Ignoring packet error, continuing... |
17:46.14 | xela | (gdb) Reply contains invalid hex digit 116 |
17:46.23 | xela | but i think this is a different problem |
17:47.02 | xela | (ah, and after that ignoring... the telnet is sloooooow, or doesnt respond for several minutes) |
17:49.02 | xela | openocd shows: |
17:49.04 | xela | Warning: gdb_server.c:195 gdb_put_packet(): negative reply, retrying |
17:49.34 | vmaster | hum, that's totally unrelated (but shouldn't happen either) |
17:50.32 | xela | is there a bugtracker for openocd? maybe the one on berlios? |
17:51.01 | vmaster | well, yeah, but i'm the only one who monitors that bugtracker, so it's not much use... |
17:51.35 | xela | ok |
17:51.41 | xela | some more info |
17:51.46 | xela | after flashing has failed |
17:52.07 | xela | every time i try to flash after that error i get the same flash error |
17:52.24 | xela | after several retries it seems to work or at least "do" something |
17:52.35 | xela | the output in openocd is: |
17:52.39 | vmaster | ok, but did it ever work on a "fresh" start? |
17:52.49 | xela | Warning: target.c:537 target_alloc_working_area(): not enough working area available |
17:52.51 | xela | Warning: str7x.c:511 str7x_write_block(): no large enough working area available, can't do block memory writes |
17:52.52 | xela | Warning: str7x.c:620 str7x_write(): couldn't use block writes, falling back to single memory accesses |
17:53.13 | xela | what do you mean with fresh start? restart openocd? powerdown/powerup`? |
17:53.32 | vmaster | did you leave it runnig after the "falling back" message? did it finish? |
17:53.45 | vmaster | yeah, by "fresh start" i mean a power-up |
17:53.55 | vmaster | or at least "restart openocd" |
17:54.15 | vmaster | the fall back should take /long/ |
17:54.31 | vmaster | like 15 or 20 minutes for your 200+kb file |
17:54.41 | xela | i didnt leave it on running |
17:55.55 | vmaster | did you ever succeed with writing the whole image? |
17:56.09 | xela | yes |
17:59.01 | xela | > reset |
17:59.02 | xela | > Target 0 halted |
17:59.04 | xela | target halted in ARM state due to debug request, current mode: System |
17:59.05 | xela | cpsr: 0x8000001f pc: 0x2000058c |
17:59.07 | xela | > soft_reset_halt |
17:59.08 | xela | requesting target halt and executing a soft reset |
17:59.10 | xela | Target 0 halted |
17:59.11 | xela | target halted in ARM state due to debug request, current mode: Supervisor |
17:59.13 | xela | cpsr: 0x800000d3 pc: 0x00000000 |
17:59.14 | xela | > flash write 0 ../app/src/output/app.bin 0 |
17:59.16 | xela | failed writing file ../app/src/output/app.bin to flash bank 0 at offset 0x00000000 |
17:59.17 | xela | flash program error |
17:59.19 | xela | > reset |
17:59.20 | xela | > flash write 0 ../app/src/output/app.bin 0 |
17:59.22 | xela | failed writing file ../app/src/output/app.bin to flash bank 0 at offset 0x00000000 |
17:59.23 | xela | can't work with this flash while target is running |
17:59.25 | xela | > Target 0 halted |
17:59.27 | xela | target halted in Thumb state due to debug request, current mode: System |
17:59.28 | xela | cpsr: 0xffffffff pc: 0xa1a1a191 |
17:59.29 | xela | > reset |
17:59.31 | xela | > Target 0 halted |
17:59.33 | xela | target halted in ARM state due to debug request, current mode: IRQ |
17:59.35 | xela | cpsr: 0x80000092 pc: 0x00000000 |
17:59.37 | xela | > flash write 0 ../app/src/output/app.bin 0 |
17:59.39 | xela | failed writing file ../app/src/output/app.bin to flash bank 0 at offset 0x00000000 |
17:59.41 | xela | flash program error |
17:59.43 | xela | > flash write 0 ../app/src/output/app.bin 0 |
17:59.45 | xela | wrote file ../app/src/output/app.bin to flash bank 0 at offset 0x00000000 in 33s 843750us |
17:59.47 | xela | > |
18:00.00 | vmaster | ok, retrying after it failed once is definitely not a good idea |
18:00.26 | vmaster | ah, you issued "reset" in between |
18:00.45 | xela | was a thing i wanted to try now after all those errors |
18:01.08 | vmaster | ok, that's your current state? |
18:01.35 | vmaster | i.e. you have the image in flash, and the OpenOCD reported that it worked? |
18:01.44 | xela | yes |
18:02.13 | xela | but i need several approaches until it works |
18:02.21 | vmaster | could you verify that the flashing worked by dumping to a file (dump binary <file> <address> <size>)? |
18:07.58 | xela | moment... |
18:08.08 | *** join/#openjtag rd_ (n=redragon@segfault.net) |
18:12.58 | xela | the files are identical |
18:15.15 | vmaster | hum, we could break on any exception... that should allow us to see why the algorithm execution is aborted |
18:15.27 | vmaster | s/any/every/ |
18:18.44 | vmaster | gotta run some checks here first |
18:28.03 | *** join/#openjtag nm (n=nm@222.252.37.87) |
18:33.14 | xela | yes |
18:33.23 | xela | (had some pizza...) |
18:41.10 | xela | vmaster: did you set up the OpenFacts page with the example scripts as well? |
18:41.34 | *** part/#openjtag nm (n=nm@222.252.37.87) |
18:42.15 | vmaster | mhh, i think the example scripts page was contributed |
18:48.15 | *** join/#openjtag bullet (n=bullet@125.248.62.81.cust.bluewin.ch) |
18:48.34 | xela | well, i though about indenting the script with one space |
18:48.47 | xela | so they would be formatted as source code (courier new) or alike |
18:49.14 | xela | but since i am new here i dont want to just trample about and change whatever i see... |
18:49.25 | xela | (but willing to contribute) |
18:59.31 | xela | s/though/though/ |
19:11.40 | *** join/#openjtag vmaster_ (i=vmaster@p5B07D342.dip.t-dialin.net) |
19:13.02 | vmaster | xela: ok, got something for you to test |
19:13.13 | xela | great! |
19:13.37 | vmaster | make sure everything is "clean", i.e. the flash erased, board freshly powered up, openocd restarted |
19:14.02 | xela | ok |
19:15.12 | vmaster | use the "reg" command to set these registers: |
19:15.15 | vmaster | (47) watch 1 addr value (/32): 0x00000000 (dirty: 0, valid: 1) |
19:15.15 | vmaster | (48) watch 1 addr mask (/32): 0x0000001f (dirty: 0, valid: 1) |
19:15.15 | vmaster | (49) watch 1 data value (/32): 0x00000000 (dirty: 0, valid: 1) |
19:15.15 | vmaster | (50) watch 1 data mask (/32): 0xffffffff (dirty: 0, valid: 1) |
19:15.15 | vmaster | (51) watch 1 control value (/32): 0x00000100 (dirty: 0, valid: 1) |
19:15.18 | vmaster | (52) watch 1 control mask (/32): 0x000000f7 (dirty: 0, valid: 1) |
19:15.44 | vmaster | this causes a breakpoint to be taken on every vector |
19:15.50 | vmaster | then try the flash write sequence |
19:15.59 | vmaster | make sure logging is enabled |
19:16.03 | xela | ok |
19:18.00 | vmaster | it might seems as if it worked, but you'll only know after comparing with a dump |
19:18.53 | xela | whats the command to set a register? |
19:19.09 | vmaster | "reg <number> <value" |
19:19.30 | vmaster | e.g. "reg 47 0x0" |
19:20.51 | xela | ok |
19:21.32 | xela | 1 try succeeded |
19:21.50 | xela | i will erase and restart |
19:21.52 | vmaster | no |
19:21.55 | vmaster | dump |
19:22.04 | xela | ok |
19:22.05 | vmaster | only a dump shows you if it really succeeded |
19:22.18 | vmaster | to the algorithm code, the breakpoint we set looks like it completed |
19:35.35 | xela | moment have to install cygwin (the hexdump tool i used is win32 crap that produced invalid results) |
19:36.36 | vmaster | hmm, just send me the log you've got |
19:36.45 | vmaster | i guess i'll be able to see if it worked |
19:37.03 | vmaster | the PC is recorded on reentering debug state |
19:38.02 | xela | ok, sent |
19:39.56 | xela | ok, files are identical |
19:42.20 | vmaster | hmm, yeah, debug was always entered at: |
19:42.21 | vmaster | Debug: arm7_9_common.c:1011 arm7_9_debug_entry(): entered debug state at PC 0x4000004c |
19:59.50 | xela | anything i can do? |
20:01.16 | vmaster | if you want you can try again until the dump fails |
20:01.39 | vmaster | and send a log from that run |
20:01.46 | vmaster | ideally you'd start the OpenOCD again on each try |
20:01.55 | xela | hm. |
20:02.43 | vmaster | or use the additional breakpoint each time you have to flash anyway |
20:03.19 | xela | you mean the reg... sequence? |
20:03.28 | vmaster | yeah |
20:03.33 | vmaster | you can put the commands into a script file |
20:03.39 | vmaster | (a normal text file) |
20:03.44 | vmaster | and call that with "script" |
20:03.50 | xela | ok |
20:27.54 | xela | can i run openocd from the commandline, so it only executed some steps and then returns? |
20:28.23 | drath | hmm? |
20:30.19 | xela | i would like to automize this task |
20:30.21 | xela | you know |
20:30.25 | drath | ah, yeah, that's possible |
20:30.28 | xela | erase/flash/dump/compare |
20:30.44 | drath | hold on, i think there's already an example on the net somewhere |
20:31.13 | drath | http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/openocd_intro/index.html |
20:31.35 | drath | not sure if'll get used to that new nick... but vmaster really is from way back in the gaming days... ;) |
20:31.45 | xela | :-) |
20:32.40 | xela | hm. should i use dcc_downloads as well? |
20:32.44 | drath | you define a target script that gets called after "run_and_halt" |
20:32.50 | drath | no, that's only a speed improvement |
20:33.00 | drath | which might furhter complicate things |
20:33.06 | xela | ok |
20:34.59 | *** join/#openjtag drath (i=vmaster@p5b07d342.dip.t-dialin.net) |
21:16.34 | xela | i have setup such a script using python and telnetlib |
21:23.00 | xela | from telnetlib import Telnet |
21:23.01 | xela | import re |
21:23.03 | xela | t=Telnet('127.0.0.1', 4444) |
21:23.04 | xela | FILTER=''.join([(len(repr(chr(x)))==3) and chr(x) or '.' for x in range(256)]) |
21:23.06 | xela | def hexDump(src, length=8): |
21:23.08 | xela | <PROTECTED> |
21:23.09 | xela | <PROTECTED> |
21:23.10 | xela | <PROTECTED> |
21:23.12 | xela | <PROTECTED> |
21:23.14 | xela | <PROTECTED> |
21:23.15 | xela | <PROTECTED> |
21:23.17 | xela | <PROTECTED> |
21:23.18 | xela | <PROTECTED> |
21:23.20 | xela | def dumpFile(bin_file, hex_file): |
21:23.21 | xela | <PROTECTED> |
21:23.23 | xela | <PROTECTED> |
21:23.24 | xela | <PROTECTED> |
21:23.26 | xela | <PROTECTED> |
21:23.27 | xela | <PROTECTED> |
21:23.29 | xela | <PROTECTED> |
21:23.31 | xela | <PROTECTED> |
21:23.33 | xela | <PROTECTED> |
21:23.35 | xela | def cmd(args): |
21:23.37 | xela | <PROTECTED> |
21:23.39 | xela | <PROTECTED> |
21:23.41 | xela | <PROTECTED> |
21:23.43 | xela | <PROTECTED> |
21:23.45 | xela | <PROTECTED> |
21:23.47 | xela | <PROTECTED> |
21:23.49 | xela | <PROTECTED> |
21:23.51 | xela | <PROTECTED> |
21:23.53 | xela | BIN='../app/src/output/app.bin' |
21:23.55 | xela | HEX='app.hex' |
21:23.57 | xela | DUMP='dump.bin' |
21:23.59 | xela | DUMP_HEX='dump.hex' |
21:24.02 | xela | app_hex=dumpFile(BIN,HEX) |
21:24.03 | xela | t.read_until('>') |
21:24.05 | xela | cmd('halt') |
21:24.07 | xela | cmd('reset') |
21:24.09 | xela | cmd('soft_reset_halt') |
21:24.11 | xela | cmd('flash erase 0 0 9') |
21:24.13 | xela | cmd('reg 47 0x00000000 ') |
21:24.15 | xela | cmd('reg 48 0x0000001f ') |
21:24.17 | xela | cmd('reg 49 0x00000000 ') |
21:24.19 | xela | cmd('reg 50 0xffffffff ') |
21:24.22 | xela | cmd('reg 51 0x00000100 ') |
21:24.24 | xela | cmd('reg 52 0x000000f7 ') |
21:24.25 | xela | cmd('flash write 0 %s 0' % (BIN)) |
21:24.27 | xela | cmd('soft_reset_halt') |
21:24.29 | xela | cmd('dump %s 0x20000000 0x3A000' % (DUMP)) |
21:24.31 | xela | dump_hex=dumpFile(DUMP,DUMP_HEX) |
21:24.33 | xela | if app_hex != dump_hex: |
21:24.35 | xela | <PROTECTED> |
21:25.16 | xela | drath: still there? |
21:31.09 | drath | yeah |
21:31.43 | drath | so, did it eventually fail? |
21:31.43 | xela | well. i guess i have to get some sleep soon |
21:32.00 | xela | i didnt manage to get it flashed |
21:32.26 | xela | so now i am commenting out the erase |
21:32.33 | xela | maybe thats the problem (here) |
21:43.50 | xela | now i created a loop in my script to program only blocks of 1024 bytes |
21:43.53 | xela | this worked fine |
21:44.10 | xela | will increase the blocksize to 16384 or so |
21:50.06 | drath | heh, just don't wear out your flash because of this problem |
21:50.38 | xela | well, should make no difference whether i program it in one large piece or smaller ones |
22:31.53 | xela | hm even using blocks i get this error |