If you have disabled your JTAG/SWD interface, you would need to start it into ISP mode (System Mode), to go into the ROM bootloader and prevent your application from taking control.
I don't know your board/MCU, usually you need to set a specific jumper. Just read the board user manual. Or the MCU user manual, if it is a custom board.