I wrote some data in eeprom, but each time I download a program from the debugger, those data are erased (values=0xFF). I need those data to be retained. I searched, the emulator settings but still no luck. I use Mplab X v3.40 with ICD3 emulator and the MCU is a PIC18F25K20. I tried all the combinations with the three settings seen below, but the result is always the same: the program is compiled OK, but during download I get the below error. For a 1-2 settings combinations, the code is downloaded, but the eeprom data are not retained. So how can those data remain inside eeprom, until the application itself (and not the emulator) erase them? Thanks in advance.
In general, compilers provide directives for programming user defined values on EEPROM. I guess this settings supersede the IDE configuration, but you could check on your code if there could be happening conflict on both.
It programms locations 0 to 7. I wonder where would that file be. I opened all the project directories (build, debug, dist, nbproject) and searched inside all the files using the keyword "eeprom", but did not understood if one of them is the eeprom file.
I guess this settings supersede the IDE configuration, but you could check on your code if there could be happening conflict on both.
then after program download, those memories are written with those values. Then I comment out this line and download code again. The same addresses are now 0xFF, although the "preserve eeprom data" checkbox is checked...
Isn't the programmer acting exactly as expected ? According to the picture you attached in post #1, there you are instructing it to erase the program, which means write 0xFF to all adresses:
Sorry for the misunderstanding. As I already said I tried all the combinations. The problem is that as soon as I deactivate the "Erase all before program" option, then I get the error shown in post #1. It compiles OK, but before download, this error is thrown and it won't let me download the program. The image shows a random selection of those three options, at the specific time I took the snapshot.