I am trying to run windowed version on JlinkGDBServer (it is the windows application with GUI) at the end of the Ninja build process.
The powershell is run from the cmd
cmd.exe /C "powershell & "C:/Program Files (x86)/SEGGER/JLink/JLinkGDBServer.exe" -port 2331 -s -CPU Cortex-M -device STM32L476RG -endian little -speed 4000 -vd &"
but the powershell does not exit (the jlinkGDBserver window should remain)
Edit: It is run from the Ninja script generated by the Cmake. I have only partial control here.
The solution:
powershell -command Start-Process -FilePath "'C:/Program Files (x86)/SEGGER/JLink/JLinkGDBServer.exe'" -ArgumentList '-port 2331', '-s', '-CPU Cortex-M', '-device stm32l476RG', '-endian little', '-speed 4000', '-vd'