@meghdadi Does your custom board have an external 32.768kHz crystal?
I configured the bootloader to operate crystalless using the microcontroller's own internal 32.768kHz oscillator. However, if the board selected in the Arduino IDE uses an external crystal (like the Arduino Zero), but your custom board doesn't have one, the sketch will stall immediately after upload.