I’ve experienced a very similar issue to @anilkumarraj2001 and @lubc when trying to connect to my custom board with STM32CubeProgrammer. To clarify, I had connected SWDIO, SWCLK, and GND of my ST-LINK/V2 device to my board and got the same error “No STM32 target found!”. My board was powered externally, so no need to connect either the 3.3V or 5V output.
What solved the issue for me was to pull RST to GND before clicking the “Connect” button and then immediately disconnecting from GND afterwards. As I did not have a button on my board I just used a wire to do so. Hope this helps someone else in who’s in the same situation.