Commit 7e1549fe authored by Reto Da Forno's avatar Reto Da Forno
Browse files

initial

parent 977ed19a
# BOLT
v1.27, compiled intel hex files compatible with the MSP430FR5969 MCU
## Precompiled binaries
There are 6 different configurations:
BOLT_64b_noreset.hex
BOLT_64b_reset.hex
BOLT_128b_noreset.hex
BOLT_128b_reset.hex
BOLT_256b_noreset.hex
BOLT_256b_reset.hex
The different variants have different queue element sizes and behaviours after a reset.
64, 128 or 256 bytes are the options for the size of one element in the BOLT queue. Since the amount of FRAM on BOLT is fixed, a larger element size automatically yields a smaller queue size.
The "noreset" in the name means the BOLT queue is not cleared after an MCU reset and therefore retains the data also in case of a power loss.
In addition, there is also a BOLT deepsleep image, which basically just configures the GPIO pins and then enters LPM4. This image is intended to be used on DPP2 DevBoards in case the BOLT functionality is not needed.
## Flash the image
To upload the hex image to the MCU, connect an MSP-FET debugger and run "./flash.sh [filename]".
You may also need to add the path of the file libmsp430.so to LD_LIBRARY_PATH. This library file is part of several TI packages (e.g. MSP430 Flasher).
## Source code
In case you would like to compile your own binary, the source code of our BOLT implementation is available on Github:
https://github.com/ETHZ-TEC/BOLT
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
:1C44000081000024B113A4000C43B11300001C43B1139E0032D01000FD3F03432B
:04FF8000FFFFFFFF81
:04FF8400FFFFFFFF7D
:08FF8800FFFFFFFFFFFFFFFF79
:02FFCC001444DB
:02FFCE001444D9
:02FFD0001444D7
:02FFD2001444D5
:02FFD4001444D3
:02FFD6001444D1
:02FFD8001444CF
:02FFDA001444CD
:02FFDC001444CB
:02FFDE001444C9
:02FFE0001444C7
:02FFE2001444C5
:02FFE4001444C3
:02FFE6001444C1
:02FFE8001444BF
:02FFEA001444BD
:02FFEC001444BB
:02FFEE001444B9
:02FFF0001444B7
:02FFF2001444B5
:02FFF4001444B3
:02FFF6001444B1
:02FFF8001444AF
:02FFFA001444AD
:02FFFC001444AB
:02FFFE000044BD
:020000040001F9
:20000000B240805A5C01C2430A02C2430C02E2420602C2430202F240FB000402C2431C0208
:20002000C2431A02C2430B02C2430D02C2430702C2430302F2408F000502C2431D02C24370
:200040001B02C2432A02C2432C02C2432602C2432202F240FE002402C2433C02C2433A02EF
:20006000C2432B02C2432D02C2432702C2432302F240F0002502C2433D02C2433B0282432E
:200080002A0382432C0382432203B240FF00240392C3300132D0F0000343FF3F03430343B5
:0800A000FF3F03431C43100164
:00000001FF
#!/usr/bin/env python3
'''
Print the serial output of the CC430 MCU.
last update: 2018-09-24
author: rdaforno
'''
import serial
import sys
import time
import os.path
import serial
import serial.tools.list_ports
from serial.serialutil import SerialException
baudRate = 115200
def getFirstPort(printPorts):
ports = [p for p in serial.tools.list_ports.comports() if "Dual RS232" in p[1]]
if printPorts:
for p in sorted(ports):
print("%s" % p)
if ports is None or len(ports) == 0:
return None
return sorted(ports)[1][0]
def checkSerialPort(serialPort):
try:
ser = serial.Serial(port=serialPort, baudrate=baudRate)
if ser.is_open:
ser.close()
return True
except:
print("can't connect to serial port " + serialPort)
return False
def serial_read(serialPort):
try:
ser = serial.Serial(port=serialPort, baudrate=baudRate, timeout=None)
if ser.isOpen():
print "connected to " + ser.portstr + " (" + str(ser.baudrate) + ")"
ser.setRTS(True) # pull TEST / BSL entry line
ser.setDTR(False) # release reset line
ser.flushInput() # flush input and output buffers
ser.flushOutput()
while True:
if ser.inWaiting() > 0:
line = ser.read(ser.inWaiting())
sys.stdout.write(line)
sys.stdout.flush()
time.sleep(0.01)
except SerialException:
print "device %s unavailable" % serialPort
except ValueError:
print "invalid arguments"
except OSError:
print "device %s not found" % serialPort
except KeyboardInterrupt:
print "aborted"
except:
type, value, tb = sys.exc_info()
print "error: %s (%s)" % (value.message, type)
if ser.isOpen():
ser.close()
if __name__ == "__main__":
if len(sys.argv) > 1 and len(sys.argv[1]) > 3:
# 1st argument is supposed to be the serial port
serialPort = sys.argv[1]
else:
serialPort = getFirstPort(False)
if serialPort is None:
print("no DPP2 DevBoard found")
sys.exit()
if not checkSerialPort(serialPort):
sys.exit()
serial_read(serialPort)
#!/bin/bash
#
# converts an MSP430/MSP432 Intel hex file into a base64 file (required for FlockLab)
if [ $# -lt 1 ];
then
echo "no filename provided"
exit 1
fi
HEXFILE=$1
if [ ! ${HEXFILE: -3} == "hex" ] && [ ! ${HEXFILE: -3} == "HEX" ];
then
echo "not a hex file"
exit 1
fi
# Create ELF file from CCS Intel-HEX output
msp430-objcopy -F elf32-msp430 $HEXFILE ${HEXFILE}.elf
base64 ${HEXFILE}.elf > ${HEXFILE}.elf.b64
echo "file" ${HEXFILE}.elf.b64 "created"
exit 0
#!/usr/bin/env python3
'''
Flash a hex file onto the CC430 MCU via the bootloader.
This routing only works for the DPP2 DevBoard.
The solder jumpers J502/J503 on the back of the DevBoard need to be closed.
The script will automatically pick the first available serial port that is
identified as an FTDI Dual RS232 device.
last update: 2018-07-24
author: rdaforno
'''
import sys
import os.path
import serial
import serial.tools.list_ports
import subprocess
import time
resetAfterProgram = True
def getFirstPort(printPorts):
ports = [p for p in serial.tools.list_ports.comports() if "Dual RS232" in p[1]]
if printPorts:
for p in sorted(ports):
print("%s" % p)
if ports is None or len(ports) == 0:
return None
return sorted(ports)[1][0]
def checkSerialPort(serialPort):
try:
ser = serial.Serial(port=serialPort, baudrate=115200)
if ser.is_open:
ser.close()
return True
except:
print("can't connect to serial port " + serialPort)
return False
def resetMCU(serialPort):
try:
ser = serial.Serial(port=serialPort, baudrate=115200, xonxoff=0, rtscts=0)
if ser.is_open:
ser.setDTR(True) # pull reset line
ser.setRTS(True) # pull TEST / BSL entry line
time.sleep(0.1)
ser.setDTR(False) # release reset line
ser.close()
print("target reset")
except:
print("failed to connect to serial port " + serialPort)
if __name__ == "__main__":
if len(sys.argv) < 2:
print("no filename provided\r\nusage: ./" + os.path.basename(__file__) + " [filename] [port (optional)]")
sys.exit()
fileName = sys.argv[1]
if not os.path.isfile(fileName):
print("file '%s' not found" % fileName)
sys.exit()
if len(sys.argv) > 2:
# 2nd argument is supposed to be the serial port
serialPort = sys.argv[2]
else:
serialPort = getFirstPort(False)
if serialPort is None:
print("no DPP2 DevBoard found")
sys.exit()
if not checkSerialPort(serialPort):
sys.exit()
print("connecting to serial port %s" % serialPort)
subprocess.call(['python', '-m', 'msp430.bsl5.uart', '-p', serialPort, '--invert-reset', '-e', '-S', '-s', '115200' , '-P', fileName])
if resetAfterProgram:
resetMCU(serialPort)
#!/usr/bin/env python3
'''
Flash a hex file onto the MSP432 MCU via the bootloader.
This routing only works for the DPP2 DevBoard.
The solder jumpers J500/J501 on the back of the DevBoard need to be closed.
The script will automatically pick the first available serial port that is
identified as an FTDI Dual RS232 device.
last update: 2018-07-24
author: rdaforno
'''
import sys
import os.path
import serial
import serial.tools.list_ports
import subprocess
import time
resetAfterProgram = True
def getFirstPort(printPorts):
ports = [p for p in serial.tools.list_ports.comports() if "Dual RS232" in p[1]]
if printPorts:
for p in sorted(ports):
print("%s" % p)
if ports is None or len(ports) == 0:
return None
return sorted(ports)[0][0]
def checkSerialPort(serialPort):
try:
ser = serial.Serial(port=serialPort, baudrate=115200)
if ser.is_open:
ser.close()
return True
except:
print("can't connect to serial port " + serialPort)
return False
def resetMCU(serialPort):
try:
ser = serial.Serial(port=serialPort, baudrate=115200, xonxoff=0, rtscts=0)
if ser.is_open:
ser.setDTR(True) # pull reset line
ser.setRTS(True) # pull TEST / BSL entry line
time.sleep(0.1)
ser.setDTR(False) # release reset line
time.sleep(0.1)
ser.close()
print("target reset")
except:
print("failed to connect to serial port " + serialPort)
if __name__ == "__main__":
if len(sys.argv) < 2:
print("no filename provided\r\nusage: ./" + os.path.basename(__file__) + " [filename] [port (optional)]")
sys.exit()
fileName = sys.argv[1]
if not os.path.isfile(fileName):
print("file '%s' not found" % fileName)
sys.exit()
if len(sys.argv) > 2:
# 2nd argument is supposed to be the serial port
serialPort = sys.argv[2]
else:
serialPort = getFirstPort(False)
if serialPort is None:
print("no DPP2 DevBoard found")
sys.exit()
if not checkSerialPort(serialPort):
sys.exit()
print("connecting to serial port %s" % serialPort)
res = subprocess.call(['python', '-m', 'msp430.bsl32.uart', '-p', serialPort, '--invert-reset', '-e', '-V', '-S', '-s', '115200' , '-P', fileName])
if res is not 0:
print("BSL locked?")
if resetAfterProgram:
resetMCU(serialPort)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment