**** BEGIN LOGGING AT Thu Apr 07 02:59:59 2011 Apr 07 07:48:29 'm trying to get a JLink adapter to talk to my DNS323 (Feroceon CPU) Apr 07 07:48:36 unfortunately, when OpenOCD starts, it executes the reset, and then powers off a few seconds later Apr 07 07:48:45 I suspect that I have some problems with my reset configuration, and was wondering if anyone could help me debug it Apr 07 07:48:54 * Rogan is a JTAG n00b :-P Apr 07 08:50:42 try increasing debug level Apr 07 08:52:25 hi roxfan, will do Apr 07 08:54:13 Actually, it seems to have been as a result of the specification of trst_and_srst that the resets happen Apr 07 08:54:28 changing that to just srst_only solved the resets Apr 07 08:54:57 however, now I see the board resetting three times when openocd is run, and then I get a bunch of errors from OpenOCD Apr 07 08:58:04 starting with: Apr 07 08:58:05 Error: 162 328 jlink.c:967 jlink_usb_message(): jlink_usb_message failed with result=1) Apr 07 08:58:05 Error: 163 328 jlink.c:790 jlink_tap_execute(): jlink_tap_execute, wrong result -107 (expected 1) Apr 07 09:29:16 here is my detailed log: http://pastie.org/1766984 Apr 07 12:24:07 FWIW, and if anyone is googling for that error message, I solved the problem by forcing the jtag_khz to 50 Apr 07 12:24:23 any faster than that and I get error messages. Apr 07 12:54:57 just thought, would it make sense to implement DFU in OpenOCD? Apr 07 12:55:17 i'm not sure since it's only about firmware up-/downloading, no debugging or such Apr 07 19:07:06 Hi all. Does anyone have experience working with or writing NAND flash drivers for OpenOCD? Apr 07 19:08:08 Documentation is sparse. I though I'd ask here before trying to tear apart some of the drivers in the project. Apr 07 19:27:08 not i, I'm afraid Apr 07 19:27:54 I'm wondering how to get out of the state that I'm currently in, that my device won't halt at all, now that I have killed the existing bootloader Apr 07 19:31:32 dub00t: The headers/code were pretty self-explanatory for me Apr 07 19:32:14 (As in, I hacked together a OneNAND driver) Apr 07 19:32:44 Would be really nice to upstream, but it's hacked up and probably quite specific to my target nand Apr 07 19:40:04 ius: Ah. So maybe I'll just have a look at the code. Are there any bits of code that you looked at that were particularly helpful? Anything to watch out for? Apr 07 19:41:28 ius: I'm going to have to insert our software flash translation layer between the JTAG and the flash for programming and debugging purposes Apr 07 19:51:42 Hmm that might be a bit more complicated Apr 07 19:54:02 flash/nand/driver.h contains the meat, the functions it wants you to implement for a NAND driver Apr 07 19:54:32 Which is supposed to have a notion of blocks, pages etc. Not sure how it would fit if you're actually trying to fit a FTL inbetween Apr 07 19:55:21 The other alternative is the 'flash' driver framework, which seems to be oriented towards nor/random access flash Apr 07 20:02:51 can anyone help me out? I have bricked my device, and can't seem to get it back to life Apr 07 20:03:42 I have managed to upload an abbreviated u-boot (minus the low level boot code), but I can't instruct the device to execute it Apr 07 20:04:02 I get the following: Apr 07 20:04:02 ius: Hm, I think the NAND interface is what I'm looking for as our FTL doesn't abstract the chip to be random access (it moves blocks around). I'll start there, thanks. Apr 07 20:04:06 > resume 0x3000000 Apr 07 20:04:06 target state: halted Apr 07 20:04:06 target halted in ARM state due to debug-request, current mode: Supervisor Apr 07 20:28:22 Rogan: if your device has DRAM, you probably have to setup the controller before you can use it Apr 07 20:31:27 Ceriand|work: I believe that is the problem, yes Apr 07 20:31:39 I have tried to execute the appropriate command Apr 07 20:32:08 mww 0xd0001480 0x00000001 Apr 07 20:32:17 which did not give any errors Apr 07 20:32:40 and I was able to upload new code to try to recover Apr 07 20:33:11 but was not able to execute that code due to the errors shown above Apr 07 20:33:29 any hints on how to get out of supervisor mode? Apr 07 20:48:59 u-boot should be running in supervisor mode Apr 07 20:49:16 oh. I guess I don't understand something then :-) Apr 07 20:49:51 sometimes chips can get in a weird state if you suspend them while they're running Apr 07 20:50:05 how do i get it to execute the code I just uploaded? resume 0x3000000 doesn't seem to work Apr 07 20:50:13 have you tried doing a reset halt before jumping to your code? Apr 07 20:50:37 what chip is your device using? Apr 07 20:50:43 times out waiting for the halt Apr 07 20:50:47 feroceon Apr 07 20:50:59 orion5x with a feroceon core Apr 07 20:51:16 to be precise, it is a Marvell MV8F5182 Apr 07 20:51:26 to be precise, it is a Marvell MV88F5182 Apr 07 20:51:38 haven't done much with those personally Apr 07 20:52:24 I did the reset halt, then resume 0x3000000 Apr 07 20:52:34 still got the same error messages Apr 07 20:52:44 > resume 0x3000000 Apr 07 20:52:44 target state: halted Apr 07 20:52:44 target halted in ARM state due to debug-request, current mode: Supervisor Apr 07 20:52:44 cpsr: 0x000000d3 pc: 0x03000014 Apr 07 20:52:44 MMU: disabled, D-Cache: disabled, I-Cache: disabled Apr 07 20:56:11 Rogan: what are you trying to do again? Apr 07 20:56:27 I have a DNS323 NAS, which has a crippled U-boot Apr 07 20:56:38 vendor u-boot has no features Apr 07 20:56:42 I want to replace it Apr 07 20:57:10 with what? Apr 07 20:57:17 I have got a new u-boot working, that I can chain load from the vendor one, using CONFIG_SKIP_LOWLEVEL_INIT Apr 07 20:57:37 now I have undefined that, and wanted to try to flash it in place of the vendor one Apr 07 20:57:44 which I did Apr 07 20:57:51 does u-boot have support for that board? Apr 07 20:57:52 but now it won't boot Apr 07 20:57:58 it does now :-) Apr 07 20:58:12 well, I have got it working over the last several months Apr 07 20:58:17 but only using CONFIG_SKIP_LOWLEVEL_INIT Apr 07 20:58:43 I suspect your lowlevel init is probably wrong/broken Apr 07 20:58:51 i.e. boot vendor u-boot, download my new image using kermit, use vendor u-boot to bootm into the new one Apr 07 20:59:01 Ceriand|work: I think so too Apr 07 20:59:24 I'm relying on work done for a similar device, using the same SoC Apr 07 20:59:41 does reading/writing to ram work? Apr 07 20:59:44 but clearly it doesn't do the right thing, for some reason Apr 07 20:59:49 I can read flash Apr 07 20:59:51 from openocd Apr 07 21:00:38 did an mdw, and it showed bytes as expected in the flash region Apr 07 21:00:48 i'm talking about RAM Apr 07 21:01:01 am reuploading the ram-only image, and will see if I can read it back Apr 07 21:01:01 u-boot probably won't work unless you have the RAM setup correctly Apr 07 21:01:19 you can just poke in a dummy value and see if you can read it back Apr 07 21:01:37 well, the upload is in progress Apr 07 21:01:46 will finish in a minute or so Apr 07 21:02:34 shouldn't flash be at 0xf8000000 on that cpu? Apr 07 21:02:48 not 0x3000000 Apr 07 21:02:50 0xff8000000 Apr 07 21:03:13 I uploaded the RAM-only image to 3000000, so I can start that Apr 07 21:03:20 ah Apr 07 21:03:29 then use that to flash the replacement to NOR Apr 07 21:03:39 I haven't managed to get openOCD to recognise my flash Apr 07 21:04:07 I guess if I can get that right, I can avoid all this unpleasantness :-P Apr 07 21:05:13 well, I can read my RAM-only image back from RAM Apr 07 21:05:22 at least, the first 8 bytes :-) Apr 07 21:05:27 good sign :) Apr 07 21:05:32 I assume the rest will match too Apr 07 21:05:41 you could do a crc32 on it Apr 07 21:05:47 I believe oocd supports that Apr 07 21:06:06 help crc gives nothing Apr 07 21:06:29 http://sites.google.com/site/megau2s/home/jtag Apr 07 21:06:36 http://www.ruemohr.org/docs/debugwire.html Apr 07 21:07:02 for AVR Apr 07 21:08:09 Rogan: I would disassemble the vendor u-boot and see if you're missing anything in the lowlevel init Apr 07 21:08:54 hehe. Over my head, I'm afraid Apr 07 21:09:35 or find the source code to the vendor u-boot and look at what they did Apr 07 21:09:38 I've pinged the maintainer for the ARM branch of u-boot, and the other device using the same SoC Apr 07 21:09:52 hopefully he will be able to help me Apr 07 21:10:45 reversing bootloaders isn't very hard Apr 07 21:11:06 just grab http://infocenter.arm.com/help/topic/com.arm.doc.qrc0001m/QRC0001_UAL.pdf and a copy of IDA Apr 07 21:11:24 ok, will have to wait for another night Apr 07 21:11:25 or just run it though objdump if you're cheap Apr 07 21:11:27 bedtime Apr 07 21:11:34 hehe, that I am Apr 07 21:11:39 thanks for your help Apr 07 21:11:46 np, gl **** ENDING LOGGING AT Fri Apr 08 02:59:58 2011