How to use the tockloader.helpers.ListToDictAction 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
help='The JLink speed to pass to JLinkExe.')
	parent_channel.add_argument('--jlink-if',
		help='The interface type to pass to JLinkExe.')
	parent_channel.add_argument('--openocd-board',
		help='The cfg file in OpenOCD `board` folder.')
	parent_channel.add_argument('--openocd-cmd',
		default='openocd',
		help='The openocd binary to invoke.')
	parent_channel.add_argument('--openocd-options',
		default=[],
		help='Tockloader-specific flags to direct how Tockloader uses OpenOCD.',
		nargs='*')
	parent_channel.add_argument('--openocd-commands',
		default={},
		type=lambda kv: kv.split('=', 1),
		action=helpers.ListToDictAction,
		help='Directly specify which OpenOCD commands to use for "program", "read", or "erase" actions. Example: "program=flash write_image erase {{binary}} {address:#x};verify_image {{binary}} {address:#x};"',
		nargs='*')
	parent_channel.add_argument('--board',
		default=None,
		help='Explicitly specify the board that is being targeted.')
	parent_channel.add_argument('--arch',
		default=None,
		help='Explicitly specify the architecture of the board that is being targeted.')
	parent_channel.add_argument('--page-size',
		default=0,
		type=int,
		help='Explicitly specify how many bytes in a flash page.')
	parent_channel.add_argument('--baud-rate',
		default=115200,
		type=int,
		help='If using serial, set the target baud rate.')