Line 27... |
Line 27... |
#
|
#
|
# Author(s):
|
# Author(s):
|
# - Olivier Girard, olgirard@gmail.com
|
# - Olivier Girard, olgirard@gmail.com
|
#
|
#
|
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
# $Rev: 110 $
|
# $Rev: 158 $
|
# $LastChangedBy: olivier.girard $
|
# $LastChangedBy: olivier.girard $
|
# $LastChangedDate: 2011-05-19 22:33:51 +0200 (Thu, 19 May 2011) $
|
# $LastChangedDate: 2012-10-15 23:49:09 +0200 (Mon, 15 Oct 2012) $
|
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
|
|
global serial_baudrate
|
|
global serial_device
|
|
global serial_status
|
|
global hw_break
|
|
global clients
|
|
global server
|
|
global verbose
|
|
global shell
|
|
global omsp_info
|
|
|
|
# Initializations
|
|
set serial_status 0
|
|
|
|
|
|
###############################################################################
|
###############################################################################
|
# #
|
# #
|
# SOURCE LIBRARIES #
|
# SOURCE LIBRARIES #
|
# #
|
# #
|
###############################################################################
|
###############################################################################
|
Line 61... |
Line 47... |
}
|
}
|
set lib_path [file dirname $current_file]/../lib/tcl-lib
|
set lib_path [file dirname $current_file]/../lib/tcl-lib
|
|
|
# Source library
|
# Source library
|
source $lib_path/dbg_functions.tcl
|
source $lib_path/dbg_functions.tcl
|
|
source $lib_path/dbg_utils.tcl
|
|
|
# Source remaining files
|
# Source remaining files
|
source [file dirname $current_file]/../openmsp430-gdbproxy/server.tcl
|
source [file dirname $current_file]/../openmsp430-gdbproxy/server.tcl
|
source [file dirname $current_file]/../openmsp430-gdbproxy/commands.tcl
|
source [file dirname $current_file]/../openmsp430-gdbproxy/commands.tcl
|
|
|
|
|
###############################################################################
|
###############################################################################
|
# #
|
# #
|
|
# GLOBAL VARIABLES #
|
|
# #
|
|
###############################################################################
|
|
|
|
global CpuNr
|
|
|
|
global omsp_conf
|
|
global omsp_info
|
|
|
|
global omsp_nr
|
|
|
|
global gui_dbg_if
|
|
global gui_adapter
|
|
global clients
|
|
global server
|
|
global verbose
|
|
global shell
|
|
|
|
# Initialize to default values
|
|
set CpuNr 0
|
|
set omsp_nr 1
|
|
set omsp_conf(interface) uart_generic
|
|
#set omsp_nr 4
|
|
#set omsp_conf(interface) i2c_usb-iss
|
|
set omsp_conf(device) [lindex [utils::uart_port_list] end]
|
|
set omsp_conf(baudrate) [lindex [GetAllowedSpeeds] 1]
|
|
set omsp_conf(0,cpuaddr) 50
|
|
set omsp_conf(1,cpuaddr) 51
|
|
set omsp_conf(2,cpuaddr) 52
|
|
set omsp_conf(3,cpuaddr) 53
|
|
|
|
set server(port) 2000
|
|
|
|
set shell 0
|
|
set verbose 0
|
|
|
|
###############################################################################
|
|
# #
|
# PARAMETER CHECK #
|
# PARAMETER CHECK #
|
# #
|
# #
|
###############################################################################
|
###############################################################################
|
|
|
proc help {} {
|
proc help {} {
|
puts ""
|
puts ""
|
puts "USAGE : openmsp430-gdbproxy.tcl \[-device <communication device>\]"
|
puts "USAGE : openmsp430-gdbproxy.tcl \[-device <communication port>\]"
|
puts " \[-baudrate <communication speed>\]"
|
puts " \[-adaptor <adaptor type>\]"
|
|
puts " \[-speed <communication speed>\]"
|
|
puts " \[-i2c_addr <cpu address>\]"
|
puts " \[-port <server port>\]"
|
puts " \[-port <server port>\]"
|
puts " \[-shell]"
|
puts " \[-shell]"
|
puts " \[-verbose\]"
|
puts " \[-verbose\]"
|
puts " \[-help\]"
|
puts " \[-help\]"
|
puts ""
|
puts ""
|
puts "Examples: openmsp430-gdbproxy.tcl -device /dev/ttyUSB0 -baudrate 9600 -port 2000"
|
puts "Examples: openmsp430-gdbproxy.tcl -device /dev/ttyUSB0 -adaptor uart_generic -speed 115200 -port 2000"
|
puts " openmsp430-gdbproxy.tcl -device COM2: -baudrate 38400 -port 2000"
|
puts " openmsp430-gdbproxy.tcl -device COM2: -adaptor i2c_usb-iss -speed I2C_S_100KHZ -i2c_addr 75 -port 2000"
|
puts ""
|
puts ""
|
}
|
}
|
|
|
# Default values
|
|
set serial_device [lindex [dbg_list_uart] end]
|
|
set serial_baudrate 115200
|
|
set server(port) 2000
|
|
set shell 0
|
|
set verbose 0
|
|
|
|
# Parse arguments
|
# Parse arguments
|
for {set i 0} {$i < $argc} {incr i} {
|
for {set i 0} {$i < $argc} {incr i} {
|
switch -exact -- [lindex $argv $i] {
|
switch -exact -- [lindex $argv $i] {
|
-device {set serial_device [lindex $argv [expr $i+1]]; incr i}
|
-device {set omsp_conf(device) [lindex $argv [expr $i+1]]; incr i}
|
-baudrate {set serial_baudrate [lindex $argv [expr $i+1]]; incr i}
|
-adaptor {set omsp_conf(interface) [lindex $argv [expr $i+1]]; incr i}
|
|
-speed {set omsp_conf(baudrate) [lindex $argv [expr $i+1]]; incr i}
|
|
-i2c_addr {set omsp_conf(0,cpuaddr) [lindex $argv [expr $i+1]]; incr i}
|
-port {set server(port) [lindex $argv [expr $i+1]]; incr i}
|
-port {set server(port) [lindex $argv [expr $i+1]]; incr i}
|
-shell {set shell 1}
|
-shell {set shell 1}
|
-verbose {set verbose 1}
|
-verbose {set verbose 1}
|
-h {help; exit 0}
|
-h {help; exit 0}
|
-help {help; exit 0}
|
-help {help; exit 0}
|
default {}
|
default {}
|
}
|
}
|
}
|
}
|
|
|
|
# Make sure the selected adptor is valid
|
|
if {![string eq $omsp_conf(interface) "uart_generic"] &
|
|
![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
|
|
}
|
|
|
|
# Make sure the I2C address is an integer
|
|
if {![string is integer $omsp_conf(0,cpuaddr)]} {
|
|
puts "\nERROR: Specified I2C address is not an integer"
|
|
help
|
|
exit 1
|
|
}
|
|
|
|
# Make sure the I2C address is valid
|
|
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
|
|
}
|
|
|
|
# If the selected interface is a UART, make sure the selected speed is an integer
|
|
if {[string eq $omsp_conf(interface) "uart_generic"]} {
|
|
if {![string is integer $omsp_conf(baudrate)]} {
|
|
puts "\nERROR: Specified UART communication speed is not an integer"
|
|
help
|
|
exit 1
|
|
}
|
|
} elseif {[string eq $omsp_conf(interface) "i2c_usb-iss"]} {
|
|
if {[lsearch [lindex [GetAllowedSpeeds] 2] $omsp_conf(baudrate)]==-1} {
|
|
puts "\nERROR: Specified I2C communication speed is not valid."
|
|
puts " Allowed values are:"
|
|
foreach allowedVal [lindex [GetAllowedSpeeds] 2] {
|
|
puts " - $allowedVal"
|
|
}
|
|
puts ""
|
|
exit 1
|
|
}
|
|
}
|
|
|
# Source additional library for graphical interface
|
# Source additional library for graphical interface
|
if {!$shell} {
|
if {!$shell} {
|
source $lib_path/combobox.tcl
|
source $lib_path/combobox.tcl
|
package require combobox 2.3
|
package require combobox 2.3
|
catch {namespace import combobox::*}
|
catch {namespace import combobox::*}
|
Line 147... |
Line 210... |
# SHELL MODE #
|
# SHELL MODE #
|
###############################################################################
|
###############################################################################
|
if {$shell} {
|
if {$shell} {
|
|
|
# Connect to device
|
# Connect to device
|
if {![GetDevice]} {
|
if {![GetDevice $CpuNr]} {
|
puts "ERROR: Could not open $serial_device"
|
puts "ERROR: Could not open $omsp_conf(device)
|
puts "INFO: Available serial ports are:"
|
puts "INFO: Available serial ports are:"
|
foreach port [dbg_list_uart] {
|
foreach port [utils::uart_port_list] {
|
puts "INFO: - $port"
|
puts "INFO: - $port"
|
}
|
}
|
exit 1
|
if {[string eq $omsp_conf(interface) "i2c_usb-iss"]} {
|
}
|
puts "\nMake sure the specified I2C device address is correct: $omsp_conf(0,cpuaddr)\n"
|
|
}
|
# Display info
|
exit 1
|
if {$omsp_info(alias)==""} {
|
}
|
puts "INFO: Sucessfully connected with the openMSP430 target."
|
|
} else {
|
# Display info
|
puts "INFO: Sucessfully connected with the openMSP430 target ($omsp_info(alias))."
|
if {$omsp_info($CpuNr,alias)==""} {
|
}
|
puts "INFO: Sucessfully connected with the openMSP430 target."
|
set sizes [GetCPU_ID_SIZE]
|
} else {
|
if {$omsp_info(asic)} {
|
puts "INFO: Sucessfully connected with the openMSP430 target ($omsp_info($CpuNr,alias))."
|
puts "INFO: CPU Version - $omsp_info(cpu_ver) / ASIC"
|
}
|
} else {
|
set sizes [GetCPU_ID_SIZE $CpuNr]
|
puts "INFO: CPU Version - $omsp_info(cpu_ver) / FPGA"
|
if {$omsp_info($CpuNr,asic)} {
|
}
|
puts "INFO: CPU Version - $omsp_info($CpuNr,cpu_ver) / ASIC"
|
puts "INFO: User Version - $omsp_info(user_ver)"
|
} else {
|
if {$omsp_info(cpu_ver)==1} {
|
puts "INFO: CPU Version - $omsp_info($CpuNr,cpu_ver) / FPGA"
|
puts "INFO: Hardware Multiplier - --"
|
}
|
} elseif {$omsp_info(mpy)} {
|
puts "INFO: User Version - $omsp_info($CpuNr,user_ver)"
|
puts "INFO: Hardware Multiplier - Yes"
|
if {$omsp_info($CpuNr,cpu_ver)==1} {
|
} else {
|
puts "INFO: Hardware Multiplier - --"
|
puts "INFO: Hardware Multiplier - No"
|
} elseif {$omsp_info($CpuNr,mpy)} {
|
}
|
puts "INFO: Hardware Multiplier - Yes"
|
puts "INFO: Program Memory Size - $omsp_info(pmem_size) B"
|
} else {
|
puts "INFO: Data Memory Size - $omsp_info(dmem_size) B"
|
puts "INFO: Hardware Multiplier - No"
|
puts "INFO: Peripheral Address Space - $omsp_info(per_size) B"
|
}
|
puts "INFO: $hw_break(num) Hardware Brea/Watch-point unit(s) detected"
|
puts "INFO: Program Memory Size - $omsp_info($CpuNr,pmem_size) B"
|
puts ""
|
puts "INFO: Data Memory Size - $omsp_info($CpuNr,dmem_size) B"
|
|
puts "INFO: Peripheral Address Space - $omsp_info($CpuNr,per_size) B"
|
# Reset & Stop CPU
|
puts "INFO: $omsp_info($CpuNr,hw_break) Hardware Brea/Watch-point unit(s) detected"
|
ExecutePOR_Halt
|
puts ""
|
|
|
# Start server for GDB
|
# Reset & Stop CPU
|
if {![startServer]} {
|
ExecutePOR_Halt $CpuNr
|
exit 1
|
|
}
|
# Start server for GDB
|
|
if {![startServer]} {
|
|
exit 1
|
|
}
|
|
|
vwait forever
|
vwait forever
|
}
|
}
|
|
|
|
|
###############################################################################
|
proc getConfiguration {} {
|
# GUI MODE #
|
|
###############################################################################
|
|
|
|
####################################
|
global gui_dbg_if
|
# CREATE & PLACE MAIN WIDGETS #
|
global gui_adapter
|
####################################
|
global omsp_conf
|
|
|
|
regexp {(.+)_(.+)} $omsp_conf(interface) whole_match tmp_if tmp_adapter
|
|
|
|
set gui_dbg_if [string toupper $tmp_if]
|
|
set gui_adapter [string toupper $tmp_adapter]
|
|
|
|
return 1
|
|
}
|
|
|
|
proc updateConfiguration {{w ""} {sel ""}} {
|
|
|
|
global gui_dbg_if
|
|
global gui_adapter
|
|
global omsp_conf
|
|
global omsp_nr
|
|
|
|
if {$sel=="UART"} {
|
|
eval .connect.cfg.if.config2.adapter.p2 list delete 0 end
|
|
eval .connect.cfg.if.config2.adapter.p2 list insert end [list "GENERIC"]
|
|
set gui_adapter "GENERIC"
|
|
set omsp_conf(interface) uart_generic
|
|
|
|
} elseif {$sel=="I2C"} {
|
|
|
|
eval .connect.cfg.if.config2.adapter.p2 list delete 0 end
|
|
eval .connect.cfg.if.config2.adapter.p2 list insert end [list "USB-ISS"]
|
|
set gui_adapter "USB-ISS"
|
|
set omsp_conf(interface) i2c_usb-iss
|
|
}
|
|
|
|
if {$gui_dbg_if=="UART"} {
|
|
set omsp_nr 1
|
|
.connect.cfg.ad.i2c_nr.l configure -state disabled
|
|
.connect.cfg.ad.i2c_nr.s configure -state disabled
|
|
.connect.cfg.ad.i2c_addr.l configure -state disabled
|
|
.connect.cfg.ad.i2c_addr.s0 configure -state disabled
|
|
.connect.cfg.ad.i2c_addr.s1 configure -state disabled
|
|
.connect.cfg.ad.i2c_addr.s2 configure -state disabled
|
|
.connect.cfg.ad.i2c_addr.s3 configure -state disabled
|
|
.connect.cfg.ad.arrow.l0 configure -state disabled
|
|
.connect.cfg.ad.arrow.l1 configure -state disabled
|
|
.connect.cfg.ad.arrow.l2 configure -state disabled
|
|
.connect.cfg.ad.arrow.l3 configure -state disabled
|
|
.connect.cfg.ad.server_port.p0 configure -state normal
|
|
.connect.cfg.ad.server_port.p1 configure -state disabled
|
|
.connect.cfg.ad.server_port.p2 configure -state disabled
|
|
.connect.cfg.ad.server_port.p3 configure -state disabled
|
|
.connect.cfg.ad.core_nr.l0 configure -state disabled
|
|
.connect.cfg.ad.core_nr.l1 configure -state disabled
|
|
.connect.cfg.ad.core_nr.l2 configure -state disabled
|
|
.connect.cfg.ad.core_nr.l3 configure -state disabled
|
|
} elseif {$gui_dbg_if=="I2C"} {
|
|
# .connect.cfg.ad.core_nr.l0 configure -state normal
|
|
# .connect.cfg.ad.i2c_nr.l configure -state normal
|
|
# .connect.cfg.ad.i2c_nr.s configure -state normal
|
|
.connect.cfg.ad.i2c_addr.l configure -state normal
|
|
.connect.cfg.ad.i2c_addr.s0 configure -state normal
|
|
.connect.cfg.ad.arrow.l0 configure -state normal
|
|
.connect.cfg.ad.server_port.p0 configure -state normal
|
|
# .connect.cfg.ad.core_nr.l0 configure -state normal
|
|
|
|
|
|
if {$omsp_nr < 2} {
|
|
.connect.cfg.ad.core_nr.l1 configure -state disabled
|
|
.connect.cfg.ad.server_port.p1 configure -state disabled
|
|
.connect.cfg.ad.arrow.l1 configure -state disabled
|
|
.connect.cfg.ad.i2c_addr.s1 configure -state disabled
|
|
} else {
|
|
.connect.cfg.ad.core_nr.l1 configure -state normal
|
|
.connect.cfg.ad.server_port.p1 configure -state normal
|
|
.connect.cfg.ad.arrow.l1 configure -state normal
|
|
.connect.cfg.ad.i2c_addr.s1 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
|
|
.connect.cfg.ad.arrow.l2 configure -state disabled
|
|
.connect.cfg.ad.i2c_addr.s2 configure -state disabled
|
|
} else {
|
|
.connect.cfg.ad.core_nr.l2 configure -state normal
|
|
.connect.cfg.ad.server_port.p2 configure -state normal
|
|
.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
|
|
.connect.cfg.ad.arrow.l3 configure -state disabled
|
|
.connect.cfg.ad.i2c_addr.s3 configure -state disabled
|
|
} else {
|
|
.connect.cfg.ad.core_nr.l3 configure -state normal
|
|
.connect.cfg.ad.server_port.p3 configure -state normal
|
|
.connect.cfg.ad.arrow.l3 configure -state normal
|
|
.connect.cfg.ad.i2c_addr.s3 configure -state normal
|
|
}
|
|
}
|
|
|
|
.connect.cfg.if.config2.serial_port.p2 configure -editable 1
|
|
eval .connect.cfg.if.config2.serial_port.p2 list delete 0 end
|
|
eval .connect.cfg.if.config2.serial_port.p2 list insert end [lindex [GetAllowedSpeeds] 2]
|
|
set omsp_conf(baudrate) [lindex [GetAllowedSpeeds] 1];
|
|
.connect.cfg.if.config2.serial_port.p2 configure -editable [lindex [GetAllowedSpeeds] 0];
|
|
|
|
}
|
|
|
|
###############################################################################
|
|
# GUI MODE #
|
|
###############################################################################
|
|
|
|
####################################
|
|
# CREATE & PLACE MAIN WIDGETS #
|
|
####################################
|
|
|
wm title . "openMSP430 GDB Proxy"
|
wm title . "openMSP430 GDB Proxy"
|
wm iconname . "openMSP430 GDB Proxy"
|
wm iconname . "openMSP430 GDB Proxy"
|
|
|
# Create the Main Menu frame
|
# Create the Main Menu frame
|
frame .menu
|
frame .menu
|
pack .menu -side top -padx 10 -pady 10 -fill x
|
pack .menu -side top -padx 10 -pady 10 -fill x
|
|
|
# Create the Connection frame
|
# Create the Connection frame
|
frame .connect -bd 2 -relief ridge ;# solid
|
frame .connect -bd 2 -relief ridge ;# solid
|
pack .connect -side top -padx 10 -pady {5 0} -fill x
|
pack .connect -side top -padx 10 -pady {5 0} -fill x
|
|
|
# Create the Info frame
|
# Create the Info frame
|
frame .info -bd 2 -relief ridge ;# solid
|
frame .info -bd 2 -relief ridge ;# solid
|
pack .info -side top -padx 10 -pady {10 0} -fill x
|
pack .info -side top -padx 10 -pady {10 0} -fill x
|
|
|
# Create the Server frame
|
# Create the Server frame
|
frame .server -bd 2 -relief ridge ;# solid
|
frame .server -bd 2 -relief ridge ;# solid
|
pack .server -side top -padx 10 -pady {10 0} -fill x
|
pack .server -side top -padx 10 -pady {10 0} -fill x
|
|
|
# Create the TCL script field
|
# Create the TCL script field
|
frame .tclscript -bd 2 -relief ridge ;# solid
|
frame .tclscript -bd 2 -relief ridge ;# solid
|
pack .tclscript -side top -padx 10 -pady 10 -fill x
|
pack .tclscript -side top -padx 10 -pady 10 -fill x
|
|
|
|
|
####################################
|
####################################
|
# CREATE THE REST #
|
# CREATE THE REST #
|
####################################
|
####################################
|
|
|
# Exit button
|
# Exit button
|
button .menu.exit -text "Exit" -command {stopServer; exit 0}
|
button .menu.exit -text "Exit" -command {stopServer; exit 0}
|
pack .menu.exit -side left
|
pack .menu.exit -side left
|
|
|
# openMSP430 label
|
# openMSP430 label
|
label .menu.omsp -text "openMSP430 GDB proxy" -anchor center -fg "\#6a5acd" -font {-weight bold -size 14}
|
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
|
# Create the Configuration, Start & Info frames
|
frame .connect.config
|
getConfiguration
|
pack .connect.config -side left -padx 10 -pady 0 -fill x -expand true
|
frame .connect.cfg
|
|
pack .connect.cfg -side left -padx 0 -pady 0 -fill x -expand true
|
|
frame .connect.cfg.if -bd 2 -relief ridge
|
|
pack .connect.cfg.if -side top -padx 10 -pady {10 0} -fill x -expand true
|
|
frame .connect.cfg.ad -bd 2 -relief ridge
|
|
pack .connect.cfg.ad -side top -padx 10 -pady 10 -fill both -expand true
|
frame .connect.start
|
frame .connect.start
|
pack .connect.start -side right -padx 10 -pady 0 -fill x -expand true
|
pack .connect.start -side right -padx 10 -pady 0 -fill x -expand true
|
|
|
# Serial Port fields
|
frame .connect.cfg.if.config1
|
set serial_device [lindex [dbg_list_uart] end]
|
pack .connect.cfg.if.config1 -side left -padx 0 -pady 0 -fill x -expand true
|
frame .connect.config.serial_port
|
frame .connect.cfg.if.config2
|
pack .connect.config.serial_port -side top -padx 5 -pady {10 0} -fill x
|
pack .connect.cfg.if.config2 -side left -padx 0 -pady 0 -fill x -expand true
|
label .connect.config.serial_port.l1 -text "Serial Port:" -anchor w
|
|
pack .connect.config.serial_port.l1 -side left -padx 5
|
# Interface & Adapter selection
|
combobox .connect.config.serial_port.p1 -textvariable serial_device -editable true -width 20
|
frame .connect.cfg.if.config1.adapter
|
eval .connect.config.serial_port.p1 list insert end [dbg_list_uart]
|
pack .connect.cfg.if.config1.adapter -side top -padx 5 -pady {10 0} -fill x
|
pack .connect.config.serial_port.p1 -side right -padx 20
|
label .connect.cfg.if.config1.adapter.l1 -text "Serial Debug Interface:" -anchor w
|
|
pack .connect.cfg.if.config1.adapter.l1 -side left -padx 5
|
# Serial Baudrate fields
|
combobox .connect.cfg.if.config1.adapter.p1 -textvariable gui_dbg_if -editable false -width 15 -command {updateConfiguration}
|
set serial_baudrate 115200
|
eval .connect.cfg.if.config1.adapter.p1 list insert end [list "UART" "I2C"]
|
frame .connect.config.serial_baudrate
|
pack .connect.cfg.if.config1.adapter.p1 -side right -padx 10
|
pack .connect.config.serial_baudrate -side top -padx 5 -pady {5 0} -fill x
|
|
label .connect.config.serial_baudrate.l2 -text " Baudrate:" -anchor w
|
frame .connect.cfg.if.config2.adapter
|
pack .connect.config.serial_baudrate.l2 -side left
|
pack .connect.cfg.if.config2.adapter -side top -padx 5 -pady {10 0} -fill x
|
combobox .connect.config.serial_baudrate.p2 -textvariable serial_baudrate -editable true -width 20
|
label .connect.cfg.if.config2.adapter.l2 -text "Adapter selection:" -anchor w
|
eval .connect.config.serial_baudrate.p2 list insert end [list 9600 19200 38400 57600 115200 \
|
pack .connect.cfg.if.config2.adapter.l2 -side left -padx 5
|
230400 460800 500000 576000 921600 \
|
combobox .connect.cfg.if.config2.adapter.p2 -textvariable gui_adapter -editable false -width 15
|
1000000 1152000]
|
eval .connect.cfg.if.config2.adapter.p2 list insert end [list "GENERIC"]
|
pack .connect.config.serial_baudrate.p2 -side right -padx 20
|
pack .connect.cfg.if.config2.adapter.p2 -side right -padx 5
|
|
|
# Server Port field
|
# Device port & Speed selection
|
frame .connect.config.server_port
|
frame .connect.cfg.if.config1.serial_port
|
pack .connect.config.server_port -side top -padx 10 -pady {15 10} -fill x
|
pack .connect.cfg.if.config1.serial_port -side top -padx 5 -pady {10 10} -fill x
|
label .connect.config.server_port.l1 -text "Proxy Server Port:" -anchor w
|
label .connect.cfg.if.config1.serial_port.l1 -text "Device Port:" -anchor w
|
pack .connect.config.server_port.l1 -side left
|
pack .connect.cfg.if.config1.serial_port.l1 -side left -padx 5
|
entry .connect.config.server_port.p -textvariable server(port) -relief sunken -width 20
|
combobox .connect.cfg.if.config1.serial_port.p1 -textvariable omsp_conf(device) -editable true -width 15
|
pack .connect.config.server_port.p -side right -padx 5 -padx 20
|
eval .connect.cfg.if.config1.serial_port.p1 list insert end [utils::uart_port_list]
|
|
pack .connect.cfg.if.config1.serial_port.p1 -side right -padx 10
|
|
|
# Connect to CPU & start proxy server
|
frame .connect.cfg.if.config2.serial_port
|
button .connect.start.but -text "Connect to CPU\n and \nStart Proxy Server" -command {startServerGUI}
|
pack .connect.cfg.if.config2.serial_port -side top -padx 5 -pady {10 10} -fill x
|
pack .connect.start.but -side right -padx 30
|
label .connect.cfg.if.config2.serial_port.l2 -text "Speed:" -anchor w
|
|
pack .connect.cfg.if.config2.serial_port.l2 -side left -padx 5
|
|
combobox .connect.cfg.if.config2.serial_port.p2 -textvariable omsp_conf(baudrate) -editable [lindex [GetAllowedSpeeds] 0] -width 15
|
# CPU Info
|
eval .connect.cfg.if.config2.serial_port.p2 list insert end [lindex [GetAllowedSpeeds] 2]
|
frame .info.cpu
|
pack .connect.cfg.if.config2.serial_port.p2 -side right -padx 5
|
pack .info.cpu -side top -padx 10 -pady {5 0} -fill x
|
|
label .info.cpu.l -text "CPU Info:" -anchor w
|
# Server Port field & I2C address selection
|
pack .info.cpu.l -side left -padx {10 10}
|
frame .connect.cfg.ad.core_nr
|
label .info.cpu.con -text "Disconnected" -anchor w -fg Red
|
pack .connect.cfg.ad.core_nr -side left -padx 5 -fill y
|
pack .info.cpu.con -side left
|
label .connect.cfg.ad.core_nr.l3 -text "Core 3:" -anchor w
|
button .info.cpu.more -text "More..." -width 9 -command {displayMore} -state disabled
|
pack .connect.cfg.ad.core_nr.l3 -side bottom -padx {25 0} -pady {10 10}
|
pack .info.cpu.more -side right -padx {0 30}
|
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}
|
|
label .connect.cfg.ad.core_nr.l1 -text "Core 1:" -anchor w
|
# Server Info
|
pack .connect.cfg.ad.core_nr.l1 -side bottom -padx {25 0} -pady {10 2}
|
frame .info.server
|
label .connect.cfg.ad.core_nr.l0 -text "Core 0:" -anchor w
|
pack .info.server -side top -padx 10 -pady {0 10} -fill x
|
pack .connect.cfg.ad.core_nr.l0 -side bottom -padx {25 0} -pady {10 2}
|
label .info.server.l -text "Server Info:" -anchor w
|
|
pack .info.server.l -side left -padx {10 10}
|
frame .connect.cfg.ad.server_port
|
label .info.server.con -text "Not running" -anchor w -fg Red
|
pack .connect.cfg.ad.server_port -side left -padx 5 -fill y
|
pack .info.server.con -side left
|
entry .connect.cfg.ad.server_port.p3 -textvariable server(port) -relief sunken -width 10
|
|
pack .connect.cfg.ad.server_port.p3 -side bottom -padx 5 -pady {10 10}
|
|
entry .connect.cfg.ad.server_port.p2 -textvariable server(port) -relief sunken -width 10
|
|
pack .connect.cfg.ad.server_port.p2 -side bottom -padx 5 -pady {10 0}
|
|
entry .connect.cfg.ad.server_port.p1 -textvariable server(port) -relief sunken -width 10
|
|
pack .connect.cfg.ad.server_port.p1 -side bottom -padx 5 -pady {10 0}
|
|
entry .connect.cfg.ad.server_port.p0 -textvariable server(port) -relief sunken -width 10
|
|
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}
|
|
|
|
frame .connect.cfg.ad.arrow
|
|
pack .connect.cfg.ad.arrow -side left -padx 5 -fill y
|
|
label .connect.cfg.ad.arrow.l3 -text "==>" -anchor w
|
|
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}
|
|
label .connect.cfg.ad.arrow.l1 -text "==>" -anchor w
|
|
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}
|
|
|
|
frame .connect.cfg.ad.i2c_addr
|
|
pack .connect.cfg.ad.i2c_addr -side left -padx 5 -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}
|
|
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}
|
|
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}
|
|
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}
|
|
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}
|
|
|
|
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}
|
|
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}
|
|
|
|
# Update according to default values
|
|
updateConfiguration
|
|
|
|
# Connect to CPU & start proxy server
|
|
button .connect.start.but -text "Connect to CPU(s)\n and \nStart Proxy Server(s)" -command {startServerGUI}
|
|
pack .connect.start.but -side right -padx 30
|
|
|
|
|
|
# CPU Info
|
|
frame .info.cpu
|
|
pack .info.cpu -side top -padx 10 -pady {5 0} -fill x
|
|
label .info.cpu.l -text "CPU Info:" -anchor w
|
|
pack .info.cpu.l -side left -padx {10 10}
|
|
label .info.cpu.con -text "Disconnected" -anchor w -fg Red
|
|
pack .info.cpu.con -side left
|
|
button .info.cpu.more -text "More..." -width 9 -command {displayMore} -state disabled
|
|
pack .info.cpu.more -side right -padx {0 30}
|
|
|
|
|
|
# Server Info
|
|
frame .info.server
|
|
pack .info.server -side top -padx 10 -pady {0 10} -fill x
|
|
label .info.server.l -text "Server Info:" -anchor w
|
|
pack .info.server.l -side left -padx {10 10}
|
|
label .info.server.con -text "Not running" -anchor w -fg Red
|
|
pack .info.server.con -side left
|
|
|
|
|
# Create the text widget to log received messages
|
# Create the text widget to log received messages
|
frame .server.t
|
frame .server.t
|
pack .server.t -side top -padx 10 -pady 10 -fill x
|
pack .server.t -side top -padx 10 -pady 10 -fill x
|
set server(log) [text .server.t.log -width 80 -height 15 -borderwidth 2 \
|
set server(log) [text .server.t.log -width 80 -height 15 -borderwidth 2 \
|
-setgrid true -yscrollcommand {.server.t.scroll set}]
|
-setgrid true -yscrollcommand {.server.t.scroll set}]
|
pack .server.t.log -side left -fill both -expand true
|
pack .server.t.log -side left -fill both -expand true
|
scrollbar .server.t.scroll -command {.server.t.log yview}
|
scrollbar .server.t.scroll -command {.server.t.log yview}
|
pack .server.t.scroll -side right -fill both
|
pack .server.t.scroll -side right -fill both
|
|
|
|
|
# Log commands
|
# Log commands
|
frame .server.cmd
|
frame .server.cmd
|
pack .server.cmd -side top -pady {0 10} -fill x
|
pack .server.cmd -side top -pady {0 10} -fill x
|
button .server.cmd.clear -text "Clear log" -command {$server(log) delete 1.0 end}
|
button .server.cmd.clear -text "Clear log" -command {$server(log) delete 1.0 end}
|
pack .server.cmd.clear -side left -padx 10
|
pack .server.cmd.clear -side left -padx 10
|
checkbutton .server.cmd.verbose -text "Verbose" -variable verbose
|
checkbutton .server.cmd.verbose -text "Verbose" -variable verbose
|
pack .server.cmd.verbose -side right -padx 10
|
pack .server.cmd.verbose -side right -padx 10
|
|
|
|
|
# Load TCL script fields
|
# Load TCL script fields
|
frame .tclscript.ft
|
frame .tclscript.ft
|
pack .tclscript.ft -side top -padx 10 -pady 10 -fill x
|
pack .tclscript.ft -side top -padx 10 -pady 10 -fill x
|
label .tclscript.ft.l -text "TCL script:" -state disabled
|
label .tclscript.ft.l -text "TCL script:" -state disabled
|
pack .tclscript.ft.l -side left -padx "0 10"
|
pack .tclscript.ft.l -side left -padx "0 10"
|
entry .tclscript.ft.file -width 58 -relief sunken -textvariable tcl_file_name -state disabled
|
entry .tclscript.ft.file -width 58 -relief sunken -textvariable tcl_file_name -state disabled
|
pack .tclscript.ft.file -side left -padx 10
|
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} *}}]}
|
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
|
frame .tclscript.fb
|
pack .tclscript.fb -side top -fill x
|
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}}
|
button .tclscript.fb.read -text "Source TCL script !" -state disabled -command {if {[file exists $tcl_file_name]} {source $tcl_file_name}}
|
pack .tclscript.fb.read -side left -padx 20 -pady {0 10} -fill x
|
pack .tclscript.fb.read -side left -padx 20 -pady {0 10} -fill x
|
|
|
wm resizable . 0 0
|
|
|
|
No newline at end of file
|
No newline at end of file
|
|
wm resizable . 0 0
|
|
|
No newline at end of file
|
No newline at end of file
|