Welcome, Guest. Please login or register.

Username: Password:

Author Topic: EEPROM read in progress! on Mega 2650  (Read 1379 times)

vzr

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
EEPROM read in progress! on Mega 2650
« on: May 24, 2021, 11:56:55 »

Recently I built my own telescope controller which consist of Raspberry Pi acting as an INDI server connected to RTC, GPS, Joystick and AstroEQ based on Arduino Mega 2650. While I was experimenting with various things I run into an problem that I would like to point on here so it could help other users to avoid this kind of situation or fix the issue if they already run into it:

Problem description:
AstroEQ Configuration Utility stall on "EEPROM read in progress!"
While using debug version of AstroEQ utility I found that it repeatedly sends :O21 and waits for response which nevers come back.

Fix:
  • You have to burn bootloader in your Arduino Mega 2650 again (regardless of the version of bootloader you already had). Fortunatly for me, I already have other Arduinos around (Uno and Nano) so I used that approach - Arduino Uno/Nano as ISP to burn bootloader into Arduino Mega 2650. Chances are that you may also have other Arduinos if you go for AstroEQ on Arduino platform, so this may help you as well. Procedure is rather simple and described in details (wiring and flashing) in this two minute video:
    Arduin Uno as ISP to burn Bootloader to Mega 2560. Everything below this step is exactly the same procedure like you are flashing fresh AstroEQ to new Arduino Mega 2650 for the first time, so you can actually skip steps 2 and 3, but I will describe what I did, just to be sure because it works.
  • Download AstroEQ firmware and AstroEQ configuration utility from AstroEQ git repository, specifically from this downloads folder. Extract AstroEQ Arduino firmware, load it into Arduino IDE, reconfigure IDE again to use appropriate board and COM port and upload firmware.
  • Run AstroEQ Configuration Utility and click on Update firmware. In my case it will burn 8.18. Be sure to select appropriate COM port and AstroEQ Arduino Mega 2650 from dropdown menus. Once firmware is flashed, it will repair EEPROM automatically and load configuration utility normally so you are good to go from here on. Afterwards, you can run AstroEQ Configuration Utility again to check for new firmware and update firmware to lastest version, in my case it's now 8.20. Be aware if AstroEQ Configuration Utility actually find new firmware on the server, after downloading it will automatically reset firmware dropdown menu to very first entry so you must select COM port and firmware for Arduino Mega 2650 in this dropdown again before proceeding with update. Once again, after update is done, it will load configuration normally and everything will work normally.

How to avoid this probelm:
When I first run into this problem, I tried everything, even manually erasing every bit of EEPROM but without luck, only bootloader burning actually helped. I also repeated various scenario to find actuall reason for running into this problem and I found it. This "EEPROM read in progress!" kind of situation happen every time if you try to set ADVANCED HC DETECT option to enabled with Arduino Mega 2650 - so, until somebody find a way either to make this option work with Mega or disable this menu item when working with Mega - spare your time and just don't try to enable it.

Some strange things
It actually may be possible to fix this probelm even without burning bootloader into Mega but it requires specific AstroEQ firmware versions whch one day may not be available into download section, but for now, you may try it's this way if you don't have other Arduino or Atmel programmer for bootloader burning. I tried this and it went seemingly normal, but it would not work with ASCOM anyway, so I have to burn bootloader and start everything from scratch again, but you may try:
1. In Arduino IDE write simple sketch that will go through all 4096 bytes of EEPROM and write 0 to each of them. This step is optional, it's just good to be sure to get rid of some orphan chunks if any.
2. Load AstroEQ firmware into Arduino IDE and upload, in current case it will be 8.0.3
3. Run AstroEQ Configuration Utility and do not check for updates, just flash again (in current case it will be 8.18), afterwards it will find EEPROM faulty and do it's autorepair thing. Afterwards you will be prompted for configuration again. Do not enable ADVANCED HC DETECT or you will run into "EEPROM read in progress!" loop again. and try to upload this configuration. After this point you may update to latest version of firmware again. AstroEQ Configuration Utility worked normally, but there was no connection between EQMOD and AstroEQ so I gave up on future testing and reflashed bootloader again, because I already had other Arduino as ISP ready for the job.
Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 809
    • View Profile
    • AstroEQ
Re: EEPROM read in progress! on Mega 2650
« Reply #1 on: May 27, 2021, 09:33:47 »

The advanced hand controller detect should work fine on the Mega. The only reason I can think that it would be causing you problems is if you missed R21 in the schematic.
Logged
Tom Carpenter (AstroEQ)

vzr

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: EEPROM read in progress! on Mega 2650
« Reply #2 on: May 28, 2021, 01:55:50 »

Right, I did not solder ST4 or R21 yet. I just tryed to enable this option so I would be able use advanced HC in future, but this brought me into the problem I described above. The thing is that not even reconfiguring was possible anymore or any kind of serial communication other than uploading new sketch. I tomorrow i will repeat and add 1k resistor between pins 21 and 23 to see what will happen. Auto EEPROM repair apparently worked but after that it hangs on reading before opening config utility. I thought reflashing will erase eeprom and start with fresh configuration...
Logged

TCWORLD

  • Administrator
  • *****
  • Posts: 809
    • View Profile
    • AstroEQ
Re: EEPROM read in progress! on Mega 2650
« Reply #3 on: May 29, 2021, 10:58:03 »

Without the resistor, the AstroEQ always thinks theres a H/C plugged in, and so switches to H/C mode which means it stops checking/responding to the USB-serial so the config utility can no longer talk to it. This is expected behaviour.
Logged
Tom Carpenter (AstroEQ)