Line 26... |
Line 26... |
#
|
#
|
# Author(s):
|
# Author(s):
|
# - Olivier Girard, olgirard@gmail.com
|
# - Olivier Girard, olgirard@gmail.com
|
#
|
#
|
#-----------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------
|
# $Rev: 208 $
|
# $Rev: 210 $
|
# $LastChangedBy: olivier.girard $
|
# $LastChangedBy: olivier.girard $
|
# $LastChangedDate: 2015-10-20 22:58:56 +0200 (Tue, 20 Oct 2015) $
|
# $LastChangedDate: 2015-11-17 10:57:08 +0100 (Tue, 17 Nov 2015) $
|
#-----------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------
|
#
|
#
|
# Description: Main utility functions for the openMSP430 serial debug
|
# Description: Main utility functions for the openMSP430 serial debug
|
# interface.
|
# interface.
|
#
|
#
|
Line 189... |
Line 189... |
|
|
# Physical connection is active
|
# Physical connection is active
|
set omsp_info(connected) 1
|
set omsp_info(connected) 1
|
}
|
}
|
|
|
|
|
# Open Connection with the CPU
|
# Open Connection with the CPU
|
if {$omsp_info($CpuNr,connected)==0} {
|
if {$omsp_info($CpuNr,connected)==0} {
|
|
|
# Connect to the CPU
|
# Connect to the CPU
|
if {![${if}::dbg_connect $cpuaddr]} {
|
if {![${if}::dbg_connect $cpuaddr]} {
|
|
utils::uart_close
|
return 0
|
return 0
|
}
|
}
|
|
|
# Make sure the CPU_ID is correct
|
# Make sure the CPU_ID is correct
|
if {![VerifyCPU_ID $CpuNr]} {
|
if {![VerifyCPU_ID $CpuNr]} {
|
|
utils::uart_close
|
return 0
|
return 0
|
}
|
}
|
|
|
# Enable auto-freeze & software breakpoints
|
# Enable auto-freeze & software breakpoints
|
${if}::dbg_wr $cpuaddr CPU_CTL 0x0018
|
${if}::dbg_wr $cpuaddr CPU_CTL 0x0018
|
Line 243... |
Line 244... |
set result [expr $result+[HaltCPU $CpuNr]]
|
set result [expr $result+[HaltCPU $CpuNr]]
|
set result [expr $result+[SetPC $CpuNr $Addr]]
|
set result [expr $result+[SetPC $CpuNr $Addr]]
|
set result [expr $result+[ReleaseCPU $CpuNr]]
|
set result [expr $result+[ReleaseCPU $CpuNr]]
|
}
|
}
|
|
|
|
# Close serial connection
|
|
utils::uart_close
|
|
|
if {$result==3} {
|
if {$result==3} {
|
return 1
|
return 1
|
} else {
|
} else {
|
return 0
|
return 0
|
}
|
}
|