Line 26... |
Line 26... |
#
|
#
|
# Author(s):
|
# Author(s):
|
# - Olivier Girard, olgirard@gmail.com
|
# - Olivier Girard, olgirard@gmail.com
|
#
|
#
|
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
# $Rev: 114 $
|
# $Rev: 124 $
|
# $LastChangedBy: olivier.girard $
|
# $LastChangedBy: olivier.girard $
|
# $LastChangedDate: 2011-05-26 22:18:29 +0200 (Thu, 26 May 2011) $
|
# $LastChangedDate: 2011-10-27 09:38:36 +0200 (Thu, 27 Oct 2011) $
|
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
#
|
#
|
# Description: Main utility functions for the openMSP430 serial debug
|
# Description: Main utility functions for the openMSP430 serial debug
|
# interface.
|
# interface.
|
#
|
#
|
Line 455... |
Line 455... |
proc GetCPU_ID { } {
|
proc GetCPU_ID { } {
|
|
|
global omsp_info
|
global omsp_info
|
|
|
# Retreive CPU_ID values
|
# Retreive CPU_ID values
|
regsub {0x} [dbg_uart_rd CPU_ID_LO] {} cpu_id_lo
|
set cpu_id_lo [dbg_uart_rd CPU_ID_LO]
|
regsub {0x} [dbg_uart_rd CPU_ID_HI] {} cpu_id_hi
|
set cpu_id_hi [dbg_uart_rd CPU_ID_HI]
|
|
|
|
# Check if value is valid
|
|
if {[string eq "0x" $cpu_id_lo]} {
|
|
set cpu_id_lo "0x0000"
|
|
}
|
|
if {[string eq "0x" $cpu_id_hi]} {
|
|
set cpu_id_hi "0x0000"
|
|
}
|
|
|
|
# Remove the "0x" prefix
|
|
regsub {0x} $cpu_id_lo {} cpu_id_lo
|
|
regsub {0x} $cpu_id_hi {} cpu_id_hi
|
|
|
set cpu_id "0x$cpu_id_hi$cpu_id_lo"
|
set cpu_id "0x$cpu_id_hi$cpu_id_lo"
|
set cpu_id_lo "0x$cpu_id_lo"
|
set cpu_id_lo "0x$cpu_id_lo"
|
set cpu_id_hi "0x$cpu_id_hi"
|
set cpu_id_hi "0x$cpu_id_hi"
|
|
|
Line 532... |
Line 544... |
($omsp_info(cpu_ver) >2) } {
|
($omsp_info(cpu_ver) >2) } {
|
puts "\n"
|
puts "\n"
|
puts "ERROR: cpu_id not valid: $cpu_id_full"
|
puts "ERROR: cpu_id not valid: $cpu_id_full"
|
puts ""
|
puts ""
|
puts " -------------------------------------------------------------"
|
puts " -------------------------------------------------------------"
|
puts " !!!! Make sure that you are properly connectec to the board !!!!"
|
puts " !!!! Make sure that you are properly connected to the board !!!!"
|
puts " !!!! or try reseting the serial debug interface (or CPU). !!!!"
|
puts " !!!! or try reseting the serial debug interface (or CPU). !!!!"
|
puts " -------------------------------------------------------------"
|
puts " -------------------------------------------------------------"
|
puts ""
|
puts ""
|
set result 0
|
set result 0
|
} else {
|
} else {
|