Skip to content
Closed
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
4 changes: 3 additions & 1 deletion libs/rtemodel/src/RteProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,9 @@ void RteProject::CollectSettings(const string& targetName)
t->AddDeviceProperties(d, processorName);
// add dbgconf file
auto debugVars = t->GetDeviceDebugVars();
AddFileInstance(nullptr, debugVars, 0, t);
if (debugVars && debugVars->HasAttribute("configfile")) {
AddFileInstance(nullptr, debugVars, 0, t);
}

// collect copied files and sources
for (auto [_,fi] : m_files) {
Expand Down
2 changes: 1 addition & 1 deletion test/packs/ARM/RteTest_DFP/0.1.1/ARM.RteTest_DFP.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
RteTest ARM M Device Family
</description>
<algorithm name="Device/ARM/Flash/FAMILY.FLM" start="0x00000000" size="0x00040000" default="1"/>
<debugvars configfile="Device/ARM/Debug/ARMCM.dbgconf">
<debugvars>
__var DbgMCU_CR = 0x00000007; // DBGMCU_CR: DBG_SLEEP, DBG_STOP, DBG_STANDBY
__var TraceClk_Pin = 0x00040002; // PE2
__var TraceD0_Pin = 0x00040003; // PE3
Expand Down
4 changes: 3 additions & 1 deletion tools/projmgr/src/ProjMgrCbuildRun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ void ProjMgrCbuildRun::SetDebuggerNode(YAML::Node node, const DebuggerType& debu
if (debugger.clock.has_value()) {
node[YAML_CLOCK] = debugger.clock.value();
}
SetNodeValue(node[YAML_DBGCONF], FormatPath(debugger.dbgconf, m_directory));
if (!debugger.dbgconf.empty()) {
SetNodeValue(node[YAML_DBGCONF], FormatPath(debugger.dbgconf, m_directory));
}
SetNodeValue(node[YAML_START_PNAME], debugger.startPname);
SetGdbServerNode(node[YAML_GDBSERVER], debugger.gdbserver);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ build:
device-books:
- name: http://infocenter.arm.com/help/topic/com.arm.doc.dui0497a/index.html
title: Cortex-M0 Device Generic Users Guide
dbgconf:
- file: ../../data/TestDefault/.cmsis/empty+TEST_TARGET.dbgconf
version: 0.0.0
processor:
fpu: off
core: Cortex-M0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ build:
device-books:
- name: http://infocenter.arm.com/help/topic/com.arm.doc.dui0497a/index.html
title: Cortex-M0 Device Generic Users Guide
dbgconf:
- file: ../../data/TestDefault/.cmsis/empty+TEST_TARGET.dbgconf
version: 0.0.0
processor:
fpu: off
core: Cortex-M0
Expand Down
19 changes: 19 additions & 0 deletions tools/projmgr/test/data/TestRunDebug/no-dbgconf.csolution.yml
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:

compiler: AC6

target-types:
- type: ARMCM3
device: RteTest_ARMCM3
target-set:
- set:
images:
- project-context: run-debug

projects:
- project: run-debug.cproject.yml

packs:
- pack: ARM::RteTest_DFP@0.1.1
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ build:
device-books:
- name: http://infocenter.arm.com/help/topic/com.arm.doc.dui0552a/index.html
title: Cortex-M3 Device Generic Users Guide
dbgconf:
- file: ../data/TestSolution/PackMetadata/.cmsis/metadata+RteTest_ARMCM3.dbgconf
version: 0.0.0
processor:
fpu: off
core: Cortex-M3
Expand Down
17 changes: 17 additions & 0 deletions tools/projmgr/test/src/ProjMgrUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6721,6 +6721,23 @@ TEST_F(ProjMgrUnitTests, TestRunDebug) {
testinput_folder + "/TestRunDebug/ref/run-debug+TestHW2.cbuild.yml");
}

TEST_F(ProjMgrUnitTests, TestNoDbgconf) {
char* argv[7];
const string& csolution = testinput_folder + "/TestRunDebug/no-dbgconf.csolution.yml";
argv[1] = (char*)"convert";
argv[2] = (char*)csolution.c_str();
argv[3] = (char*)"-o";
argv[4] = (char*)testoutput_folder.c_str();
argv[5] = (char*)"--active";
argv[6] = (char*)"ARMCM3";
EXPECT_EQ(0, RunProjMgr(7, argv, m_envp));

const YAML::Node& cbuild = YAML::LoadFile(testoutput_folder + "/run-debug+ARMCM3.cbuild.yml");
EXPECT_FALSE(cbuild["build"]["dbgconf"].IsDefined());
const YAML::Node& cbuildrun = YAML::LoadFile(testoutput_folder + "/no-dbgconf+ARMCM3.cbuild-run.yml");
EXPECT_FALSE(cbuildrun["cbuild-run"]["debugger"]["dbgconf"].IsDefined());
}

TEST_F(ProjMgrUnitTests, TestRunDebugMulticore) {
char* argv[7];
const string& csolution = testinput_folder + "/TestRunDebug/run-debug.csolution.yml";
Expand Down
Loading