Пример #1
0
import boxconfig
import toolwrapper
import boxportdistrib

# parse arguments
parser = argparse.ArgumentParser()
parser.add_argument("box_name", help="name of the box to connect to")
parser.add_argument("board_name", help="name of the board to connect to")
args = parser.parse_args()

# argument variables
board_id  = (args.box_name, args.board_name)


# load config
config = boxconfig.BoxConfig()

target_cfg_dict = {"rpi2"     : config.get_boxpath("config/openocd/target/rpi2.cfg"), \
                   "rpi3"     : config.get_boxpath("config/openocd/target/rpi3.cfg"), \
                   "rpi4"     : config.get_boxpath("config/openocd/target/rpi4.cfg"), \
                   "lpc11c24" : "target/lpc11xx.cfg",                                 \
                   "arty_a7_100t" : config.get_boxpath("config/openocd/target/arty-a7-100t_riscv_freedom_e31.cfg"), \
                   "genesys2"     : config.get_boxpath("config/openocd/target/ariane.cfg"), \
                   "hikey620" : "target/hi6220.cfg"}
# TODO: need parameters to allow different config file (in case of different fpga configuration)

interface_cfg_extra_dict = {"rpi2"     : [], \
                            "rpi3"     : [], \
                            "rpi4"     : [], \
                            "lpc11c24" : ["-c", "adapter speed 1000"], \
                            "arty_a7_100t" : ["-c", "adapter speed 500"], \
Пример #2
0
import argparse
import logging

import boxconfig
import boxserver
import boxportdistrib

# parse arguments
parser = argparse.ArgumentParser()
parser.add_argument("-v",
                    "--verbose",
                    help="increase output verbosity",
                    action="store_true")
args = parser.parse_args()

# set log level
if args.verbose:
    logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
else:
    logging.basicConfig(stream=sys.stderr, level=logging.INFO)

# start server
config = boxconfig.BoxConfig(only_active=True)
server = boxserver.BoxServer(config)

try:
    server.start(boxportdistrib.get_port_box_server())
except KeyboardInterrupt:
    logging.info("keyboard interrupt, stopping server")