Skip to content
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/projmgr/include/ProjMgrParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ struct DebuggerItem {
* type specifies an explicit file type
* load mode
* load offset
* processor name associated with specified image
*/
struct ImageItem {
std::string context;
Expand All @@ -174,6 +175,7 @@ struct ImageItem {
std::string type;
std::string load;
std::string offset;
std::string pname;
};

/**
Expand Down
13 changes: 10 additions & 3 deletions tools/projmgr/schemas/common.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,13 @@
"title": "device:\nDocumentation: https://open-cmsis-pack.github.io/cmsis-toolbox/YML-Input-Format/#device",
"type": "string",
"pattern": "^(([ -9;-~]+::)?[ -9;-~]+)?(:[ -9;-~]+)?$",
"description": "Unique device name. Overrules default board device setting.\nA unique processor ID is reqiured for devices with multiple processors.\nExample: STMicroelectronics::STM32H735IGK"
"description": "Unique device name. Overrules default board device setting.\nA unique processor ID is required for devices with multiple processors.\nExample: STMicroelectronics::STM32H735IGK"
},
"ProcessorNameType": {
"title": "device:\nDocumentation: https://open-cmsis-pack.github.io/cmsis-toolbox/YML-Input-Format/#device",
"type": "string",
"pattern": "^:[ -9;-~]+$",
"description": "Unique processor ID.\nFormat :pname (see device name convention).\nExample: :cm0plus"
},
"BoardType": {
"title": "board:\nDocumentation: https://open-cmsis-pack.github.io/cmsis-toolbox/YML-Input-Format/#board",
Expand Down Expand Up @@ -2367,11 +2373,12 @@
"info": { "type": "string", "description": "Brief description of the image file." },
"type": { "enum": [ "elf", "hex", "bin", "lib" ], "description": "Specifies an explicit image type." },
"load": { "$ref": "#/definitions/TargetSetLoadType" },
"load-offset": { "type": "number", "description": "Offset applied to the binary content when loading the image file." }
"load-offset": { "type": "number", "description": "Offset applied to the binary content when loading the image file." },
"device": { "$ref": "#/definitions/ProcessorNameType" }
},
"additionalProperties": false,
"oneOf": [
{ "required": ["project-context"], "not": {"required": ["image", "type"]} },
{ "required": ["project-context"], "not": {"required": ["image", "type", "device"]} },
{ "required": ["image"], "not": {"required": ["project-context"]} }
]
},
Expand Down
2 changes: 1 addition & 1 deletion tools/projmgr/src/ProjMgrRunDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ bool ProjMgrRunDebug::CollectSettings(const vector<ContextItem*>& contexts, cons
item.load = item.type == RteConstants::OUTPUT_TYPE_ELF ? LOAD_IMAGE_SYMBOLS :
item.type == RteConstants::OUTPUT_TYPE_LIB ? LOAD_NONE : LOAD_IMAGE;
}
m_runDebug.outputs.push_back({ item.image, item.info, item.type, item.load, item.offset });
m_runDebug.outputs.push_back({ item.image, item.info, item.type, item.load, item.offset, item.pname });
}

// debug vars
Expand Down
2 changes: 1 addition & 1 deletion tools/projmgr/src/ProjMgrWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ bool ProjMgrWorker::ProcessDevice(ContextItem& context, BoardOrDevice process) {
if (!deviceItem.pname.empty()) {
ProjMgrLogger::Get().Error("processor name '" + deviceItem.pname + "' was not found", context.name);
return false;
} else if (!HasVarDefineError() && process != BoardOrDevice::SkipProcessor) {
} else if (!HasVarDefineError() && process != BoardOrDevice::SkipProcessor && !context.imageOnly) {
string msg = "one of the following processors must be specified:";
const auto& processors = matchedDevice->GetProcessors();
for (const auto& p : processors) {
Expand Down
2 changes: 2 additions & 0 deletions tools/projmgr/src/ProjMgrYamlParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,8 @@ void ProjMgrYamlParser::ParseImages(const YAML::Node& parent, const string& file
ParseString(imagesEntry, YAML_INFO, imageItem.info);
ParseString(imagesEntry, YAML_TYPE, imageItem.type);
ParseString(imagesEntry, YAML_LOAD, imageItem.load);
ParseString(imagesEntry, YAML_DEVICE, imageItem.pname);
imageItem.pname = RteUtils::ExtractSuffix(imageItem.pname);
ParseNumber(imagesEntry, file, YAML_LOAD_OFFSET, imageItem.offset);
images.push_back(imageItem);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/schemas/csolution.schema.json

solution:

packs:
- pack: ARM::RteTest_DFP

target-types:
- type: CM0
device: RteTest_ARMCM0_Dual
target-set:
- set:
debugger:
name: CMSIS-DAP
images:
- image: ./images/image1.elf
device: :cm0_core0
- image: ./images/image2.elf
device: :cm0_core1
14 changes: 14 additions & 0 deletions tools/projmgr/test/src/ProjMgrUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7093,6 +7093,20 @@ TEST_F(ProjMgrUnitTests, ImageOnly) {
testinput_folder + "/ImageOnly/ref/image-only+CM0.cbuild-run.yml");
}

TEST_F(ProjMgrUnitTests, ImageOnlyMulticore) {
char* argv[5];
const string& csolution = testinput_folder + "/ImageOnly/image-only-multicore.csolution.yml";
argv[1] = (char*)"convert";
argv[2] = (char*)csolution.c_str();
argv[3] = (char*)"--active";
argv[4] = (char*)"CM0";
EXPECT_EQ(0, RunProjMgr(5, argv, m_envp));

const YAML::Node& cbuildRun = YAML::LoadFile(testinput_folder + "/ImageOnly/out/image-only-multicore+CM0.cbuild-run.yml");
EXPECT_EQ("cm0_core0", cbuildRun["cbuild-run"]["output"][0]["pname"].as<string>());
EXPECT_EQ("cm0_core1", cbuildRun["cbuild-run"]["output"][1]["pname"].as<string>());
}

TEST_F(ProjMgrUnitTests, ListDebuggers) {
char* argv[6];
StdStreamRedirect streamRedirect;
Expand Down
Loading