Help! I think I've erased my bootloader!

I'm using EEPROM write / read to store a few bytes of data. after resetting the 512k of memory to 0 I can no longer upload a sketch to my mega2560 so I'm assuming I have over-written part of it's bootloader.

I thought that the 512kb of EEPROM was for user storage, and was seperate memory locations from where the sketches are stored. Is this NOT the case???

I've tried restoring the bootloader using the 'burn bootloader' option inside the arduino IDK. it's not working. Do I need to use another board as a programmer? If so, do I just set the extra board up as a programmer and connect the broken board via ICSP header pins?

any info would be much appreciated!

EDIT: I got the bootloader working again, but would still like to know if there is any danger writing to EEPROM

Shouldn't be.
When I tried to write more than 1K of eeprom, the address just wrapped around to 0 again, and screwed up the data I had save there.
Sketches cannot write to flash space. Only code running in the bootload area can write to flash space.

i have a sketch that will not completely upload. it's 14kb compiled. the hex file seems to almost make it, then avrdude keep spitting out, one letter at a time this...

B
O
O
T
L
O
A
D
E
R

H
U
H
?

any ideas? other sketches upload fine...

Never saw that happen!

Did you get the code from someone else and check it before you flashed it?

thanks, but I fixed it long ago. I don't quite remember what the problem was but it was something simple! thanks for your reply anyway!

B
O
O
T
L
O
A
D
E
R

H
U
H
?

any ideas? other sketches upload fine...

t was something simple!

Like getting the Bootloader screwed or off the hook!
Another simple thing wrong would be changing the fuse bits of the ATmega and then it just programmes for once taking over the bootloader lock section at place , FOR example if you have pro mini 8Mhz bootloader and you just configure to run ATmega on the internal oscillator ,pretty simple wrong but develops programming problems!