On Sat, Jul 6, 2013 at 6:09 AM, Oleksij Rempel <[email protected]> wrote:
> Am 06.07.2013 11:51, schrieb Andreas Fritiofson:
>> On Sat, Jul 6, 2013 at 1:18 AM, [email protected]
>> <mailto:[email protected]> <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>>     I was able to debrick my board. But this setup has a lot of issues
>>     making it difficult to use for debugging. Twice during the debrick
>>     process I got protocol errors and had to restart openocd/gdb.
>
> I have lots of instability issue with one of broadcom-mips based board.
> After some testing i would say it is partially jtag adapter issue.
> Incorrect pull-ups/downs and, wrong cable and so on will couse different
> noise issues.

These aren't stability issues, they are 100% reproducible. It could be
this Ralink RT5350 core. They have the MIPS DSP option on the CPU.

The biggest problem seems to be finding the correct gdb that is
matched to what openocd is sending. I tried three different gdbs and
they are had problems. gdb built from the project git source was the
best, but it still had issues.

For example if gdb arch is set to mips:4000 in gdb I get this error:
Debug: 464 20387 gdb_server.c:2018 gdb_input_inner(): received packet:
'P25=00002080ffffffff'
Debug: 465 20387 gdb_server.c:1110 gdb_set_register_packet(): -
Error: 466 20387 gdb_server.c:1131 gdb_set_register_packet(): gdb sent
a packet with wrong register size. chars 8 str 16 -
P25=00002080ffffffff

Set the architecture to mips:ia32 makes it go away.

Or this patch... gdb wouldn't even connect without this fix

I am built from source. I had to add this patch to get it working at all.
Those 18 dummy regs don't seem to be needed anymore.

diff --git a/src/target/mips32.c b/src/target/mips32.c
index d649901..8705ebc 100644
--- a/src/target/mips32.c
+++ b/src/target/mips32.c
@@ -92,7 +92,7 @@ static struct mips32_core_reg
mips32_core_reg_list_arch_info[MIPS32NUMCOREREGS]
 /* number of mips dummy fp regs fp0 - fp31 + fsr and fir
  * we also add 18 unknown registers to handle gdb requests */

-#define MIPS32NUMFPREGS (34 + 18)
+#define MIPS32NUMFPREGS (34)

 static uint8_t mips32_gdb_dummy_fp_value[] = {0, 0, 0, 0};

As for scan_delay it is defaulting to legacy mode. In legacy mode
openocd does so many jtag operations that it simply takes 15 minutes
to complete to download. I reduced the scan-delay a little below the
legacy mode threshold so that fast-write mode was used. Now the
download happens in about 30 seconds. But that's because openocd isn't
doing a million JTAG operations on the chip any more.

These are also common... they always happen at the same addresses

Fetch addr mismatch, read: ff200200 expected: ff200204 count: 1
Fetch addr mismatch, read: ff2001fc expected: ff200200 count: 0
Fetch addr mismatch, read: ff2001fc expected: ff200200 count: 0

Using gdb built from source I was able to set breakpoints.

I'm still getting various protocol errors which make openocd and gdb
disconnect.  But they are disagreements in the command packet contents
and are 100% reproducible.  I reconnect and they avoid those commands.



>
> For example i have adapter which works perfectly on Atheros based mips
> at 100kHz. And same adapter regularly fail on Broadcom-mips even with
> lover speed: 10kHz.
>
>>
>> Did you see this before you lowered scan_delay? Because this is the type
>> of errors I'd expect from a too low scan_delay setting. But really, I'm
>> just guessing here. Someone with MIPS knowledge will be better suited to
>> answer.
>>
>> /Andreas
>
>
> --
> Regards,
> Oleksij
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> OpenOCD-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/openocd-devel



--
Jon Smirl
[email protected]

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to