Skip to content

Error when bootloader is specified but does not exist #4136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tools/build_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 3 additions & 1 deletion tools/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

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
Expand Down Expand Up @@ -506,6 +506,8 @@ def regions(self):
"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 "
Expand Down
7 changes: 7 additions & 0 deletions tools/test/config_test/test29/mbed_app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"target_overrides": {
"K64F": {
"target.bootloader_img": "does_not_exists.bin"
}
}
}
6 changes: 6 additions & 0 deletions tools/test/config_test/test29/test_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
expected_results = {
"K64F": {
"desc": "error when bootloader not found",
"exception_msg": "not found"
}
}