Hello Abdullah,
It sounds like the MCU is not under control of the debug interface and the MCU may be blank. The constant resets is common if the part is blank.
Does you debug JTAG or SWD interface include the Reset pin. The reset pin is required if the MCU has been secured.
So this leads me to the next discussion.
Were you ever able to connect to the MCU on your custom board?
From the factory the MCU come programmed with two things in the flash, the flashloader and the KMS library. It also is protected against mass erase by the setting of the Flash Security Register with a value of 0xEE which is also not -secure. Some of the debug tools mistook the flash mass erase protection as being secure and would ask the user to mass erase.
If the part was mass erase the part is now secure and will require the reset pin to regain control over the MCU.
If the part was mass erased during this interaction then the KMS software will not work.
If the part was mass erase, and you still want to use KMS you must replace the MCU on your customer board with another factory programmed MCU.
Best Regards,
Philip