Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Jump to bootloader

  1. #1
    Junior Member
    Join Date
    Jan 2021
    Posts
    3

    Jump to bootloader

    Hi,

    I copied/pasted the code for jumping to the bootloader from here: https://www.pjrc.com/teensy/jump_to_bootloader.html

    I tried it with my at90usb1286 and it doesn't seem to work. What I expected to happen was for the usb for the board to switch from 0x16c0:0483 (app) to 0x03eb:2ffb (bootloader). But instead what happens is the usb device completly disappears and does not re-appear. I'm unsure how I can debug this, but am wondering if maybe the jump to 0x1fc00 is not quite right? Does anyone else have experience with this?

    Thanks,
    Lance

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,788
    I tried it just now with this code in Arduino. Works fine.

    Code:
    void setup() {
      while (!Serial) ; // wait for serial monitor
      Serial.println("jump to bootloader test");
      for (int i = 5; i >= 0; i--) {
        Serial.print(i);
        Serial.print("... ");
        delay(1000);
      }
      Serial.println("Jump!");
      Serial.flush();
      delay(10);
    
      
      // disable watchdog, if enabled
      // disable all peripherals
      UDCON = 1;
      USBCON = (1 << FRZCLK); // disable USB
      UCSR1B = 0;
      delay(5);
      cli();
      EIMSK = 0; PCICR = 0; SPCR = 0; ACSR = 0; EECR = 0; ADCSRA = 0;
      TIMSK0 = 0; TIMSK1 = 0; TIMSK2 = 0; TIMSK3 = 0; UCSR1B = 0; TWCR = 0;
      DDRA = 0; DDRB = 0; DDRC = 0; DDRD = 0; DDRE = 0; DDRF = 0;
      PORTA = 0; PORTB = 0; PORTC = 0; PORTD = 0; PORTE = 0; PORTF = 0;
      asm volatile("jmp 0x1FC00");
    }
    
    void loop() {
    
    }

  3. #3
    Junior Member
    Join Date
    Jan 2021
    Posts
    3
    I just ran your setup() and get the 5... 4... 3... 2... 1... 0... Jump!. And then my serial terminal disconnects, as does my usb device. Furthermore, power cycling the board doesn't bring it back unless I hold down reset and hwb and release reset to get the bord back into the bootloader.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,788
    Is it a genuine Teensy++ 2.0? Can you show a photo of the board?

    On my Teensy++ 2.0 here, the USB does disconnect. The Arduino Serial Monitor goes gray. Then Teensy Loader detects the board, reprograms the code and reboots it. The Serial Monitor re-detects it in a couple seconds and the process repeats, over and over.

  5. #5
    Junior Member
    Join Date
    Jan 2021
    Posts
    3
    Oh! No, I just realized it's actually not a genuine Teensy++2.0. It has the At90usb1286 though.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •