Project items are lost during VisualGDB project template export

Sysprogs forums Forums VisualGDB Project items are lost during VisualGDB project template export

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #22024
    regus_pregus
    Participant

    Environment: VisualGDB 5.4 (preview 4, build 2394) with VS Community Edition 2017 (15.8.2)

    Target: STM32F746NG (on STM32F746G-DISCOVERY board)

    Problem summary: project items (links to source files) that were moved within the project tree to another filter (Solution Explorer branch) are lost during VisualGDB project template export and subsequent import as a new project.

    Steps to reproduce:

    1. Run VS with VisualGDB installed
    2. If any solution is automatically loaded during startup, close it (File->Close Solution)
    3. Create new project and solution (File->New->Project)
      1. New Project page: Select Installed->VisualGDB->Embedded Project Wizard, Name = Test1, Create directory for solution = CHECK, Solution name = Test (or any other unique name)
      2. Project type page: Create a new project with = MSBuild, Embedded binary (.elf) = check, Additional output binaries: bin = check, leave all other settings default
      3. Device selection page: STM32F746NG, leave all other settings default, press Next
      4. Sample selection page: STM32 CubeMX Samples tab, select LTDC_PicturesFromSDCard sample project, leave all other settings default
      5. Debug method page: Debug using = OpenOCD, JTAG/SWD programmer = ST-Link v2.1, leave all other settings default, press Finish
    4. Build the project (Build->Build solution) – builds without errors
    5. Export the project as a VisualGDB project template (first we will create a working template)
      1. Select File -> Export VisualGDB Project Template menu item
      2. In Export Project Template dialog select Test1 item, Template file to create = C:\TestB.vgdbxpt (or any other valid file path)
      3. Press OK
    6. Add new project from template (File->Add->New Project)
      1. New Project page: Select Installed->VisualGDB->Embedded Project Wizard, Name = Test2 (or any other unique name)
      2. Project type page: Create a project from a custom template = CHECK, Template file = C:\TestA.vgdbxpt, press Next
      3. Device selection page: leave all settings default, press Next
      4. Debug method page: leave all settings default, press Finish
    7. Build the project (Build->Build solution) – builds without errors, as expected
    8. Export the project as a VisualGDB project template (now we will create a non-working template)
      1. Create a small modification of the original project: Open Test1 -> Source Files -> Shared resources branch in Solution Explorer, select all the files in that branch and drag them into Test1 -> Source Files -> Device-specific files branch (note that original Test1 project still builds without errors if you do a full or partial rebuild at this point, so this modification in itself is not invalid)
      2. Select File -> Export VisualGDB Project Template menu item
      3. In Export Project Template dialog select Test1 item, Template file to create = C:\TestB.vgdbxpt (or any other valid file path)
      4. Press OK
    9. Add new project from template (File->Add->New Project)
      1. New Project page: Select Installed->VisualGDB->Embedded Project Wizard, Name = Test3 (or any other unique name)
      2. Project type page: Create a project from a custom template = CHECK, Template file = C:\TestB.vgdbxpt, press Next
      3. Device selection page: leave all settings default, press Next
      4. Debug method page: leave all settings default, press Finish
    10. Inspect Test3 -> Source files -> Device-specific files branch in Solution Explorer – the files that we have dragged in original project did not propagate to the Test3 project through the template.
    11. Build the project (Build->Build solution). Multiple linker errors will result due to the fact that the source files as described above are now missing and did not compile.

    Interestingly enough, I experimented with other ways to modify the project and this is it what I could observe:

    1. If you rename Shared resources filter in Test1 -> Source Files branch in the Solution Explorer instead of dragging the files to Device-specific files filter before creating a template, then the files in question will not disappear when a new project is created from such template.
    2. If you create a new filter (folder) in the Solution Explorer under Test1 -> Source Files branch and drag the files there from the Shared resources filter before creating a template, then the files in question will not disappear when a new project is created from such template.
    3. If you drag the files from Shared resources filter Test1 -> Source Files branch in the Solution Explorer into Src filter under the same Test1 -> Source Files branch before creating a template, then the files in question will not disappear when a new project is created from such template.
    4. So they only disappear when you drag files into Device-specific files filter before creating a template.
    #22045
    support
    Keymaster

    Hi,

    Sorry, this is by design. The “Device-specific files” filter is reserved for the files from the BSP that are automatically managed by VisualGDB. E.g. when you change the MCU type or add/remove frameworks, VisualGDB may replace the entire contents of that filter with the files specified by the current BSP version. The template logic also follows this convention – it stores the device ID and settings and re-creates the contents of device-specific files based on the BSP definition. I.e. if you use the same template with a later version of the BSP, it will still use the correct list of files from the new BSP.

    Unfortunately it is somewhat confusing as the “Device-specific files” filter is not shown differently from other filters due to the limitations of the VC++ project subsystem. Long-term we are planning to switch our embedded projects to the Advanced CMake Project Subsystem, so VisualGDB will have fine-grain control over the contents of the Solution Explorer and will be able to clearly show which files are automatically managed by VisualGDB.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.