Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot upload reliably using Bluetooth and an HC-05 #212

Closed
mgurzixo opened this issue Nov 30, 2021 · 1 comment
Closed

Cannot upload reliably using Bluetooth and an HC-05 #212

mgurzixo opened this issue Nov 30, 2021 · 1 comment

Comments

@mgurzixo
Copy link

mgurzixo commented Nov 30, 2021

This is a duplicate of Optiboot issue #334. I do not know which repository is the best for this discussion...

When connecting an Arduino pro mini to an HC-05, I was not able to upload a sketch reliably OTA.
The long story is there .

My solution was to patch the function verifySpace() inside Optiboot like this:

void verifySpace() {
  if (getch() != CRC_EOP) {
#ifdef CLASSIC_VERIFY_SPACE
    watchdogConfig(WATCHDOG_16MS);    // shorten WD timeout
    while (1)            // and busy-loop so that WD causes
      ;              //  a reset and app start.
#else
    putch(STK_NOSYNC);
#endif
  }
  else {
    putch(STK_INSYNC);
  }
}

So that, if there is noise on the line, Optiboot sends back STK_NOSYNC instead of resetting, allowing AVRDUDE to resynchronize nicely.

Doing that allows now for a very reliable OTA sketch upload.

As an added benefit, Optiboot is now 2 bytes smaller :)

Any comments?

Michel

@MCUdude
Copy link
Owner

MCUdude commented Aug 19, 2022

Sorry for the late reply. However, since MiniCore uses Optiboot, and you're facing an Optiboot-related issue, I'm closing this in favor of Optiboot/optiboot#334

@MCUdude MCUdude closed this as completed Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants