How to disable EEPROM clean with USBASP upload (Arduino IDE 2.0.4, EESAVE)?

I use two lightweight sketches for project: first do all prepare marks for EEPROM, second use already marked memory.

If i upload sketches via USB - all okay, but after USBASP uploads i have cleaned non-marked EEPROM, and second sketch can't work normally.

How to disable forced EEPROM clean during USBASP upload?

lease read the how to get the most from the forum post. The post contains information on what we need to know in order to help you.

What Arduino board are you using and what core?

Sorry for incomplete info. I use IDE 2.0.4.

For USBASP i use both Pro Mini and Nano. For USB-upload of course, Nano only.

It seems that EESAVE should help, but it's better to ask how to use it most competently for Arduino IDE.

If you are using the Optiboot bootloader from the IDE, I don't know how to preserve the EEPRIOM.

I use the MiniCore core to bootload all of my mega328 processors. The MiniCore core uploads the Optiboot core, but you have control over many parameters. The linked page has installation instructions. Using that core makes it easy to select many bootloader options like clock frequency, clock source, retain or erase EEPROM and others. Below is an image of the menu.

1 Like

Core replacement is a promising idea. I haven't tried substitutions yet (compatibility issues are a little scary), but I'll look this way, thanks!

What if I change \Arduino15\packages\arduino\hardware\avr\1.8.6\boards.txt in
pro.name=Arduino Pro or Pro Mini section?
In this case i can use default core now.
Would that be considered a good solution?

Those are good questions, that I can't answer. I have only used MiniCore.

But I know that there are members who can answer. I will learn along with you.

1 Like

Hm, I changed high fuses to xD2, but EEPROM still erased (both on Nano and Pro Mini).

Hi @n_a. After changing the fuse values in the board definition at boards.txt file, you must perform some additional actions before the change will take effect on the board:

  1. Select File > Quit from the Arduino IDE menus and then start Arduino IDE again.
    ā“˜ Changes to boards.txt and other platform configuration files only take effect after restarting Arduino IDE>
  2. Connect an ISP programmer to your board and computer.
  3. Select the board with the modified configuration from the Tools > Board menu.
  4. Select the appropriate programmer from the Tools > Programmer menu.
  5. Select Tools > Burn Bootloader from the Arduino IDE menus.
  6. Wait for the "Burn Bootloader" operation to complete successfully.

In addition to flashing the bootloader, the "Burn Bootloader" operation also sets the fuses on the board. "Upload Using Programmer" does not do that. So even though you don't need the bootloader flashed, you must perform the "Burn Bootloader" operation solely for the purposes of updating the fuses on the board.

2 Likes

I'm sorry, I completely forgot that I need to update the bootloader.

Yes, everything works as it should, thank you for help!

You are welcome. I'm glad it is working now.

Regards,
Per

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.