diff --git a/tools/projmgr/include/ProjMgrWorker.h b/tools/projmgr/include/ProjMgrWorker.h index ad55896c8..28ad6ce8b 100644 --- a/tools/projmgr/include/ProjMgrWorker.h +++ b/tools/projmgr/include/ProjMgrWorker.h @@ -425,7 +425,7 @@ struct DebuggerType { * images * selected target-set * load offset for generated binary - * load modes + * elf load mode * image only flag */ struct ContextItem { @@ -494,7 +494,7 @@ struct ContextItem { std::vector images; std::string targetSet; std::string loadOffset; - StrMap loadMode; + std::string elfLoadMode; bool imageOnly = false; }; diff --git a/tools/projmgr/schemas/common.schema.json b/tools/projmgr/schemas/common.schema.json index f3be3cd02..bc6b88b54 100644 --- a/tools/projmgr/schemas/common.schema.json +++ b/tools/projmgr/schemas/common.schema.json @@ -2371,7 +2371,7 @@ }, "additionalProperties": false, "oneOf": [ - { "required": ["project-context"], "not": {"required": ["image"]} }, + { "required": ["project-context"], "not": {"required": ["image", "type"]} }, { "required": ["image"], "not": {"required": ["project-context"]} } ] }, diff --git a/tools/projmgr/src/ProjMgrRunDebug.cpp b/tools/projmgr/src/ProjMgrRunDebug.cpp index d1124d2b3..7d10bd842 100644 --- a/tools/projmgr/src/ProjMgrRunDebug.cpp +++ b/tools/projmgr/src/ProjMgrRunDebug.cpp @@ -540,8 +540,7 @@ void ProjMgrRunDebug::AddGeneratedImage(const ContextItem* context, const string image.file = file; image.info = "generate by " + context->name; image.type = type; - image.load = context->loadMode.find(type) != context->loadMode.end() ? context->loadMode.at(type) : - context->loadMode.find("") != context->loadMode.end() ? context->loadMode.at("") : load; + image.load = type == RteConstants::OUTPUT_TYPE_ELF && !context->elfLoadMode.empty() ? context->elfLoadMode : load; image.pname = context->deviceItem.pname; image.offset = type == RteConstants::OUTPUT_TYPE_BIN ? context->loadOffset : RteUtils::EMPTY_STRING; m_runDebug.outputs.push_back(image); diff --git a/tools/projmgr/src/ProjMgrWorker.cpp b/tools/projmgr/src/ProjMgrWorker.cpp index d3ca62e46..2f495b6b3 100644 --- a/tools/projmgr/src/ProjMgrWorker.cpp +++ b/tools/projmgr/src/ProjMgrWorker.cpp @@ -2595,7 +2595,7 @@ bool ProjMgrWorker::ProcessImages(ContextItem& context) { else if (item.context == context.cproject->name + (context.type.build.empty() ? "" : '.' + context.type.build)) { context.loadOffset = item.offset; if (!item.load.empty()) { - context.loadMode[item.type] = item.load; + context.elfLoadMode = item.load; } } } diff --git a/tools/projmgr/test/data/TestRunDebug/core1.cproject.yml b/tools/projmgr/test/data/TestRunDebug/core1.cproject.yml index eadfa9108..4a7879550 100644 --- a/tools/projmgr/test/data/TestRunDebug/core1.cproject.yml +++ b/tools/projmgr/test/data/TestRunDebug/core1.cproject.yml @@ -5,4 +5,4 @@ project: device: :cm0_core1 output: - type: [elf, bin] + type: [hex, bin] diff --git a/tools/projmgr/test/data/TestRunDebug/ref/run-debug+TestHW3.cbuild-run.yml b/tools/projmgr/test/data/TestRunDebug/ref/run-debug+TestHW3.cbuild-run.yml index d3758fd19..f36cf8cbb 100644 --- a/tools/projmgr/test/data/TestRunDebug/ref/run-debug+TestHW3.cbuild-run.yml +++ b/tools/projmgr/test/data/TestRunDebug/ref/run-debug+TestHW3.cbuild-run.yml @@ -15,12 +15,17 @@ cbuild-run: - file: core1/TestHW3/core1.axf info: generate by core1+TestHW3 type: elf - load: none + load: symbols + pname: cm0_core1 + - file: core1/TestHW3/core1.hex + info: generate by core1+TestHW3 + type: hex + load: image pname: cm0_core1 - file: core1/TestHW3/core1.bin info: generate by core1+TestHW3 type: bin - load: image + load: none pname: cm0_core1 system-resources: memory: diff --git a/tools/projmgr/test/data/TestRunDebug/run-debug.csolution.yml b/tools/projmgr/test/data/TestRunDebug/run-debug.csolution.yml index 72419cf02..92de33296 100644 --- a/tools/projmgr/test/data/TestRunDebug/run-debug.csolution.yml +++ b/tools/projmgr/test/data/TestRunDebug/run-debug.csolution.yml @@ -46,11 +46,7 @@ solution: - project-context: core0 load: none - project-context: core1 - type: elf - load: none - - project-context: core1 - type: bin - load: image + load: symbols debugger: name: CMSIS-DAP start-pname: cm0_core1