Dirk Behme wrote:
> Magnus Lundin wrote:
>> Hi
>> Rev 1547,  Added two commands that just returns values in hex, good for 
>> scripting.
>>
>>  >dap baseaddr
>>  >dap apid
>>
>> Next I started playing with Tcl scripts that scans the ROM table and 
>> installed components. This is my first shot at JimTcl in OpenOCD but it  
>> works quite ok.
>
> I'm new to TCL, I'm using r1602, and I'm slightly confused ;) See below:
>
>> < dapinfo.tcl > ============================================
>> # Implement dap info in Tcl
>>
>> # get ap id and debugbase
>> puts "Debug interface ROM table examination"
>> set debugbase [lindex [split [ocd_dap_baseaddr]] 0]
>> set apid [lindex [split [ocd_dap_apid]] 0]
>
> In 1602 there are the commands "dap baseaddr" and "dap apid" available 
> at command line (telnet prompt). But not in TCL? Using this in script 
> results in
>
> Invalid command name "dap_baseaddr" ...
>
> Searching complete trunk for "ocd_dap*" is empty.
This works for me :) ,  just tried it again, first raw telnet:
 > version
Open On-Chip Debugger 0.2.0-in-development (2009-05-08-11:59) svn:1606
 > dap apsel 1                                       
ap 1 selected, identification register 0x04770002

Then as  tcl commands :
 > set debugbase [lindex [split [ocd_dap_baseaddr]] 0]
0x80000000
0x80000000
 > set apid [lindex [split [ocd_dap_apid 1]] 0]
0x04770002
0x04770002
 > ocd_dap_apsel 1
ap 1 selected, identification register 0x04770002
ap 1 selected, identification register 0x04770002

There is a priblem that the dap apid command reset the apsel to 0 so we 
finish the above with an extra dap apsel in tcl version

Next I can source the whole tcl script, all direct commnds will be executed

source [find dapscan.tcl]
Debug interface ROM table examination

0x80000000
0x04770002
ap 1 selected, identification register 0x04770002
AP debugbase 0x80000000

AP id        0x04770002

    MEM-AP  memtype  0000000000

    MEM-AP  id  cid[3]     cid[2]     cid[1]     cid[0]

                0x000000b1 0x00000005 0x00000010 0x0000000d

Table entry 0xd4010003 component base is 0x54010000

...... and more


Regards
Magnus

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to