Error in build with the microcontroller Nucleo-G474RE

Error in build step #6 (Make): Make process exited with code 2:
“/Users/lidiakocon/Desktop/Coder_Targets/tsp_stm32/bin/c2p-gdb/c2p-gdb” load --server-cmd “"/Users/lidiakocon/Desktop/Coder_Targets/tsp_stm32/bin/openocd/bin/openocd" -s "/Users/lidiakocon/Desktop/Coder_Targets/tsp_stm32/bin/openocd/share/openocd/scripts" -f board/stm32g431.cfg” --server-start-delay 1000 --port 3333 --nvic 0x8000000 ./output_STM32G474RE/G474RE.elf
IPC adapter opened from parent process.
Error: Unable to connect: Undefined error: 0
Unable to connect.
Healthy exit.
G474RE.mk:237: recipe for target ‘download’ failed

Open On-Chip Debugger 0.11.0-dirty (2022-01-03-10:11)
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Listening on port 6666 for tcl connections
Info : clock speed 2000 kHz

make: *** [download] Error 1

I managed to connect the Nucleo G474RE microcontroller, but I still get an error saying that it cannot connect to GDB. I did the same on the Nucleo F303RE microcontroller, and everything worked fine, connecting without any issues.
I would be very grateful for any help.

Thank you for your post! It is possible to use the ST TSP without installing any additional external tools. If you are still experiencing the connection issue, you could check if you are using any external tools under PLECS->Preferences->Coder by clicking on the icon next to “ST”.