ARM-software / vscode-cmsis-csolution

Extension support for VS Code CMSIS Project Extension
https://marketplace.visualstudio.com/items?itemName=Arm.cmsis-csolution
Other
23 stars 5 forks source link

Starting CubeMX via a task #70

Open FerdinandEn opened 3 weeks ago

FerdinandEn commented 3 weeks ago

Type: Question and Feature Request

Csolution 1.35.0

I am new to the use of VSCode. Therefore, I am not very familiar with the use of tasks. To start CubeMX, an instruction with the following structure is required.

csolution BlinkTest.csolution.yml run --generator CubeMX --context BlinkTest.Debug+STM32H753ZITx

I have tried to start this instruction via a task. I have used the following setting for this:

{
    "label" : "Start CubeMX",
    "type" : "process",
    "command" : "csolution",
    "args": [
        "${command:cmsis-csolution.getSolutionPath}",
        "run",
        "--generator", "CubeMX",
        "--context", "BlinkTest.Debug+STM32H753ZITx"
    ],
    "problemMatcher" : []
}

The desired structure of the instruction is created by the task. However, CubeMXstarts and after a moment CubeMX is terminated again. I have used processand shell as type. In both cases the result is the same (termination of CubeMX).

If you copy the generated instruction into the terminal and execute it in the terminal directly, CubeMX is not closed. I would be very grateful if I could get a tip on how to prevent CubeMX from quitting immediately.

My second question concerns the entry after context. Is there a possibility that I can get the current one for contextusing a csolution-command?

jkrech commented 3 weeks ago

@FerdinandEn, thanks for this piece of feedback. We plan to let people launch the generator from the CMSIS Outline View. The context will be selected based on the currently configured/active context set in line with the displayed outline view.

I did not find a command to find out about the active context.

Can you confirm that CubeMX behaves differently when you launch the command via the terminal inside VSCode or outside or does CubeMX terminate there as well?

FerdinandEn commented 3 weeks ago

@jkrech When I start the task with Terminal-> Run Task...-> Start CubeMX or >Tasks:Run Task. -> Start CubeMX, the problem occurs.

If I enter the instruction in the VSCode terminal, everything is fine. I use the instruction that is displayed by the Run Task call in the terminal. Copy and paste within the same terminal window. Then everything works.