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: 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 @@ -34,7 +34,7 @@
__var TraceD1_Pin = 0x00040004; // PE4
</debugvars>

<sequences>
<sequences traceSetup="full">
<!-- Override for Pre-Defined Sequences -->
<sequence name="DebugDeviceUnlock">
<block>
Expand Down
1 change: 1 addition & 0 deletions test/packs/ARM/RteTest_DFP/0.2.0/ARM.RteTest_DFP.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
<processor Dcore="Cortex-M4" DcoreVersion="r0p1" Dmpu="MPU" Dendian="Configurable" Dclock="10000000"/>
<compile header="Device/ARM/ARMCM4/Include/ARMCM4.h" define="ARMCM4"/>
<algorithm name="Device/ARM/Flash/CortexM4Device.FLM" start="0x00000000" size="0x00040000" default="1"/>
<sequences traceSetup="full"/>

<variant Dvariant="RteTest_ARMCM4_NOFP">
<processor Dfpu="NO_FPU"/>
Expand Down
8 changes: 8 additions & 0 deletions tools/projmgr/include/ProjMgrRunDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ struct DebugSequencesType {
std::string pname;
};

/**
* @brief debug sequences configuration type
*/
struct DebugSequencesConfType {
std::string traceSetup;
};

/**
* @brief debug vars type
*/
Expand Down Expand Up @@ -223,6 +230,7 @@ struct RunDebugType {
SystemResourcesType systemResources;
DebuggerType debugger;
DebugVarsType debugVars;
DebugSequencesConfType debugSequencesConf;
std::vector<DebugSequencesType> debugSequences;
DebugTopologyType debugTopology;
};
Expand Down
2 changes: 2 additions & 0 deletions tools/projmgr/include/ProjMgrYamlParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ static constexpr const char* YAML_CREATED_FOR = "created-for";
static constexpr const char* YAML_DATAPATCH = "datapatch";
static constexpr const char* YAML_DEBUG = "debug";
static constexpr const char* YAML_DEBUG_ADAPTERS = "debug-adapters";
static constexpr const char* YAML_DEBUG_SEQUENCES_CONF = "debug-sequences-conf";
static constexpr const char* YAML_DEBUG_SEQUENCES = "debug-sequences";
static constexpr const char* YAML_DEBUG_VARS = "debug-vars";
static constexpr const char* YAML_DEBUG_TOPOLOGY = "debug-topology";
Expand Down Expand Up @@ -271,6 +272,7 @@ static constexpr const char* YAML_TARGETTYPE = "target-type";
static constexpr const char* YAML_TARGETTYPES = "target-types";
static constexpr const char* YAML_TEMPLATE = "template";
static constexpr const char* YAML_TELNET = "telnet";
static constexpr const char* YAML_TRACE_SETUP = "trace-setup";
static constexpr const char* YAML_TIMEOUT = "timeout";
static constexpr const char* YAML_TRUSTZONE = "trustzone";
static constexpr const char* YAML_TITLE = "title";
Expand Down
50 changes: 30 additions & 20 deletions tools/projmgr/schemas/common.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2230,6 +2230,15 @@
"additionalProperties": false,
"required": ["name"]
},
"DebugSequencesConfType": {
"title": "debug-sequences-conf:\nDocumentation: https://open-cmsis-pack.github.io/cmsis-toolbox/YML-CBuild-Format/#debug-sequences-conf",
"description": "Debug sequence configuration.",
"type": "object",
"properties": {
"trace-setup": { "enum": ["legacy", "full"], "description": "Trace setup mode. If full, all trace sink and trace data path setup is done by debug access sequences; default is legacy." }
},
"additionalProperties": false
},
"DebugBlocksType": {
"type": "array",
"uniqueItems": false,
Expand Down Expand Up @@ -2511,26 +2520,27 @@
"description": "This section describes generated contents",
"type": "object",
"properties": {
"generated-by": { "type": "string", "description": "Tool name that generated this file." },
"solution": { "type": "string", "description": "Name of the `*.csolution.yml` file." },
"target-type": { "type": "string", "description": "Name of the target-type that was selected." },
"target-set": { "type": "string", "description": "Name of the target-set that was selected." },
"compiler": { "type": "string", "description": "Compiler toolchain used for code generation." },
"board": { "$ref": "#/definitions/BoardType" },
"board-pack": { "$ref": "#/definitions/PackID" },
"board-pack-path": { "type": "string", "description": "Local path to the board pack." },
"device": { "$ref": "#/definitions/DeviceType" },
"device-pack": { "$ref": "#/definitions/PackID" },
"device-pack-path": { "type": "string", "description": "Local path to the device pack." },
"output": { "$ref": "#/definitions/RunOutputFilesType" },
"system-resources": { "$ref": "#/definitions/SystemResourcesType" },
"system-descriptions": { "$ref": "#/definitions/RunSystemFilesType" },
"debugger": { "$ref": "#/definitions/DebuggerType" },
"debug-vars": { "$ref": "#/definitions/DebugVarsType" },
"debug-sequences": { "$ref": "#/definitions/DebugSequencesType" },
"programming": { "$ref": "#/definitions/ProgrammingType" },
"flash-info": { "$ref": "#/definitions/FlashInfoType" },
"debug-topology": { "$ref": "#/definitions/DebugTopologyType" }
"generated-by": { "type": "string", "description": "Tool name that generated this file." },
"solution": { "type": "string", "description": "Name of the `*.csolution.yml` file." },
"target-type": { "type": "string", "description": "Name of the target-type that was selected." },
"target-set": { "type": "string", "description": "Name of the target-set that was selected." },
"compiler": { "type": "string", "description": "Compiler toolchain used for code generation." },
"board": { "$ref": "#/definitions/BoardType" },
"board-pack": { "$ref": "#/definitions/PackID" },
"board-pack-path": { "type": "string", "description": "Local path to the board pack." },
"device": { "$ref": "#/definitions/DeviceType" },
"device-pack": { "$ref": "#/definitions/PackID" },
"device-pack-path": { "type": "string", "description": "Local path to the device pack." },
"output": { "$ref": "#/definitions/RunOutputFilesType" },
"system-resources": { "$ref": "#/definitions/SystemResourcesType" },
"system-descriptions": { "$ref": "#/definitions/RunSystemFilesType" },
"debugger": { "$ref": "#/definitions/DebuggerType" },
"debug-vars": { "$ref": "#/definitions/DebugVarsType" },
"debug-sequences-conf": { "$ref": "#/definitions/DebugSequencesConfType" },
"debug-sequences": { "$ref": "#/definitions/DebugSequencesType" },
"programming": { "$ref": "#/definitions/ProgrammingType" },
"flash-info": { "$ref": "#/definitions/FlashInfoType" },
"debug-topology": { "$ref": "#/definitions/DebugTopologyType" }
},
"additionalProperties": false,
"required": ["generated-by", "output", "debugger"]
Expand Down
6 changes: 6 additions & 0 deletions tools/projmgr/src/ProjMgrCbuildRun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ProjMgrCbuildRun : public ProjMgrCbuildBase {
void SetDebuggerNode(YAML::Node node, const DebuggerType& debugger);
void SetDeviceSettingsNode(YAML::Node node, const std::map<std::string, std::string>& deviceSettings);
void SetDebugVarsNode(YAML::Node node, const DebugVarsType& debugVars);
void SetDebugSequencesConfNode(YAML::Node node, const DebugSequencesConfType& sequenceConf);
void SetDebugSequencesNode(YAML::Node node, const std::vector<DebugSequencesType>& algorithms);
void SetDebugSequencesBlockNode(YAML::Node node, const std::vector<DebugSequencesBlockType>& blocks);
void SetDebugTopologyNode(YAML::Node node, const DebugTopologyType& topology);
Expand Down Expand Up @@ -62,6 +63,7 @@ ProjMgrCbuildRun::ProjMgrCbuildRun(YAML::Node node,
SetFilesNode(node[YAML_SYSTEM_DESCRIPTIONS], debugRun.systemDescriptions);
SetDebuggerNode(node[YAML_DEBUGGER], debugRun.debugger);
SetDebugVarsNode(node[YAML_DEBUG_VARS], debugRun.debugVars);
SetDebugSequencesConfNode(node[YAML_DEBUG_SEQUENCES_CONF], debugRun.debugSequencesConf);
SetDebugSequencesNode(node[YAML_DEBUG_SEQUENCES], debugRun.debugSequences);
SetProgrammingNode(node[YAML_PROGRAMMING], debugRun.algorithms);
SetFlashInfoNode(node[YAML_FLASH_INFO], debugRun.flashInfo);
Expand Down Expand Up @@ -264,6 +266,10 @@ void ProjMgrCbuildRun::SetDebugVarsNode(YAML::Node node, const DebugVarsType& de
}
}

void ProjMgrCbuildRun::SetDebugSequencesConfNode(YAML::Node node, const DebugSequencesConfType& sequenceConf) {
SetNodeValue(node[YAML_TRACE_SETUP], sequenceConf.traceSetup);
}

void ProjMgrCbuildRun::SetDebugSequencesNode(YAML::Node node, const std::vector<DebugSequencesType>& sequences) {
for (const auto& sequence : sequences) {
YAML::Node sequenceNode;
Expand Down
5 changes: 5 additions & 0 deletions tools/projmgr/src/ProjMgrRunDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,11 @@ bool ProjMgrRunDebug::CollectSettings(const vector<ContextItem*>& contexts, cons
}

// debug sequences
const auto& traceSetup = static_cast<const RteDeviceElement*>(context0->rteDevice)->GetEffectiveAttribute("traceSetup");
if (traceSetup != "legacy") {
m_runDebug.debugSequencesConf.traceSetup = traceSetup;
}

for (const auto& [debugSequence, _] : debugSequences) {
DebugSequencesType sequence;
sequence.name = debugSequence->GetName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ cbuild-run:
__var DbgMCU_CR = 0x00000007; // DBGMCU_CR: DBG_SLEEP, DBG_STOP, DBG_STANDBY
__var TraceClk_Pin = 0x00040003; // PE2
__var TraceD0_Pin = 0x00040003; // PE4
debug-sequences-conf:
trace-setup: full
debug-sequences:
- name: DebugDeviceUnlock
blocks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ cbuild-run:
__var DbgMCU_CR = 0x00000007; // DBGMCU_CR: DBG_SLEEP, DBG_STOP, DBG_STANDBY
__var TraceClk_Pin = 0x00040003; // PE2
__var TraceD0_Pin = 0x00040003; // PE4
debug-sequences-conf:
trace-setup: full
debug-sequences:
- name: DebugDeviceUnlock
blocks:
Expand Down
2 changes: 2 additions & 0 deletions tools/projmgr/test/src/ProjMgrUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7200,6 +7200,8 @@ TEST_F(ProjMgrUnitTests, TestNoDbgconf) {
EXPECT_FALSE(cbuild["build"]["dbgconf"].IsDefined());
const YAML::Node& cbuildrun = YAML::LoadFile(testoutput_folder + "/out/no-dbgconf+ARMCM3.cbuild-run.yml");
EXPECT_FALSE(cbuildrun["cbuild-run"]["debugger"]["dbgconf"].IsDefined());
EXPECT_TRUE(cbuildrun["cbuild-run"]["debug-sequences-conf"].IsDefined());
EXPECT_EQ("full", cbuildrun["cbuild-run"]["debug-sequences-conf"]["trace-setup"].as<string>());
}

TEST_F(ProjMgrUnitTests, MissingDbgconf) {
Expand Down
Loading