Error when bootloader is specified but does not exist

The changes to build_api.py make the error happen when running things
like get_config.py
pull/4136/head
Jimmy Brisson 2017-04-07 11:32:42 -05:00
parent bc58c1ba2d
commit 2a84ddd6e4
2 changed files with 5 additions and 1 deletions

View File

@ -145,6 +145,8 @@ def get_config(src_paths, target, toolchain_name):
prev_features = features
toolchain.config.validate_config()
if toolchain.config.has_regions:
_ = list(toolchain.config.regions)
cfg, macros = toolchain.config.get_config_data()
features = toolchain.config.get_features()

View File

@ -17,7 +17,7 @@ limitations under the License.
from copy import deepcopy
import os
from os.path import dirname, abspath
from os.path import dirname, abspath, exists
import sys
from collections import namedtuple
from os.path import splitext
@ -506,6 +506,8 @@ class Config(object):
"build a bootloader project")
if 'target.bootloader_img' in target_overrides:
filename = target_overrides['target.bootloader_img']
if not exists(filename):
raise ConfigException("Bootloader %s not found" % filename)
part = intelhex_offset(filename, offset=rom_start)
if part.minaddr() != rom_start:
raise ConfigException("bootloader executable does not "