Reset to bootloader through sketch

Hello,
I currently am working on a small project and I need to reset the whole arduino into bootloader programming mode. I have a pro mini, atmega328

The way I currently tried is: asm volatile (" jmp 30720");
This does send it into the bootloader, but it won't respond to any serial commands. Normally when it boots, I can send a '1 ' command to get 'AVR ISP'

The other way I can think of is using a watchdog timer. I would prefer not to use a watchdog.

I am doing this without a standard FDTI cable, so upon connecting there are a few extra characters sent to the arduino before the connection is established.

I've changed the bootloader to have a longer wait time(yes, I did it in the makefile) and to have a higher max error.

Any other suggestions?

Thanks,
Nai

The other way I can think of is using a watchdog timer. I would prefer not to use a watchdog.

Why not?

From what I've read, it seems it can cause problems.

The original bootloader has problems with the watchdog. The Pro Mini uses the original bootloader...
pro5v328.bootloader.file=ATmegaBOOT_168_atmega328.hex

How do you feel about replacing the bootloader?

I've already been editing the bootloader some. Longer wait time and a higher error count.

Oh right. I need to pay more attention (not the first time my attention span has been an issue).

In that case, just disable the watchdog at the very start of the bootloader and use the watchdog to reset. Problem solved.

The

#ifdef WATCHDOG_MODS
      ch = MCUSR;
      MCUSR = 0;

      WDTCSR |= _BV(WDCE) | _BV(WDE);
      WDTCSR = 0;

      // Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot.
      if (! (ch &  _BV(EXTRF))) // if its a not an external reset...
            app_start();  // skip bootloader
#else
      asm volatile("nop\n\t");
#endif

Section?

Almost. You will need to comment-out (or remove) this part...

      // Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot.
      if (! (ch &  _BV(EXTRF))) // if its a not an external reset...
            app_start();  // skip bootloader

That bit of code skips the bootloader and jumps straight to the application in the event of a watchdog reset. In your case, you want the bootloader to run.

So there's no way to reset without using a watchdog or physically?

Exactly. The jump you tried only "restarts" the software. It does not reset the processor. Interrupts will be enabled and able to fire. Any pins set to outputs will remain outputs. Any PWM running will continue to run. The hardware is left exactly as it was when the jump was executed.