Open-CMSIS-Pack / devtools

Open-CMSIS-Pack development tools - C++
Apache License 2.0
74 stars 55 forks source link

[csolution format] Format should support debug configuration data #335

Open jkrech opened 2 years ago

jkrech commented 2 years ago

MCUXpresso SDK/IDE wants to provide out-of-box debug experience for customers which means customers can directly import/copy project from pack and download/debug with one or 2 click without requiring manual configuration by the user. To achieve this, some debug configuration should be provided in packs. The reality is for a device, most examples can share the same debug configuration data, we plan to place it under "environment name="mcux"" in pdsc of DFP/BSP. But some examples may need special configuration due to many reasons. For example specific debug configuration data, like

<debug_configuration id="com.crt.advproject.config.exe.release" name="Release Configuration" probe="LinkServer">
          <scripts>
            <script type="init" silent="false" emulators="${gdb.stub} -mi -info-emu">
              <script>
set remotetimeout 60000
##target_extended_remote##
set mem inaccessible-by-default ${mem.access}
mon ondisconnect ${ondisconnect}
set arm force-mode thumb
${load}</script>
            </script>
            <script type="run" silent="false" emulators="${gdb.stub} -mi -info-emu">
              <script>${run}</script>
            </script>
          </scripts>
          <params>
            <params id="vector.catch.release.mcuxpresso" name="vector.catch" value="false"/>
            <params id="internal.cache.release.mcuxpresso" name="internal.cache" value="Disable"/>
          </params>
        </debug_configuration>

I see 2 place for such example specific data:

  1. pdsc project environment. I don't think it is good, because name="mcux" only contain debug configuration data.
      <project>
        <environment name="uv" load="mdk/freertos_event.uvprojx"/>
        <environment name="iar" load="iar/freertos_event.ewp"/>
        <environment name="mcux" load="special_debug_configuration.xml"/>
        <environment name="csolution" load="csolution.yml" />
      </project>
  2. csolution/cproject extension point. We need to translate above debug data into extension point. Our IDE can consume it then.

I know csolution/cprj focus on build, but it should provide place for debug configuration data.

Originally posted by @tcsunhao in https://github.com/Open-CMSIS-Pack/devtools/issues/171#issuecomment-1127362560

jkrech commented 2 years ago

Let's discuss in the project meeting. How about placing a file with a unique file name or file extension side by side with the *.csolution.yml file containing the debug configuration data. This way the IDE will know that it needs to read this project local file rather than extracting the data from the DFP/BSP without the need to add this data in the csolution file itself?

jkrech commented 2 years ago

During the meeting we did not have any voices opposing the idea to include debug configuration meta information being added to the csolution.yml format. @tcsunhao please feel free to create a new issue proposing the meta information required for debug configuration. The main question for me is whether we can extract commonality across debuggers and IDEs enabling basic operations like flash programming and run-stop debug and advanced operations requiring specific configuration options e.g. linked as config files...

jankap commented 2 years ago

Does cprj support a debug section?

jkrech commented 2 years ago

@jankap, no the current cprj format does not specify meta information related to programming and debugging a device.

ReinhardKeil commented 1 week ago

I suggest that next step is a gap analysis with VS Code debug integrations.