OpenCores
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/bin
    from Rev 75 to Rev 77
    Reverse comparison

Rev 75 → Rev 77

/openmsp430-minidebug.tcl
136,7 → 136,23
 
# Generate binary file
set bin_file "[clock clicks].bin"
catch {exec msp430-objcopy -O binary $elf_file_name $bin_file}
if {[catch {exec msp430-objcopy -O binary $elf_file_name $bin_file} errMsg]} {
.load.fb.l configure -text "$errMsg" -fg red
return 0
}
# Wait until bin file is present on the filesystem
set timeout 100
for {set i 0} {$i <= $timeout} {incr i} {
after 500
if {[file exists $bin_file]} {
break
}
}
if {$i>=$timeout} {
.load.fb.l configure -text "Timeout: ELF to BIN file conversion problem with \"msp430-objcopy\" executable" -fg red
return 0
}
 
# Read file
set fp [open $bin_file r]
152,6 → 168,13
set byte_size [expr $hex_size/2]
set word_size [expr $byte_size/2]
 
# Make sure ELF program size is the same as the available program memory
set sizes [GetCPU_ID_SIZE]
if {[lindex $sizes 0] != [expr $hex_size/2]} {
.load.fb.l configure -text "ERROR: ELF program size ([expr $hex_size/2] B) is different than the available program memory ([lindex $sizes 0] B)" -fg red
return 0
}
 
# Format data
for {set i 0} {$i < $hex_size} {set i [expr $i+4]} {
set hex_msb "[string index $hex_data [expr $i+2]][string index $hex_data [expr $i+3]]"
174,7 → 197,7
# Check Data
.load.fb.l configure -text "Verify..." -fg yellow
update
if {[VerifyMem $StartAddr $DataArray]} {
if {[VerifyMem $StartAddr $DataArray 1]} {
.load.fb.l configure -text "Done" -fg green
} else {
.load.fb.l configure -text "ERROR" -fg red
/openmsp430-loader.tcl
100,8 → 100,25
###############################################################################
 
# Generate binary file
catch {exec msp430-objcopy -O binary $elf_file $bin_file}
if {[catch {exec msp430-objcopy -O binary $elf_file $bin_file} errMsg]} {
puts $errMsg
exit 1
}
 
# Wait until bin file is present on the filesystem
set timeout 100
for {set i 0} {$i <= $timeout} {incr i} {
after 500
if {[file exists $bin_file]} {
break
}
}
if {$i>=$timeout} {
puts "Timeout: ELF to BIN file conversion problem with \"msp430-objcopy\" executable"
puts "$errMsg"
exit 1
}
 
# Read file
set fp [open $bin_file r]
fconfigure $fp -translation binary
146,6 → 163,12
puts "Connected: target device has [lindex $sizes 0]B Program Memory and [lindex $sizes 1]B Data Memory"
puts ""
 
# 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)"
exit 1
}
 
# Load Program Memory
set StartAddr [format "0x%04x" [expr 0x10000-$byte_size]]
puts -nonewline "Load Program Memory... "
156,7 → 179,7
# Check Data
puts -nonewline "Verify Program Memory... "
flush stdout
if {[VerifyMem $StartAddr $DataArray]} {
if {[VerifyMem $StartAddr $DataArray 1]} {
puts "done"
} else {
puts "ERROR"

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.