diff --git a/test/packs/ARM/RteTest_DFP/0.1.1/ARM.RteTest_DFP.pdsc b/test/packs/ARM/RteTest_DFP/0.1.1/ARM.RteTest_DFP.pdsc index 098a90b6c..7d5fa914a 100644 --- a/test/packs/ARM/RteTest_DFP/0.1.1/ARM.RteTest_DFP.pdsc +++ b/test/packs/ARM/RteTest_DFP/0.1.1/ARM.RteTest_DFP.pdsc @@ -34,7 +34,7 @@ __var TraceD1_Pin = 0x00040004; // PE4 - + diff --git a/test/packs/ARM/RteTest_DFP/0.2.0/ARM.RteTest_DFP.pdsc b/test/packs/ARM/RteTest_DFP/0.2.0/ARM.RteTest_DFP.pdsc index e17d79963..4e5e84736 100644 --- a/test/packs/ARM/RteTest_DFP/0.2.0/ARM.RteTest_DFP.pdsc +++ b/test/packs/ARM/RteTest_DFP/0.2.0/ARM.RteTest_DFP.pdsc @@ -231,6 +231,7 @@ + diff --git a/tools/projmgr/include/ProjMgrRunDebug.h b/tools/projmgr/include/ProjMgrRunDebug.h index 3e7c9f1bd..800559637 100644 --- a/tools/projmgr/include/ProjMgrRunDebug.h +++ b/tools/projmgr/include/ProjMgrRunDebug.h @@ -129,6 +129,13 @@ struct DebugSequencesType { std::string pname; }; +/** + * @brief debug sequences configuration type +*/ +struct DebugSequencesConfType { + std::string traceSetup; +}; + /** * @brief debug vars type */ @@ -223,6 +230,7 @@ struct RunDebugType { SystemResourcesType systemResources; DebuggerType debugger; DebugVarsType debugVars; + DebugSequencesConfType debugSequencesConf; std::vector debugSequences; DebugTopologyType debugTopology; }; diff --git a/tools/projmgr/include/ProjMgrYamlParser.h b/tools/projmgr/include/ProjMgrYamlParser.h index 13f25aa8e..a2ab3abb3 100644 --- a/tools/projmgr/include/ProjMgrYamlParser.h +++ b/tools/projmgr/include/ProjMgrYamlParser.h @@ -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"; @@ -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"; diff --git a/tools/projmgr/schemas/common.schema.json b/tools/projmgr/schemas/common.schema.json index 47a906c73..9c379116d 100644 --- a/tools/projmgr/schemas/common.schema.json +++ b/tools/projmgr/schemas/common.schema.json @@ -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, @@ -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"] diff --git a/tools/projmgr/src/ProjMgrCbuildRun.cpp b/tools/projmgr/src/ProjMgrCbuildRun.cpp index 5b5edcd0d..9ba6e69b1 100644 --- a/tools/projmgr/src/ProjMgrCbuildRun.cpp +++ b/tools/projmgr/src/ProjMgrCbuildRun.cpp @@ -26,6 +26,7 @@ class ProjMgrCbuildRun : public ProjMgrCbuildBase { void SetDebuggerNode(YAML::Node node, const DebuggerType& debugger); void SetDeviceSettingsNode(YAML::Node node, const std::map& 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& algorithms); void SetDebugSequencesBlockNode(YAML::Node node, const std::vector& blocks); void SetDebugTopologyNode(YAML::Node node, const DebugTopologyType& topology); @@ -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); @@ -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& sequences) { for (const auto& sequence : sequences) { YAML::Node sequenceNode; diff --git a/tools/projmgr/src/ProjMgrRunDebug.cpp b/tools/projmgr/src/ProjMgrRunDebug.cpp index a252e3dfb..59e992410 100644 --- a/tools/projmgr/src/ProjMgrRunDebug.cpp +++ b/tools/projmgr/src/ProjMgrRunDebug.cpp @@ -352,6 +352,11 @@ bool ProjMgrRunDebug::CollectSettings(const vector& contexts, cons } // debug sequences + const auto& traceSetup = static_cast(context0->rteDevice)->GetEffectiveAttribute("traceSetup"); + if (traceSetup != "legacy") { + m_runDebug.debugSequencesConf.traceSetup = traceSetup; + } + for (const auto& [debugSequence, _] : debugSequences) { DebugSequencesType sequence; sequence.name = debugSequence->GetName(); diff --git a/tools/projmgr/test/data/TestRunDebug/ref/custom+TestHW.cbuild-run.yml b/tools/projmgr/test/data/TestRunDebug/ref/custom+TestHW.cbuild-run.yml index b7d18059a..6889adc14 100644 --- a/tools/projmgr/test/data/TestRunDebug/ref/custom+TestHW.cbuild-run.yml +++ b/tools/projmgr/test/data/TestRunDebug/ref/custom+TestHW.cbuild-run.yml @@ -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: diff --git a/tools/projmgr/test/data/TestRunDebug/ref/run-debug+TestHW.cbuild-run.yml b/tools/projmgr/test/data/TestRunDebug/ref/run-debug+TestHW.cbuild-run.yml index 3920a6b98..8c140838b 100644 --- a/tools/projmgr/test/data/TestRunDebug/ref/run-debug+TestHW.cbuild-run.yml +++ b/tools/projmgr/test/data/TestRunDebug/ref/run-debug+TestHW.cbuild-run.yml @@ -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: diff --git a/tools/projmgr/test/src/ProjMgrUnitTests.cpp b/tools/projmgr/test/src/ProjMgrUnitTests.cpp index ceb712f57..c321b2183 100644 --- a/tools/projmgr/test/src/ProjMgrUnitTests.cpp +++ b/tools/projmgr/test/src/ProjMgrUnitTests.cpp @@ -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()); } TEST_F(ProjMgrUnitTests, MissingDbgconf) {