Flashing deletes bootloader

Hello!
I have a problem with my mega 2560. Every time I upload sketch using bootloader, I lose bootloader. Then I have to reupload bootloader using USBasp.

I've checked fusebits:
Low: 0xFF
High: 0xD8
External: 0xFD
Lock: 0xCF

Is this due to wrong fusebits, or do I have faulty arduino?
I managed to program it only first time, and I had to flash bootloader after that.

There is no similar problem with my older mega 2560 nor with uno.

Hi, Nixa,
Is it an original arduino (or genuino) I bought a Chinese clone Mega on the internet not so long ago and remember having to install special drivers. The normal drivers seemed to work but caused erratic errors from time to time…

It is Chinese clone Mega from ebay...
And I do have that special driver CH340.

Driver problems are ruled out by the fact that it works once.

Do you have anything connected to the reset line by any chance when you’re trying to upload to it?
Typically this happens because bootrst fuse isn’t set (you say it is), or the chip isn’t being reset when the connection opens, so it’s not running the bootloader.

There is only arduino. No cables, shields or anything else. I even checked if it really has Atmel chip. :disappointed_relieved:

How do you "make it upload"? Do you use the right arrow of Sketch => Upload? Or do you click upload using programmer? (Yeay, I have seen people do it...)

Upload, write, send code, program micro... My arduino IDE says "Zapiši bootloader", and "Prenesi"
I use USBasp programmer to write arduino bootloader or to send .hex generated bascom.

I don't speak Croatian :wink: So you have to do the translation.

But uhm,

Nixa:
or to send .hex generated bascom.

When do you send a hex? When using the Arduino IDE you should never have to program a .hex. When you program a .hex the bootloader is indeed gone.

Only things I programmed with arduino ide are web server for my home heating and cooling system and my 3d printer. Everything else, like datalogers, controll and other simple periferial units, I program with BASCOM AVR. I just use arduino board for simplicity.

I found the problem. It is reset pull up resistor. It is to low, so if there is some program, it doesen't reset. And if I flash bootloafer, there is nothing else but bootloader, it accepts new program.

I can even program it if I manualy reset it at the right moment.