def flash(action, ctx, args): """ Run esptool to flash the entire project, from an argfile generated by the build system """ ensure_build_directory(args, ctx.info_name) esp_port = args.port or _get_default_serial_port(args) run_target(action, args, {'ESPBAUD': str(args.baud),'ESPPORT': esp_port})
def build_target(target_name, ctx, args): """ Execute the target build system to build target 'target_name' Calls ensure_build_directory() which will run cmake to generate a build directory (with the specified generator) as needed. """ ensure_build_directory(args, ctx.info_name) run_target(target_name, args)
def flash(action, ctx, args): """ Run esptool to flash the entire project, from an argfile generated by the build system """ if args.port is None: args.port = _get_default_serial_port() run_target(action, args, {"ESPPORT": args.port, "ESPBAUD": str(args.baud)})
def build_target(target_name: str, ctx: Context, args: PropertyDict) -> None: """ Execute the target build system to build target 'target_name' Calls ensure_build_directory() which will run cmake to generate a build directory (with the specified generator) as needed. """ hints = not args.no_hints ensure_build_directory(args, ctx.info_name) run_target(target_name, args, force_progression=GENERATORS[args.generator].get('force_progression', False), hints=hints)
def dfu_flash_target(target_name, ctx, args, path): ensure_build_directory(args, ctx.info_name) try: run_target(target_name, args, {"ESP_DFU_PATH": path}) except FatalError: # Cannot capture the error from dfu-util here so the best advise is: print('Please have a look at the "Device Firmware Upgrade through USB" chapter in API Guides of the ' 'ESP-IDF documentation for solving common dfu-util issues.') raise
def flash(action, ctx, args): """ Run esptool to flash the entire project, from an argfile generated by the build system """ ensure_build_directory(args, ctx.info_name) project_desc = _get_project_desc(ctx, args) if project_desc['target'] == 'linux': yellow_print('skipping flash since running on linux...') return esp_port = args.port or _get_default_serial_port(args) run_target(action, args, {'ESPBAUD': str(args.baud), 'ESPPORT': esp_port})
def size_target(target_name, ctx, args): """ Builds the app and then executes a size-related target passed in 'target_name'. `tool_error_handler` handler is used to suppress errors during the build, so size action can run even in case of overflow. """ def tool_error_handler(e): pass ensure_build_directory(args, ctx.info_name) run_target('all', args, custom_error_handler=tool_error_handler) run_target(target_name, args)
def ota_targets(target_name, ctx, args): """ Execute the target build system to build target 'target_name'. Additionally set global variables for baud and port. Calls ensure_build_directory() which will run cmake to generate a build directory (with the specified generator) as needed. """ args.port = args.port or _get_default_serial_port(args) ensure_build_directory(args, ctx.info_name) run_target(target_name, args, { 'ESPBAUD': str(args.baud), 'ESPPORT': args.port })
def fallback_target(target_name, ctx, args): """ Execute targets that are not explicitly known to idf.py """ ensure_build_directory(args, ctx.info_name) try: subprocess.check_output(GENERATORS[args.generator]["dry_run"] + [target_name], cwd=args.build_dir) except Exception: raise FatalError( 'command "%s" is not known to idf.py and is not a %s target' % (target_name, args.generator)) run_target(target_name, args)
def size_target(target_name: str, ctx: Context, args: PropertyDict) -> None: """ Builds the app and then executes a size-related target passed in 'target_name'. `tool_error_handler` handler is used to suppress errors during the build, so size action can run even in case of overflow. """ def tool_error_handler(e: int, stdout: str, stderr: str) -> None: print_hints(stdout, stderr) hints = not args.no_hints ensure_build_directory(args, ctx.info_name) run_target('all', args, force_progression=GENERATORS[args.generator].get('force_progression', False), custom_error_handler=tool_error_handler, hints=hints) run_target(target_name, args)
def fallback_target(target_name: str, ctx: Context, args: PropertyDict) -> None: """ Execute targets that are not explicitly known to idf.py """ ensure_build_directory(args, ctx.info_name) try: subprocess.check_output(GENERATORS[args.generator]['dry_run'] + [target_name], cwd=args.build_dir) except Exception: if target_name in ['clang-check', 'clang-html-report']: raise FatalError('command "{}" requires an additional plugin "pyclang". ' 'Please install it via "pip install --upgrade pyclang"'.format(target_name)) raise FatalError( 'command "%s" is not known to idf.py and is not a %s target' % (target_name, args.generator)) run_target(target_name, args)
def dfu_target(target_name, ctx, args): ensure_build_directory(args, ctx.info_name) run_target(target_name, args)
def dfu_list_target(target_name: str, ctx: Context, args: PropertyDict) -> None: ensure_build_directory(args, ctx.info_name) run_target(target_name, args)
def dfu_target(target_name: str, ctx: Context, args: PropertyDict, part_size: str) -> None: ensure_build_directory(args, ctx.info_name) run_target(target_name, args, {'ESP_DFU_PART_SIZE': part_size} if part_size else {})
def dfu_target(target_name, ctx, args, part_size): ensure_build_directory(args, ctx.info_name) run_target(target_name, args, {'ESP_DFU_PART_SIZE': part_size} if part_size else {})