Can't connect STM32F103C8T6


Yesterday, I have flashed faulty code to my STM32, and now I can't connect to it via ST-Link or the UART bootloader. I've tried using STM32 ST-Link Utility and STM32CubeProgrammer, but neither works. How can I erase the flash memory? Do I need to buy a new chip?
i using stm32f103c8t6
