Can't upload : Programmer is not responding

Hello everyone,

I'm coming to you because i have a problem that i've been trying to solve for days and i'm stuck... So i wanted to modify the bootloader of my Arduino UNO by adding some functions of my own. And to do that, i had to modify the fuse settings of my board to get the maximum size (HFuse : D8, LFuse : FF, EFuse : FD) in the makefile and boards.txt. So i used another Arduino UNO to burn the bootloader and everything worked. I modify the LED_START_FLASHES variable in Makefile to check if the current bootloader was the good one.

But then, it's impossible for me to upload an sketch on this board, i get the following output :+1:

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM10
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
         Hardware Version: 4728160
         Firmware Version: 0.4598883
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
         Vtarget         : 420030.5 V
         Varef           : 198234348.8 V
         Oscillator      : 1.373 Hz
         SCK period      : 7006770.9 us

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_recv(): programmer is not responding

Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
avrdude done.  Thank you.

But if i put the original bootloader, everything works perfectly.

PS : During those days solving this i think i've looked at almost all the topics about this but nothing helped so far :/

EDIT: Well, i've been told the optiboot from Arduino IDE was too old, so i based my code on a recent optiboot and i've been able to upload a sketch with this bootloader with just setting my fuse settings. But when i add my functions, i had to change the makefile so it compiles all my files and not only optiboot.c. But then i have the error : "C:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/bin/ld.exe: section.version [00007ffe - > 00007fff] overlaps section .text [00007000 -> 000080fd]" So i changed in the makefile "--section-start=.text=0x7000" to "--section-start=.text=0x80fd" and then it compiled properly but my .hex file size is around 4800 bytes instead of 4000 with the old optiboot. And it's very wierd because when i remove my files it's 475bytes so just 25 more bytes than the old version but when i add my functions, the size ups more than before :/

You have to come to realize the context between HW and SW. You cannot swell the flash. What is the max. flash address on 328P? 0x7FFF? Where do you want to save overlapped image? This is the first. The second thing is that you want to get maximum size for APP so you disabled the boot region but bootloader is needed to be able upload code via serial line. You have to decide what is more needful for you.