Erasing ATMega328's Arduino Uno Bootloader

I just bought a new ATMega328P with Arduino Uno Bootloader. I want to get rid of the bootloader as it takes space. I want to know how to erase the bootloader. I also want to know what will happen to my ATMega when it is erased. Will I be able to code in Arduino C as usual. I use USBasp programmer for programming my ATMega328P

Interesting question. I don't think you are going to like the answer. Ask CrossRoads. I think he is going to tell you that you can't store programs in the bootloader space because it is reserved. Also, your arduino can't work without a bootloader (I think). Good luck.

Just program MCU via ICSP. Chip erase is the first thing which is doing during programming. Remember after this you will not able to use standard Arduino's serial programming way.

ICSP includes a chip-erase function that will erase the bootloader as well. Be sure to un-program the BOOTRST fuse as well, so that the chip will being at 0 instead of at the bootloader start address when it resets (a chip erase does NOT reset the fuses.)
The Uno bootloader is only 1.6% of the code space; it's barely worth getting rid of.

Ask CrossRoads.

As a point of politeness, I don't think you (anyone) should normally contact people via private message to ask questions, even if those people are normally very helpful and active in the forums...

Actually what I had in mind was just to PM him the forum post link and wait to see if he bites. That's nof the same as PMing the question.

So in short, the answer almost certainly is - there is no need at all to erase the bootloader.

In the remote possibility that you did write a program which required that last bit of space, you would then - and do note: only then - need to un-program the BOOTRST fuse as for any shorter program loaded using ISP, the program will simply start normally anyway.

If however, you were writing programs that were that long, you would be running an extreme risk of running out of program space entirely and as a beginner, you would be facing many problems simultaneously! :astonished: