URL
https://opencores.org/ocsvn/openmsp430/openmsp430/trunk
Subversion Repositories openmsp430
Compare Revisions
- This comparison shows the changes necessary to convert path
/openmsp430/trunk/tools
- from Rev 208 to Rev 210
- ↔ Reverse comparison
Rev 208 → Rev 210
/lib/tcl-lib/dbg_functions.tcl
191,17 → 191,18
set omsp_info(connected) 1 |
} |
|
|
# Open Connection with the CPU |
if {$omsp_info($CpuNr,connected)==0} { |
|
# Connect to the CPU |
if {![${if}::dbg_connect $cpuaddr]} { |
utils::uart_close |
return 0 |
} |
|
# Make sure the CPU_ID is correct |
if {![VerifyCPU_ID $CpuNr]} { |
utils::uart_close |
return 0 |
} |
|
245,6 → 246,9
set result [expr $result+[ReleaseCPU $CpuNr]] |
} |
|
# Close serial connection |
utils::uart_close |
|
if {$result==3} { |
return 1 |
} else { |
/lib/tcl-lib/dbg_utils.tcl
21,7 → 21,7
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
# |
#---------------------------------------------------------------------------------- |
# |
# |
# File Name: dbg_utils.tcl |
# |
# Author(s): |
41,9 → 41,10
# |
# - utils::uart_port_list () |
# - utils::uart_open (Device, Baudrate) |
# - utils::uart_close () |
# - utils::uart_tx (Data) |
# - utils::uart_rx (Format, Length) |
# |
# |
#---------------------------------------------------------------------------------- |
namespace eval utils { |
|
87,6 → 88,9
set serial_ports [list /dev/ttyS0 /dev/ttyS1 /dev/ttyS2 /dev/ttyS3] |
} |
} |
{Darwin} { |
set serial_ports [glob -nocomplain /dev/cu.*] |
} |
{Windows NT} { |
package require registry |
set serial_base "HKEY_LOCAL_MACHINE\\HARDWARE\\DEVICEMAP\\SERIALCOMM" |
94,8 → 98,8
foreach valueName $values { |
lappend serial_ports "[registry get $serial_base $valueName]:" |
} |
} |
default {set serial_ports ""} |
} |
default {set serial_ports ""} |
} |
|
return $serial_ports |
102,7 → 106,7
} |
|
#=============================================================================# |
# utils::uart_open (Device, Baudrate) # |
# utils::uart_open (Device, Configure, Baudrate) # |
#-----------------------------------------------------------------------------# |
# Description: Open and configure the UART connection. # |
# Arguments : Device - Serial port device (i.e. /dev/ttyS0 or COM2:) # |
111,18 → 115,19
# Result : 0 if error, 1 otherwise. # |
#=============================================================================# |
proc uart_open {Device Configure Baudrate} { |
|
|
global serial_ch |
|
# Open device for reading and writing |
if {[catch {open $Device RDWR} serial_ch]} { |
if {[catch {open $Device [list RDWR]} serial_ch]} { |
uart_close |
return 0 |
} |
|
|
if {$Configure} { |
# Setup the baud rate |
fconfigure $serial_ch -mode "$Baudrate,n,8,1" |
|
|
# Block on read, don't buffer output |
fconfigure $serial_ch -blocking 1 -buffering none -translation binary -timeout 1000 |
|
134,6 → 139,31
} |
|
#=============================================================================# |
# utils::uart_close (Device) # |
#-----------------------------------------------------------------------------# |
# Description: Closse the UART connection. # |
# Arguments : None # |
# Result : 0 if error, 1 otherwise. # |
#=============================================================================# |
proc uart_close {} { |
|
global serial_ch |
|
# Close the serial port |
if {[info exists serial_ch]} { |
|
if {[catch {close $serial_ch} response]} { |
puts "Error while closing serial port:" |
puts "$response" |
after 500 |
return 0 |
} |
after 500 |
} |
return 1 |
} |
|
#=============================================================================# |
# utils::uart_tx (Data) # |
#-----------------------------------------------------------------------------# |
# Description: Transmit data over the serial debug interface. # |
141,7 → 171,7
# Result : 0 if error, 1 otherwise. # |
#=============================================================================# |
proc uart_tx {Data} { |
|
|
global serial_ch |
set allchar "" |
# Format data |
165,11 → 195,11
# Result : List of received values, in hexadecimal. # |
#=============================================================================# |
proc uart_rx {Format Length} { |
|
|
global serial_ch |
|
|
if { [catch {read $serial_ch $Length} rx_data] } { |
|
|
set hex_data "0000" |
} else { |
set hex_data "" |
187,7 → 217,7
} |
set formated_data "" |
for {set i 0} {$i<[expr $Length/$num_byte]} {incr i} { |
|
|
set data "" |
for {set j $num_byte} {$j>0} {set j [expr $j-1]} { |
append data [lindex $hex_data [expr ($i*$num_byte)+$j-1]] |
/bin/README.TXT
File deleted
bin/README.TXT
Property changes :
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Index: bin/openmsp430-gdbproxy.tcl
===================================================================
--- bin/openmsp430-gdbproxy.tcl (revision 208)
+++ bin/openmsp430-gdbproxy.tcl (revision 210)
@@ -22,9 +22,9 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
#------------------------------------------------------------------------------
-#
+#
# File Name: openmsp430-gdbproxy.tcl
-#
+#
# Author(s):
# - Olivier Girard, olgirard@gmail.com
#
@@ -149,7 +149,7 @@
![string eq $omsp_conf(interface) "i2c_usb-iss"]} {
puts "\nERROR: Specified adaptor is not valid (should be \"uart_generic\" or \"i2c_usb-iss\")"
help
- exit 1
+ exit 1
}
# Make sure the I2C address is an integer
@@ -156,7 +156,7 @@
if {![string is integer $omsp_conf(0,cpuaddr)]} {
puts "\nERROR: Specified I2C address is not an integer"
help
- exit 1
+ exit 1
}
# Make sure the I2C address is valid
@@ -163,7 +163,7 @@
if {($omsp_conf(0,cpuaddr)<8) | ($omsp_conf(0,cpuaddr)>119)} {
puts "\nERROR: Specified I2C address should lay between 7 and 120"
help
- exit 1
+ exit 1
}
# If the selected interface is a UART, make sure the selected speed is an integer
@@ -171,7 +171,7 @@
if {![string is integer $omsp_conf(baudrate)]} {
puts "\nERROR: Specified UART communication speed is not an integer"
help
- exit 1
+ exit 1
}
} elseif {[string eq $omsp_conf(interface) "i2c_usb-iss"]} {
if {[lsearch [lindex [GetAllowedSpeeds] 2] $omsp_conf(baudrate)]==-1} {
@@ -181,7 +181,7 @@
puts " - $allowedVal"
}
puts ""
- exit 1
+ exit 1
}
}
@@ -267,6 +267,7 @@
# Start server for GDB
if {![startServer 0]} {
+ utils::uart_close
exit 1
}
@@ -281,7 +282,7 @@
regexp {(.+)_(.+)} $omsp_conf(interface) whole_match tmp_if tmp_adapter
- set gui_dbg_if [string toupper $tmp_if]
+ set gui_dbg_if [string toupper $tmp_if]
set gui_adapter [string toupper $tmp_adapter]
return 1
@@ -356,7 +357,7 @@
.connect.cfg.ad.i2c_addr.s1 configure -state normal
.connect.cfg.ad.i2c_nr.f.soft.b configure -state normal
}
-
+
if {$omsp_nr < 3} {
.connect.cfg.ad.core_nr.l2 configure -state disabled
.connect.cfg.ad.server_port.p2 configure -state disabled
@@ -368,7 +369,7 @@
.connect.cfg.ad.arrow.l2 configure -state normal
.connect.cfg.ad.i2c_addr.s2 configure -state normal
}
-
+
if {$omsp_nr < 4} {
.connect.cfg.ad.core_nr.l3 configure -state disabled
.connect.cfg.ad.server_port.p3 configure -state disabled
@@ -428,12 +429,12 @@
####################################
# Exit button
-button .menu.exit -text "Exit" -command {stopAllServers; exit 0}
+button .menu.exit -text "Exit" -command {stopAllServers; utils::uart_close; exit 0}
pack .menu.exit -side left
# openMSP430 label
label .menu.omsp -text "openMSP430 GDB proxy" -anchor center -fg "\#6a5acd" -font {-weight bold -size 14}
-pack .menu.omsp -side right -padx 20
+pack .menu.omsp -side right -padx 20
# Create the Configuration, Start & Info frames
getConfiguration
@@ -468,7 +469,7 @@
eval .connect.cfg.if.config2.adapter.p2 list insert end [list "GENERIC"]
pack .connect.cfg.if.config2.adapter.p2 -side right -padx 5
-# Device port & Speed selection
+# Device port & Speed selection
frame .connect.cfg.if.config1.serial_port
pack .connect.cfg.if.config1.serial_port -side top -padx 5 -pady {10 10} -fill x
label .connect.cfg.if.config1.serial_port.l1 -text "Device Port:" -anchor w
@@ -489,69 +490,69 @@
frame .connect.cfg.ad.core_nr
pack .connect.cfg.ad.core_nr -side left -padx 5 -pady {0 20} -fill y
label .connect.cfg.ad.core_nr.l3 -text "Core 3:" -anchor w
-pack .connect.cfg.ad.core_nr.l3 -side bottom -padx {25 0} -pady {10 10}
+pack .connect.cfg.ad.core_nr.l3 -side bottom -padx {25 0} -pady {10 10}
label .connect.cfg.ad.core_nr.l2 -text "Core 2:" -anchor w
-pack .connect.cfg.ad.core_nr.l2 -side bottom -padx {25 0} -pady {10 2}
+pack .connect.cfg.ad.core_nr.l2 -side bottom -padx {25 0} -pady {10 2}
label .connect.cfg.ad.core_nr.l1 -text "Core 1:" -anchor w
-pack .connect.cfg.ad.core_nr.l1 -side bottom -padx {25 0} -pady {10 2}
+pack .connect.cfg.ad.core_nr.l1 -side bottom -padx {25 0} -pady {10 2}
label .connect.cfg.ad.core_nr.l0 -text "Core 0:" -anchor w
-pack .connect.cfg.ad.core_nr.l0 -side bottom -padx {25 0} -pady {10 2}
+pack .connect.cfg.ad.core_nr.l0 -side bottom -padx {25 0} -pady {10 2}
frame .connect.cfg.ad.server_port
pack .connect.cfg.ad.server_port -side left -padx 5 -pady {0 20} -fill y
entry .connect.cfg.ad.server_port.p3 -textvariable server(3,port) -relief sunken -width 10
-pack .connect.cfg.ad.server_port.p3 -side bottom -padx 5 -pady {10 10}
+pack .connect.cfg.ad.server_port.p3 -side bottom -padx 5 -pady {10 10}
entry .connect.cfg.ad.server_port.p2 -textvariable server(2,port) -relief sunken -width 10
-pack .connect.cfg.ad.server_port.p2 -side bottom -padx 5 -pady {10 0}
+pack .connect.cfg.ad.server_port.p2 -side bottom -padx 5 -pady {10 0}
entry .connect.cfg.ad.server_port.p1 -textvariable server(1,port) -relief sunken -width 10
-pack .connect.cfg.ad.server_port.p1 -side bottom -padx 5 -pady {10 0}
+pack .connect.cfg.ad.server_port.p1 -side bottom -padx 5 -pady {10 0}
entry .connect.cfg.ad.server_port.p0 -textvariable server(0,port) -relief sunken -width 10
-pack .connect.cfg.ad.server_port.p0 -side bottom -padx 5 -pady {10 0}
+pack .connect.cfg.ad.server_port.p0 -side bottom -padx 5 -pady {10 0}
label .connect.cfg.ad.server_port.l -text "Proxy Server Port" -anchor w
-pack .connect.cfg.ad.server_port.l -side bottom -padx 5 -pady {10 0}
+pack .connect.cfg.ad.server_port.l -side bottom -padx 5 -pady {10 0}
frame .connect.cfg.ad.arrow
pack .connect.cfg.ad.arrow -side left -padx 5 -pady {0 20} -fill y
label .connect.cfg.ad.arrow.l3 -text "==>" -anchor w
-pack .connect.cfg.ad.arrow.l3 -side bottom -padx 5 -pady {10 10}
+pack .connect.cfg.ad.arrow.l3 -side bottom -padx 5 -pady {10 10}
label .connect.cfg.ad.arrow.l2 -text "==>" -anchor w
-pack .connect.cfg.ad.arrow.l2 -side bottom -padx 5 -pady {10 2}
+pack .connect.cfg.ad.arrow.l2 -side bottom -padx 5 -pady {10 2}
label .connect.cfg.ad.arrow.l1 -text "==>" -anchor w
-pack .connect.cfg.ad.arrow.l1 -side bottom -padx 5 -pady {10 2}
+pack .connect.cfg.ad.arrow.l1 -side bottom -padx 5 -pady {10 2}
label .connect.cfg.ad.arrow.l0 -text "==>" -anchor w
-pack .connect.cfg.ad.arrow.l0 -side bottom -padx 5 -pady {10 2}
+pack .connect.cfg.ad.arrow.l0 -side bottom -padx 5 -pady {10 2}
frame .connect.cfg.ad.i2c_addr
pack .connect.cfg.ad.i2c_addr -side left -padx 5 -pady {0 20} -fill y
spinbox .connect.cfg.ad.i2c_addr.s3 -from 8 -to 119 -textvariable omsp_conf(3,cpuaddr) -width 4
-pack .connect.cfg.ad.i2c_addr.s3 -side bottom -padx 5 -pady {10 10}
+pack .connect.cfg.ad.i2c_addr.s3 -side bottom -padx 5 -pady {10 10}
spinbox .connect.cfg.ad.i2c_addr.s2 -from 8 -to 119 -textvariable omsp_conf(2,cpuaddr) -width 4
-pack .connect.cfg.ad.i2c_addr.s2 -side bottom -padx 5 -pady {10 0}
+pack .connect.cfg.ad.i2c_addr.s2 -side bottom -padx 5 -pady {10 0}
spinbox .connect.cfg.ad.i2c_addr.s1 -from 8 -to 119 -textvariable omsp_conf(1,cpuaddr) -width 4
-pack .connect.cfg.ad.i2c_addr.s1 -side bottom -padx 5 -pady {10 0}
+pack .connect.cfg.ad.i2c_addr.s1 -side bottom -padx 5 -pady {10 0}
spinbox .connect.cfg.ad.i2c_addr.s0 -from 8 -to 119 -textvariable omsp_conf(0,cpuaddr) -width 4
-pack .connect.cfg.ad.i2c_addr.s0 -side bottom -padx 5 -pady {10 0}
+pack .connect.cfg.ad.i2c_addr.s0 -side bottom -padx 5 -pady {10 0}
label .connect.cfg.ad.i2c_addr.l -text "I2C Address" -anchor w
-pack .connect.cfg.ad.i2c_addr.l -side bottom -padx 5 -pady {10 0}
+pack .connect.cfg.ad.i2c_addr.l -side bottom -padx 5 -pady {10 0}
frame .connect.cfg.ad.i2c_nr
pack .connect.cfg.ad.i2c_nr -side right -padx 5 -fill y
label .connect.cfg.ad.i2c_nr.l -text "Number of cores" -anchor w
-pack .connect.cfg.ad.i2c_nr.l -side top -padx 50 -pady {10 0}
+pack .connect.cfg.ad.i2c_nr.l -side top -padx 50 -pady {10 0}
spinbox .connect.cfg.ad.i2c_nr.s -from 1 -to 4 -textvariable omsp_nr -state readonly -width 4 -command {updateConfiguration}
-pack .connect.cfg.ad.i2c_nr.s -side top -padx 50 -pady {10 10}
+pack .connect.cfg.ad.i2c_nr.s -side top -padx 50 -pady {10 10}
frame .connect.cfg.ad.i2c_nr.f -bd 2 -relief ridge
pack .connect.cfg.ad.i2c_nr.f -side top -padx 10 -pady {5 5} -fill x
label .connect.cfg.ad.i2c_nr.f.l2 -text "Breakpoint configuration" -anchor w
-pack .connect.cfg.ad.i2c_nr.f.l2 -side top -padx 0 -pady {5 10}
+pack .connect.cfg.ad.i2c_nr.f.l2 -side top -padx 0 -pady {5 10}
frame .connect.cfg.ad.i2c_nr.f.soft
pack .connect.cfg.ad.i2c_nr.f.soft -side top -padx 0 -fill x
radiobutton .connect.cfg.ad.i2c_nr.f.soft.r -value "0" -text "" -state normal -variable breakSelect -command {updateSoftBreakpoints}
-pack .connect.cfg.ad.i2c_nr.f.soft.r -side left -padx {10 0} -pady {0 0}
+pack .connect.cfg.ad.i2c_nr.f.soft.r -side left -padx {10 0} -pady {0 0}
label .connect.cfg.ad.i2c_nr.f.soft.l -text "Soft" -anchor w
-pack .connect.cfg.ad.i2c_nr.f.soft.l -side left -padx {5 10} -pady {3 0}
+pack .connect.cfg.ad.i2c_nr.f.soft.l -side left -padx {5 10} -pady {3 0}
button .connect.cfg.ad.i2c_nr.f.soft.b -text "Config." -state disabled -command {configSoftBreakpoints}
pack .connect.cfg.ad.i2c_nr.f.soft.b -side right -padx {0 20}
@@ -558,9 +559,9 @@
frame .connect.cfg.ad.i2c_nr.f.hard
pack .connect.cfg.ad.i2c_nr.f.hard -side top -padx 0 -pady {0 10} -fill x
radiobutton .connect.cfg.ad.i2c_nr.f.hard.r -value "1" -text "" -state normal -variable breakSelect -command {updateSoftBreakpoints}
-pack .connect.cfg.ad.i2c_nr.f.hard.r -side left -padx {10 0} -pady {0 0}
+pack .connect.cfg.ad.i2c_nr.f.hard.r -side left -padx {10 0} -pady {0 0}
label .connect.cfg.ad.i2c_nr.f.hard.l -text "Hard" -anchor w
-pack .connect.cfg.ad.i2c_nr.f.hard.l -side left -padx {5 10} -pady {3 0}
+pack .connect.cfg.ad.i2c_nr.f.hard.l -side left -padx {5 10} -pady {3 0}
# Update according to default values
updateConfiguration
@@ -621,7 +622,7 @@
entry .tclscript.ft.file -width 58 -relief sunken -textvariable tcl_file_name -state disabled
pack .tclscript.ft.file -side left -padx 10
button .tclscript.ft.browse -text "Browse" -state disabled -command {set tcl_file_name [tk_getOpenFile -filetypes {{{TCL Files} {.tcl}} {{All Files} *}}]}
-pack .tclscript.ft.browse -side left -padx 5
+pack .tclscript.ft.browse -side left -padx 5
frame .tclscript.fb
pack .tclscript.fb -side top -fill x
button .tclscript.fb.read -text "Source TCL script !" -state disabled -command {if {[file exists $tcl_file_name]} {source $tcl_file_name}}
@@ -677,65 +678,65 @@
frame .omsp_sft_brk.map.r.core_nr
pack .omsp_sft_brk.map.r.core_nr -side left -padx 5 -pady {0 20} -fill y
label .omsp_sft_brk.map.r.core_nr.l3 -text "Core 3:" -anchor w
- pack .omsp_sft_brk.map.r.core_nr.l3 -side bottom -padx {25 0} -pady {10 10}
+ pack .omsp_sft_brk.map.r.core_nr.l3 -side bottom -padx {25 0} -pady {10 10}
label .omsp_sft_brk.map.r.core_nr.l2 -text "Core 2:" -anchor w
- pack .omsp_sft_brk.map.r.core_nr.l2 -side bottom -padx {25 0} -pady {10 2}
+ pack .omsp_sft_brk.map.r.core_nr.l2 -side bottom -padx {25 0} -pady {10 2}
label .omsp_sft_brk.map.r.core_nr.l1 -text "Core 1:" -anchor w
- pack .omsp_sft_brk.map.r.core_nr.l1 -side bottom -padx {25 0} -pady {10 2}
+ pack .omsp_sft_brk.map.r.core_nr.l1 -side bottom -padx {25 0} -pady {10 2}
label .omsp_sft_brk.map.r.core_nr.l0 -text "Core 0:" -anchor w
- pack .omsp_sft_brk.map.r.core_nr.l0 -side bottom -padx {25 0} -pady {10 2}
-
+ pack .omsp_sft_brk.map.r.core_nr.l0 -side bottom -padx {25 0} -pady {10 2}
+
frame .omsp_sft_brk.map.r.pmem0
pack .omsp_sft_brk.map.r.pmem0 -side left -padx 5 -pady {0 20} -fill y
radiobutton .omsp_sft_brk.map.r.pmem0.p3 -value "0" -text "" -state normal -variable mem_mapping(3)
- pack .omsp_sft_brk.map.r.pmem0.p3 -side bottom -padx 5 -pady {10 10}
+ pack .omsp_sft_brk.map.r.pmem0.p3 -side bottom -padx 5 -pady {10 10}
radiobutton .omsp_sft_brk.map.r.pmem0.p2 -value "0" -text "" -state normal -variable mem_mapping(2)
- pack .omsp_sft_brk.map.r.pmem0.p2 -side bottom -padx 5 -pady {10 0}
+ pack .omsp_sft_brk.map.r.pmem0.p2 -side bottom -padx 5 -pady {10 0}
radiobutton .omsp_sft_brk.map.r.pmem0.p1 -value "0" -text "" -state normal -variable mem_mapping(1)
- pack .omsp_sft_brk.map.r.pmem0.p1 -side bottom -padx 5 -pady {10 0}
+ pack .omsp_sft_brk.map.r.pmem0.p1 -side bottom -padx 5 -pady {10 0}
radiobutton .omsp_sft_brk.map.r.pmem0.p0 -value "0" -text "" -state normal -variable mem_mapping(0)
- pack .omsp_sft_brk.map.r.pmem0.p0 -side bottom -padx 5 -pady {10 0}
+ pack .omsp_sft_brk.map.r.pmem0.p0 -side bottom -padx 5 -pady {10 0}
label .omsp_sft_brk.map.r.pmem0.l -text "Program\nMemory 0" -anchor w
- pack .omsp_sft_brk.map.r.pmem0.l -side bottom -padx 5 -pady {10 0}
+ pack .omsp_sft_brk.map.r.pmem0.l -side bottom -padx 5 -pady {10 0}
frame .omsp_sft_brk.map.r.pmem1
pack .omsp_sft_brk.map.r.pmem1 -side left -padx 5 -pady {0 20} -fill y
radiobutton .omsp_sft_brk.map.r.pmem1.p3 -value "1" -text "" -state normal -variable mem_mapping(3)
- pack .omsp_sft_brk.map.r.pmem1.p3 -side bottom -padx 5 -pady {10 10}
+ pack .omsp_sft_brk.map.r.pmem1.p3 -side bottom -padx 5 -pady {10 10}
radiobutton .omsp_sft_brk.map.r.pmem1.p2 -value "1" -text "" -state normal -variable mem_mapping(2)
- pack .omsp_sft_brk.map.r.pmem1.p2 -side bottom -padx 5 -pady {10 0}
+ pack .omsp_sft_brk.map.r.pmem1.p2 -side bottom -padx 5 -pady {10 0}
radiobutton .omsp_sft_brk.map.r.pmem1.p1 -value "1" -text "" -state normal -variable mem_mapping(1)
- pack .omsp_sft_brk.map.r.pmem1.p1 -side bottom -padx 5 -pady {10 0}
+ pack .omsp_sft_brk.map.r.pmem1.p1 -side bottom -padx 5 -pady {10 0}
radiobutton .omsp_sft_brk.map.r.pmem1.p0 -value "1" -text "" -state disable -variable mem_mapping(0)
- pack .omsp_sft_brk.map.r.pmem1.p0 -side bottom -padx 5 -pady {10 0}
+ pack .omsp_sft_brk.map.r.pmem1.p0 -side bottom -padx 5 -pady {10 0}
label .omsp_sft_brk.map.r.pmem1.l -text "Program\nMemory 1" -anchor w
- pack .omsp_sft_brk.map.r.pmem1.l -side bottom -padx 5 -pady {10 0}
-
+ pack .omsp_sft_brk.map.r.pmem1.l -side bottom -padx 5 -pady {10 0}
+
frame .omsp_sft_brk.map.r.pmem2
pack .omsp_sft_brk.map.r.pmem2 -side left -padx 5 -pady {0 20} -fill y
radiobutton .omsp_sft_brk.map.r.pmem2.p3 -value "2" -text "" -state normal -variable mem_mapping(3)
- pack .omsp_sft_brk.map.r.pmem2.p3 -side bottom -padx 5 -pady {10 10}
+ pack .omsp_sft_brk.map.r.pmem2.p3 -side bottom -padx 5 -pady {10 10}
radiobutton .omsp_sft_brk.map.r.pmem2.p2 -value "2" -text "" -state normal -variable mem_mapping(2)
- pack .omsp_sft_brk.map.r.pmem2.p2 -side bottom -padx 5 -pady {10 0}
+ pack .omsp_sft_brk.map.r.pmem2.p2 -side bottom -padx 5 -pady {10 0}
radiobutton .omsp_sft_brk.map.r.pmem2.p1 -value "2" -text "" -state disable -variable mem_mapping(1)
- pack .omsp_sft_brk.map.r.pmem2.p1 -side bottom -padx 5 -pady {10 0}
+ pack .omsp_sft_brk.map.r.pmem2.p1 -side bottom -padx 5 -pady {10 0}
radiobutton .omsp_sft_brk.map.r.pmem2.p0 -value "2" -text "" -state disable -variable mem_mapping(0)
- pack .omsp_sft_brk.map.r.pmem2.p0 -side bottom -padx 5 -pady {10 0}
+ pack .omsp_sft_brk.map.r.pmem2.p0 -side bottom -padx 5 -pady {10 0}
label .omsp_sft_brk.map.r.pmem2.l -text "Program\nMemory 2" -anchor w
- pack .omsp_sft_brk.map.r.pmem2.l -side bottom -padx 5 -pady {10 0}
-
+ pack .omsp_sft_brk.map.r.pmem2.l -side bottom -padx 5 -pady {10 0}
+
frame .omsp_sft_brk.map.r.pmem3
pack .omsp_sft_brk.map.r.pmem3 -side left -padx 5 -pady {0 20} -fill y
radiobutton .omsp_sft_brk.map.r.pmem3.p3 -value "3" -text "" -state normal -variable mem_mapping(3)
- pack .omsp_sft_brk.map.r.pmem3.p3 -side bottom -padx 5 -pady {10 10}
+ pack .omsp_sft_brk.map.r.pmem3.p3 -side bottom -padx 5 -pady {10 10}
radiobutton .omsp_sft_brk.map.r.pmem3.p2 -value "3" -text "" -state disable -variable mem_mapping(2)
- pack .omsp_sft_brk.map.r.pmem3.p2 -side bottom -padx 5 -pady {10 0}
+ pack .omsp_sft_brk.map.r.pmem3.p2 -side bottom -padx 5 -pady {10 0}
radiobutton .omsp_sft_brk.map.r.pmem3.p1 -value "3" -text "" -state disable -variable mem_mapping(1)
- pack .omsp_sft_brk.map.r.pmem3.p1 -side bottom -padx 5 -pady {10 0}
+ pack .omsp_sft_brk.map.r.pmem3.p1 -side bottom -padx 5 -pady {10 0}
radiobutton .omsp_sft_brk.map.r.pmem3.p0 -value "3" -text "" -state disable -variable mem_mapping(0)
- pack .omsp_sft_brk.map.r.pmem3.p0 -side bottom -padx 5 -pady {10 0}
+ pack .omsp_sft_brk.map.r.pmem3.p0 -side bottom -padx 5 -pady {10 0}
label .omsp_sft_brk.map.r.pmem3.l -text "Program\nMemory 3" -anchor w
- pack .omsp_sft_brk.map.r.pmem3.l -side bottom -padx 5 -pady {10 0}
+ pack .omsp_sft_brk.map.r.pmem3.l -side bottom -padx 5 -pady {10 0}
# Create OK button
button .omsp_sft_brk.okay -text "OK" -font {-weight bold} -command {destroy .omsp_sft_brk}
@@ -775,7 +776,7 @@
.omsp_sft_brk.map.r.pmem1.p2 configure -state normal
.omsp_sft_brk.map.r.pmem2.p2 configure -state normal
}
-
+
if {$omsp_nr < 4} {
.omsp_sft_brk.map.r.core_nr.l3 configure -state disabled
.omsp_sft_brk.map.r.pmem0.p3 configure -state disabled
/bin/openmsp430-minidebug.tcl
22,9 → 22,9
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
# |
#------------------------------------------------------------------------------ |
# |
# |
# File Name: openmsp430-minidebug.tcl |
# |
# |
# Author(s): |
# - Olivier Girard, olgirard@gmail.com |
# |
82,6 → 82,7
global isPmemRead |
global brkpt |
global color |
global TOOLCHAIN_PFX |
|
# Initialize to default values |
set CpuNr 0 |
128,7 → 129,16
set backup($i,current_file_name) "" |
} |
|
# Detect toolchain |
set TOOLCHAIN_PFX "msp430" |
if {[catch {exec msp430-gcc --version} debug_info]} { |
if {[catch {exec msp430-elf-gcc --version} debug_info]} { |
} else { |
set TOOLCHAIN_PFX "msp430-elf" |
} |
} |
|
|
############################################################################### |
# # |
# FUNCTIONS # |
180,7 → 190,7
} |
|
# Disable connection section |
.ctrl.connect.serial.p1 configure -state disabled |
.ctrl.connect.serial.p1 configure -state disabled |
.ctrl.connect.serial.p2 configure -state disabled |
.ctrl.connect.serial.connect configure -state disabled |
|
261,7 → 271,7
.ctrl.tclscript.ft.file configure -state normal |
.ctrl.tclscript.ft.browse configure -state normal |
.ctrl.tclscript.fb.read configure -state normal |
|
|
# Activate the code debugger section |
.code.rb.txt configure -state normal |
.code.rb.none configure -state normal |
313,13 → 323,13
scrollbar .omsp_extra_info.extra.yscroll -orient vertical -command {.omsp_extra_info.extra.text yview} |
pack .omsp_extra_info.extra.yscroll -side right -fill both |
text .omsp_extra_info.extra.text -wrap word -height 20 -font TkFixedFont -yscrollcommand {.omsp_extra_info.extra.yscroll set} |
pack .omsp_extra_info.extra.text -side right |
pack .omsp_extra_info.extra.text -side right |
|
# Create OK button |
button .omsp_extra_info.okay -text "OK" -font {-weight bold} -command {destroy .omsp_extra_info} |
pack .omsp_extra_info.okay -side bottom -expand true -fill x -padx 5 -pady {0 10} |
|
|
|
# Fill the text widget will configuration info |
.omsp_extra_info.extra.text tag configure bold -font {-family TkFixedFont -weight bold} |
.omsp_extra_info.extra.text insert end "Configuration\n\n" bold |
366,7 → 376,7
} |
} |
|
proc highlightLine { line tagNameNew tagNameOld type } { |
proc highlightLine { line tagNameNew tagNameOld type } { |
.code.text tag remove $tagNameOld 1.0 end |
.code.text tag remove $tagNameNew 1.0 end |
|
385,7 → 395,7
global color |
|
if {$codeSelect!=1} { |
|
|
# Update PC |
regsub {0x} $reg(0) {} pc_val |
set code_match [.code.text search "$pc_val:" 1.0 end] |
456,6 → 466,7
global pmemIHEX |
global brkpt |
global isPmemRead |
global TOOLCHAIN_PFX |
|
if {($binFileName!="") | ($isPmemRead==1)} { |
|
479,12 → 490,12
|
set temp_elf_file "[clock clicks].elf" |
set temp_ihex_file "[clock clicks].ihex" |
if {[catch {exec msp430-objcopy -I $currentFileType -O elf32-msp430 $currentFileName $temp_elf_file} debug_info]} { |
if {[catch {exec ${TOOLCHAIN_PFX}-objcopy -I $currentFileType -O elf32-msp430 $currentFileName $temp_elf_file} debug_info]} { |
.ctrl.load.info.l configure -text "$debug_info" -fg red |
return 0 |
} |
if {![waitForFile $temp_elf_file]} { |
.ctrl.load.info.l configure -text "Timeout: ELF file conversion problem with \"msp430-objcopy\" executable" -fg red |
.ctrl.load.info.l configure -text "Timeout: ELF file conversion problem with \"${TOOLCHAIN_PFX}-objcopy\" executable" -fg red |
return 0 |
} |
if {[string eq $currentFileType "ihex"]} { |
501,18 → 512,18
.ctrl.cpu.brkpt.chk$i configure -state disable |
updateBreakpoint $i |
} |
if {[catch {exec msp430-objcopy -I $currentFileType -O ihex $temp_elf_file $temp_ihex_file} debug_info]} { |
if {[catch {exec ${TOOLCHAIN_PFX}-objcopy -I $currentFileType -O ihex $temp_elf_file $temp_ihex_file} debug_info]} { |
.ctrl.load.info.l configure -text "$debug_info" -fg red |
return 0 |
} |
if {![waitForFile $temp_ihex_file]} { |
.ctrl.load.info.l configure -text "Timeout: IHEX file conversion problem with \"msp430-objcopy\" executable" -fg red |
.ctrl.load.info.l configure -text "Timeout: IHEX file conversion problem with \"${TOOLCHAIN_PFX}-objcopy\" executable" -fg red |
return 0 |
} |
set fp [open $temp_ihex_file r] |
set debug_info [read $fp] |
close $fp |
|
|
file delete $temp_ihex_file |
|
} elseif {$codeSelect==2} { |
519,7 → 530,7
for {set i 0} {$i<3} {incr i} { |
.ctrl.cpu.brkpt.chk$i configure -state normal |
} |
if {[catch {exec msp430-objdump $dumpOpt $temp_elf_file} debug_info]} { |
if {[catch {exec ${TOOLCHAIN_PFX}-objdump $dumpOpt $temp_elf_file} debug_info]} { |
.ctrl.load.info.l configure -text "$debug_info" -fg red |
return 0 |
} |
527,7 → 538,7
for {set i 0} {$i<3} {incr i} { |
.ctrl.cpu.brkpt.chk$i configure -state normal |
} |
if {[catch {exec msp430-objdump $dumpOpt\S $temp_elf_file} debug_info]} { |
if {[catch {exec ${TOOLCHAIN_PFX}-objdump $dumpOpt\S $temp_elf_file} debug_info]} { |
.ctrl.load.info.l configure -text "$debug_info" -fg red |
return 0 |
} |
588,7 → 599,7
global pmemIHEX |
global mem_sizes |
global isPmemRead |
|
|
# Get program memory start address |
set startAddr [format "0x%04x" [expr 0x10000-[lindex $mem_sizes 0]]] |
|
606,7 → 617,7
|
# Convert the binary content into Intel-HEX format |
set pmemIHEX [bin2ihex $startAddr $binData] |
|
|
# Update debugger view |
set isPmemRead 1 |
updateCodeView |
626,6 → 637,7
global isPmemRead |
global pmemIHEX |
global backup |
global TOOLCHAIN_PFX |
|
# Check if the file exists |
#---------------------------------------- |
650,7 → 662,7
if {![string eq $binFileType "ihex"] & ![string eq $binFileType "hex"] & ![string eq $binFileType "elf"]} { |
.ctrl.load.info.l configure -text "[string toupper $binFileType] file format not supported\"" -fg red |
return 0 |
} |
} |
|
if {[string eq $binFileType "hex"]} { |
set binFileType "ihex" |
682,14 → 694,14
|
# Generate binary file |
set bin_file "[clock clicks].bin" |
if {[catch {exec msp430-objcopy -I $binFileType -O binary $binFileName $bin_file} errMsg]} { |
if {[catch {exec ${TOOLCHAIN_PFX}-objcopy -I $binFileType -O binary $binFileName $bin_file} errMsg]} { |
.ctrl.load.info.l configure -text "$errMsg" -fg red |
return 0 |
} |
|
|
# Wait until bin file is present on the filesystem |
if {![waitForFile $bin_file]} { |
.ctrl.load.info.l configure -text "Timeout: ELF to BIN file conversion problem with \"msp430-objcopy\" executable" -fg red |
.ctrl.load.info.l configure -text "Timeout: ELF to BIN file conversion problem with \"${TOOLCHAIN_PFX}-objcopy\" executable" -fg red |
return 0 |
} |
|
935,7 → 947,7
|
# Set the breakpoint |
if {$brkpt(en_$brkpt_num)==1} { |
|
|
# Make sure the specified address is an opcode |
regsub {0x} $brkpt(addr_$brkpt_num) {} brkpt_val |
set code_match [.code.text search "$brkpt_val:" 1.0 end] |
945,7 → 957,7
|
} else { |
set brkpt(data_$brkpt_num) [ReadMem $CpuNr 0 $brkpt(addr_$brkpt_num)] |
|
|
# Only set a breakpoint if there is not already one there :-P |
if {$brkpt(data_$brkpt_num)=="0x4343"} { |
.ctrl.cpu.brkpt.addr$brkpt_num configure -state normal |
1032,7 → 1044,7
.menu.cpu2 configure -relief sunken -font $font_bold -fg "\#00ae00" -activeforeground "\#00ae00" |
.menu.cpu3 configure -relief raised -font $font_normal -fg "\#000000" -activeforeground "\#000000" |
|
} else { |
} else { |
.menu.cpu0 configure -relief raised -font $font_normal -fg "\#000000" -activeforeground "\#000000" |
.menu.cpu1 configure -relief raised -font $font_normal -fg "\#000000" -activeforeground "\#000000" |
.menu.cpu2 configure -relief raised -font $font_normal -fg "\#000000" -activeforeground "\#000000" |
1162,8 → 1174,8
|
# Create OK/Cancel button |
button .omsp_adapt_config.ok.okay -text "OK" -command {set omsp_conf(interface) [string tolower "${temp_if}_${temp_adapt}"] |
set omsp_nr $temp_nrcore; |
set omsp_conf(0,cpuaddr) $temp_addr(0); |
set omsp_nr $temp_nrcore; |
set omsp_conf(0,cpuaddr) $temp_addr(0); |
set omsp_conf(1,cpuaddr) $temp_addr(1); |
set omsp_conf(2,cpuaddr) $temp_addr(2); |
set omsp_conf(3,cpuaddr) $temp_addr(3); |
1226,14 → 1238,14
|
if {$temp_nrcore < 2} {.omsp_adapt_config.main.i2c.cpu1.s configure -state disabled |
} else {.omsp_adapt_config.main.i2c.cpu1.s configure -state normal} |
|
|
if {$temp_nrcore < 3} {.omsp_adapt_config.main.i2c.cpu2.s configure -state disabled |
} else {.omsp_adapt_config.main.i2c.cpu2.s configure -state normal} |
|
|
if {$temp_nrcore < 4} {.omsp_adapt_config.main.i2c.cpu3.s configure -state disabled |
} else {.omsp_adapt_config.main.i2c.cpu3.s configure -state normal} |
|
|
|
} |
} |
} |
1240,7 → 1252,7
|
proc saveContext {CpuNr} { |
|
global current_file_name |
global current_file_name |
global brkpt |
global mem |
global mem_sizes |
1283,7 → 1295,7
|
proc restoreContext {CpuNr} { |
|
global current_file_name |
global current_file_name |
global brkpt |
global mem |
global mem_sizes |
1302,7 → 1314,7
set binFileType $backup($CpuNr,binFileType) |
set isPmemRead $backup($CpuNr,isPmemRead) |
set codeSelect $backup($CpuNr,codeSelect) |
|
|
for {set i 0} {$i<16} {incr i} { |
set mem(address_$i) $backup($CpuNr,mem_addr_$i) |
} |
1425,7 → 1437,7
#################################### |
|
# Exit button |
button .menu.exit -text "Exit" -command {clearBreakpoints; exit 0} |
button .menu.exit -text "Exit" -command {clearBreakpoints; utils::uart_close; exit 0} |
pack .menu.exit -side left |
|
# CPU selection buttons |
1442,7 → 1454,7
|
# openMSP430 label |
label .menu.omsp -text "openMSP430 mini debugger" -anchor center -fg "\#6a5acd" -font {-weight bold -size 16} |
pack .menu.omsp -side right -padx 20 |
pack .menu.omsp -side right -padx 20 |
|
# Serial Port fields |
label .ctrl.connect.serial.l1 -text "Device Port:" -anchor w |
1609,7 → 1621,7
entry .ctrl.tclscript.ft.file -width 58 -relief sunken -textvariable tcl_file_name -state disabled |
pack .ctrl.tclscript.ft.file -side left -padx 10 |
button .ctrl.tclscript.ft.browse -text "Browse" -width 9 -state disabled -command {set tcl_file_name [tk_getOpenFile -filetypes {{{TCL Files} {.tcl}} {{All Files} *}}]} |
pack .ctrl.tclscript.ft.browse -side right -padx 5 |
pack .ctrl.tclscript.ft.browse -side right -padx 5 |
frame .ctrl.tclscript.fb |
pack .ctrl.tclscript.fb -side top -fill x |
button .ctrl.tclscript.fb.read -text "Source TCL script !" -state disabled -command {if {[file exists $tcl_file_name]} {source $tcl_file_name}} |
/bin/openmsp430-loader.tcl
22,7 → 22,7
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
# |
#------------------------------------------------------------------------------ |
# |
# |
# File Name: openmsp430-loader.tcl |
# |
# Author(s): |
37,6 → 37,18
global omsp_conf |
global omsp_info |
|
# Detect toolchain |
if {[catch {exec msp430-gcc --version} debug_info]} { |
if {[catch {exec msp430-elf-gcc --version} debug_info]} { |
puts "\nERROR: Could not detect MSP430 GCC toolchain" |
exit 1 |
} else { |
set TOOLCHAIN_PFX "msp430-elf" |
} |
} else { |
set TOOLCHAIN_PFX "msp430" |
} |
|
############################################################################### |
# SOURCE LIBRARIES # |
############################################################################### |
98,7 → 110,7
if {[string eq $elf_file -1]} { |
puts "\nERROR: ELF/IHEX file isn't specified" |
help |
exit 1 |
exit 1 |
} |
|
# Make sure the elf file exists |
105,7 → 117,7
if {![file exists $elf_file]} { |
puts "\nERROR: Specified ELF/IHEX file doesn't exist" |
help |
exit 1 |
exit 1 |
} |
|
# Make sure the selected adptor is valid |
113,7 → 125,7
![string eq $omsp_conf(interface) "i2c_usb-iss"]} { |
puts "\nERROR: Specified adaptor is not valid (should be \"uart_generic\" or \"i2c_usb-iss\")" |
help |
exit 1 |
exit 1 |
} |
|
# Make sure the I2C address is an integer |
120,7 → 132,7
if {![string is integer $omsp_conf(0,cpuaddr)]} { |
puts "\nERROR: Specified I2C address is not an integer" |
help |
exit 1 |
exit 1 |
} |
|
# Make sure the I2C address is valid |
127,7 → 139,7
if {($omsp_conf(0,cpuaddr)<8) | ($omsp_conf(0,cpuaddr)>119)} { |
puts "\nERROR: Specified I2C address should lay between 7 and 120" |
help |
exit 1 |
exit 1 |
} |
|
# If the selected interface is a UART, make sure the selected speed is an integer |
135,7 → 147,7
if {![string is integer $omsp_conf(baudrate)]} { |
puts "\nERROR: Specified UART communication speed is not an integer" |
help |
exit 1 |
exit 1 |
} |
} elseif {[string eq $omsp_conf(interface) "i2c_usb-iss"]} { |
if {[lsearch [lindex [GetAllowedSpeeds] 2] $omsp_conf(baudrate)]==-1} { |
145,7 → 157,7
puts " - $allowedVal" |
} |
puts "" |
exit 1 |
exit 1 |
} |
} |
|
170,7 → 182,7
} |
|
# Generate binary file |
if {[catch {exec msp430-objcopy -I $fileType -O binary $elf_file $bin_file} errMsg]} { |
if {[catch {exec ${TOOLCHAIN_PFX}-objcopy -I $fileType -O binary $elf_file $bin_file} errMsg]} { |
puts $errMsg |
exit 1 |
} |
184,7 → 196,7
} |
} |
if {$i>=$timeout} { |
puts "\nTimeout: ELF to BIN file conversion problem with \"msp430-objcopy\" executable" |
puts "\nTimeout: ELF to BIN file conversion problem with \"${TOOLCHAIN_PFX}-objcopy\" executable" |
puts "$errMsg" |
exit 1 |
} |
244,6 → 256,7
# Make sure ELF program size is the same as the available program memory |
if {[lindex $sizes 0] != [expr $hex_size/2]} { |
puts "ERROR: ELF program size ($byte_size B) is different than the available program memory ([lindex $sizes 0] B)" |
utils::uart_close |
exit 1 |
} |
|
262,6 → 275,7
puts "done" |
} else { |
puts "ERROR" |
utils::uart_close |
exit 1 |
} |
|