How to use the tockloader.tockloader.TockLoader function in tockloader

To help you get started, we’ve selected a few tockloader examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tock / tockloader / tockloader / main.py View on Github external
def command_unsticky_app (args):
	tock_loader = TockLoader(args)
	tock_loader.open()

	logging.status('Making apps no longer sticky...')
	tock_loader.set_flag(args.name, 'sticky', False)
github tock / tockloader / tockloader / main.py View on Github external
def command_install (args):
	check_and_run_make(args)

	# Load in all TABs
	tabs = collect_tabs(args)

	# Install the apps on the board
	tock_loader = TockLoader(args)
	tock_loader.open()

	# Figure out how we want to do updates
	replace = 'yes'
	if args.no_replace:
		replace = 'no'

	logging.status('Installing app{} on the board...'.format(helpers.plural(len(tabs))))
	tock_loader.install(tabs, replace=replace, erase=args.erase, sticky=args.sticky)
github tock / tockloader / tockloader / main.py View on Github external
def command_set_attribute (args):
	tock_loader = TockLoader(args)
	tock_loader.open()

	logging.status('Setting attribute...')
	tock_loader.set_attribute(args.key, args.value)
github tock / tockloader / tockloader / main.py View on Github external
def command_list_attributes (args):
	tock_loader = TockLoader(args)
	tock_loader.open()

	logging.status('Listing attributes...')
	tock_loader.list_attributes()
github tock / tockloader / tockloader / main.py View on Github external
def command_erase_apps (args):
	tock_loader = TockLoader(args)
	tock_loader.open()

	logging.status('Removing apps...')
	tock_loader.erase_apps()
github tock / tockloader / tockloader / main.py View on Github external
def command_sticky_app (args):
	tock_loader = TockLoader(args)
	tock_loader.open()

	logging.status('Making apps sticky...')
	tock_loader.set_flag(args.name, 'sticky', True)
github tock / tockloader / tockloader / main.py View on Github external
def command_dump_flash_page (args):
	tock_loader = TockLoader(args)
	tock_loader.open()

	logging.status('Getting page of flash...')
	tock_loader.dump_flash_page(args.page)
github tock / tockloader / tockloader / main.py View on Github external
def command_enable_app (args):
	tock_loader = TockLoader(args)
	tock_loader.open()

	logging.status('Enabling apps...')
	tock_loader.set_flag(args.name, 'enable', True)
github tock / tockloader / tockloader / main.py View on Github external
def command_remove_attribute (args):
	tock_loader = TockLoader(args)
	tock_loader.open()

	logging.status('Removing attribute...')
	tock_loader.remove_attribute(args.key)
github tock / tockloader / tockloader / main.py View on Github external
binary = bytes()
	count = 0
	for binary_name in args.binary:
		# check that file isn't a `.hex` file
		if binary_name.endswith('.hex'):
			exception_string = 'Error: Cannot flash ".hex" files.'
			exception_string += ' Likely you meant to use a ".bin" file but used an intel hex file by accident.'
			raise TockLoaderException(exception_string)

		# add contents to binary
		with open(binary_name, 'rb') as f:
			binary += f.read()
		count += 1

	# Flash the binary to the chip
	tock_loader = TockLoader(args)
	tock_loader.open()

	plural = 'y'
	if count > 1:
		plural = 'ies'
	logging.status('Flashing binar{} to board...'.format(plural))
	tock_loader.flash_binary(binary, args.address)