Is there a way to clear some/all of the eeprom
area when uploading from the IDE. I think there is an option in Avrdude , but in the IDE itself ?
I’m using this memory area to save a few factors and during development it’s a pain to have to keep clearing it with another sketch .
I don't want to clear eeprom on a re boot only when loading a new sketch .
I believe all the "MCUdude" and "DrAzzy" boards platforms have a custom menu under Tools in the Arduino IDE you can use to configure whether or not you want EEPROM to be preserved.
If you want the EEPROM to be erased every time you burn the bootloader or upload using a programmer, you can turn off this option. You'll have to connect an ISP programmer and hit "Burn bootloader" to enable or disable EEPROM retain. Note that when uploading using a bootloader, the EEPROM will always be retained.
You might want to explore what is possible with the EEMEM keyword (some discussion here ➜ EEMEM - #8 by rlogiacco, I did not look much deeper in the forum but I'm sure there are other discussions)
If I remember correctly it requires using an ISP, generating the .eep file and possibly modifying plattform.txt to upload automate this in the IDE
Unfortunately, the ATmega32U4 and family are the AVR chips that have received the least amount of coverage by 3rd party platforms, and never got the blessing of the MCUdude/DrAzzy treatment. The only one for this family I'm familiar with is HoodLoader, which is more focused on a specific use case for these chips.
However, the EEPROM erasing behavior you want is default in even the official Arduino AVR Boards platform. You can see here that the EESAVE bit is unprogrammed in the configuration fuse setting for the Leonardo, and the same for the other ATmega32U4 boards of that platform:
So the only thing you miss is having a menu to control the behavior. If you are wanting that, it can easily be added on to whatever platform you are using already, using the custom board options system like how it was done in the MCUdude and DrAzzy platforms: