Error when trying to launch gdb server for LEON3FT (GR712RC hard-core CPU)

9 views
Skip to first unread message

robotron

unread,
Feb 14, 2012, 2:35:18 PM2/14/12
to playtag-discuss
Dear Patrick,

first of all, thank you for starting your free LEON gdb support
project. Today, I tried to use it together with our fresh GR712RC
board (containing hardware, dual-core LEON3FT CPU). For this CPU,
there is no grmon-eval, so I tried your playtag at the first place.

According to chip's documentation, there seems to be pretty same JTAG-
AHB master bridge (two registers, 33 and 35 bit). I have been
successful while writing to some timer peripheral register using
UrJTAG as follows:

instruction length 6

register DBGCMD 35
register DBGDATA 33

instruction s_cmd 000010 DBGCMD
instruction s_data 000011 DBGDATA

ins s_cmd
shift ir
dr 11010000000000000000000001100000100
shift dr
dr
ins s_data
shift ir
dr 010111010101100011101111011010000
shift dr
dr
#
ins s_cmd
shift ir
dr 01010000000000000000000001100000100
shift dr
dr
ins s_data
shift ir
shift dr
dr
jtag> jtag> 11010000000000000000000001100000100 (0x680000304)
jtag> jtag> 01010000000000000000000001100000100 (0x280000304)
jtag> jtag> jtag> 010111010101100011101111011010000 (0xBAB1DED0)
jtag> jtag> 010111010101100011101111011010000 (0xBAB1DED0)
jtag> jtag> jtag> jtag> 01010000000000000000000001100000100
(0x280000304)
jtag> jtag> 11010000000000000000000001100000100 (0x680000304)
jtag> jtag> jtag> jtag> 000000000000000001101111011010000 (0x0000DED0)
jtag>

...so it seems to me that this lowest-level interface works.

Then, I compared your dsuregs.py with the docs very briefly and it
seems the DSU registers are the same in the LEON3FT variant, too.


However, while trying to run ./leonserver.py, I got following error:

JTAG Chain information

#0 - Gaisler Research AB gr712rc (ir_capture = '001001',
idcode='0000_0000011100010010_01100100100_1')

Error opening cable driver (details below)

(...something...)

Traceback (most recent call last):
File "./leonserver.py", line 33, in <module>
processor = CmdProcessor(LeonMem(driver, config), config)
File "./../../playtag/leon3/gdbproc.py", line 159, in __init__
self.leoncfg = leoncfg = LeonCfg(ahb, userconfig)
File "./../../playtag/leon3/cpustate.py", line 74, in __init__
self.calcram()
File "./../../playtag/leon3/cpustate.py", line 85, in calcram
blocksize = min(x.ram_size for x in cfgs)
ValueError: min() arg is an empty sequence

---
my files:

* leongdb.cfg:

# This is the example configuration file.

# Modify it and save it as leongdb.cfg

JTAGID_FILE = "jtagid.txt" # Please use forward slashes...

DSU_ADDR = 0x90000000 # Location of DSU in AHB space

DSU_ENABLE_ADDR = 0x90000000 # Location of register to write to
# to enable DSU (0 for none)
DSU_ENABLE_DATA = 0x400 # Value to write to DSU_ENABLE_ADDR

AHB_RAM_ADDR = 0x0a0000000 # Location of program RAM in AHB
space
AHB_RAM_SIZE = 0x00030000 # Size of AHB RAM

if 1:
CABLE_DRIVER = "ftdi"
CABLE_NAME = 0
else:
CABLE_DRIVER = "digilent"
CABLE_NAME = "DCabUsb"

* jtagid.txt:

# Device Name Device ID Device ID Mask Instr. Reg.
Length Dbg. Interface Instr. 1 Instr. 2
gr712rc 0x00712649 0x0fffffff 6 1 0x2 0x3


Please, do you have and idea, what am I doing wrong?

Thank you,
Marek

Patrick Maupin

unread,
Feb 14, 2012, 3:02:30 PM2/14/12
to playtag...@googlegroups.com
Marek:

I'm not sure, but at first glance I wonder if my algorithm is very
robust in the face of non power-of-two RAM sizes. Try reducing your
RAM size to 0x20000. Meanwhile I'll try to look at the code to see
what else could cause this.

Best regards,
Pat

Patrick Maupin

unread,
Feb 14, 2012, 3:08:31 PM2/14/12
to playtag-discuss
Oh, never mind. It's a silly bug where it expects to find some TCMs
-- nothing to do with your other RAM.

It uses the TCM info because TCM (tightly coupled memories) aren't at
that AMBA address and it has to do a translation. I'll study it a bit
and try to come up with a fix.

Pat

robotron

unread,
Feb 14, 2012, 3:14:45 PM2/14/12
to playtag-discuss
Dear Patrick,

> Oh, never mind. It's a silly bug where it expects to find some TCMs
> -- nothing to do with your other RAM.
>
> It uses the TCM info because TCM (tightly coupled memories) aren't at
> that AMBA address and it has to do a translation. I'll study it a bit
> and try to come up with a fix.

thank you for your very quick reply. I am looking forward to test it after
your fix. To save your time, if you can tell me where and what to hotfix,
I could try...

Greetings,
Marek

Patrick Maupin

unread,
Feb 14, 2012, 3:14:08 PM2/14/12
to playtag-discuss
Looks like the fix for when you don't have tightly coupled memories
might be fairly simple. See if replacing this line works:

- blocksize = min(x.ram_size for x in cfgs)
+ blocksize = cfgs and min(x.ram_size for x in cfgs) or 2


On Feb 14, 1:35 pm, robotron <hefais...@gmail.com> wrote:

hefa...@gmail.com

unread,
Feb 14, 2012, 3:19:42 PM2/14/12
to playtag-discuss
> - blocksize = min(x.ram_size for x in cfgs)
> + blocksize = cfgs and min(x.ram_size for x in cfgs) or 2

Great, now it is:
Waiting for connection on 0.0.0.0:2222 (Ctrl-C to exit)

So I will setup the toolchain and I hope I will be able to confirm you
functionality, soon.

Thank you for your good work and support!
Marek

hefa...@gmail.com

unread,
Feb 14, 2012, 3:52:06 PM2/14/12
to playtag-discuss
Dear Patrick,

now trying with bare gdb using your ./leonserver.py
...and it seems it really does something! Excellent...

(gdb) set *0x80000304 = 0xbab1ded0
Current language: auto; currently asm
(gdb) x 0x80000304
0x80000304: 0x0000ded0

Many thanks and greetings,
Marek

Patrick Maupin

unread,
Feb 14, 2012, 5:14:27 PM2/14/12
to playtag-discuss
You're welcome!

Glad you could get it to work.

Regards,
Pat
Reply all
Reply to author
Forward
0 new messages