AnsweredHot!Jump to bootloader from main application

Author
eminkiran
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2018/06/20 01:04:41
  • Location: 0
  • Status: offline
2018/10/09 13:26:02 (permalink)
0

Jump to bootloader from main application

Hello,
I am using Pic32mx795f512L.

I install bootloader code on PIC32 ESK dm320004 development tool.
"harmony \ v2_05_01 \ apps \ bootloader \ basic \ firmware \ basic.X"
I ran the application The bootloader is running. I uploaded user application There is no problem


Mplab X ide = v4.15
Compiler = xc32 v2.05
Harmony = v2_05_01
Bootloader Firmware Version: 1.4

So, how can i jump to bootloader from main application without any trigger(like button)

I would like to use software trigger over the main application. If is it possible, how ?

Thanks for answer
#1
NKurzman
A Guy on the Net
  • Total Posts : 17126
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: Jump to bootloader from main application 2018/10/09 14:49:47 (permalink)
0
You could Jump.  But a Software Reset, or a Watch dog would be easier.
 
#2
eminkiran
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2018/06/20 01:04:41
  • Location: 0
  • Status: offline
Re: Jump to bootloader from main application 2018/10/10 00:35:48 (permalink)
0
Hi NKruzman how can i sens jump signal on bootloader side.
#3
raja28chowdhury
Starting Member
  • Total Posts : 45
  • Reward points : 0
  • Joined: 2015/06/14 00:15:06
  • Location: 0
  • Status: offline
Re: Jump to bootloader from main application 2018/10/10 01:05:34 (permalink) ☼ Best Answerby eminkiran 2018/10/10 01:16:59
0
generally you wait for some time in bootloader and wait for a specific packet  from usart if you don't get it go to main application
#4
eminkiran
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2018/06/20 01:04:41
  • Location: 0
  • Status: offline
Re: Jump to bootloader from main application 2018/10/10 01:20:46 (permalink)
0
hi raja i using microchip ethernet bootloader. I need to redirect the code after the trigger code from the main program.
 
Like this
void (*fptr)(void);
 fptr = (void (*)(void))(0xBFC00000);
 fptr();
 
but i dont know (after trigger) code address
 
#5
raja28chowdhury
Starting Member
  • Total Posts : 45
  • Reward points : 0
  • Joined: 2015/06/14 00:15:06
  • Location: 0
  • Status: offline
Re: Jump to bootloader from main application 2018/10/10 01:28:36 (permalink)
0
have you conformed the address of main in map file
looks like this
C:\Users\raja2\Google Drive\microchip code\door_alarm.X\dist\default\production
#6
raja28chowdhury
Starting Member
  • Total Posts : 45
  • Reward points : 0
  • Joined: 2015/06/14 00:15:06
  • Location: 0
  • Status: offline
Re: Jump to bootloader from main application 2018/10/10 01:32:08 (permalink)
0
this is from microchip app note for pic 18 and i have put it in application with no remapping
void interrupt high_isr()
{
if(PIR1bits.RCIF)
{
if(RCSTAbits.FERR && !PORTCbits.RC7)
{
// receiving BREAK state, soft reboot into Bootloader mode.
Reset();//reset the pic and go into bootloader
}
TXREG = RCREG; // echo received UART character back out
LATD ^= 0xF0;
}
}
 
 
#7
NKurzman
A Guy on the Net
  • Total Posts : 17126
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: Jump to bootloader from main application 2018/10/10 05:48:51 (permalink)
0
You can
1. Leave a message in “persistent memory
2. Put a message in external eeprom.
3. Use the software reset and is RCON to tell it is a software reset.
4. Think of something even more Clever
#8
NKurzman
A Guy on the Net
  • Total Posts : 17126
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: Jump to bootloader from main application 2018/10/10 05:48:51 (permalink)
0
You can
1. Leave a message in “persistent memory
2. Put a message in external eeprom.
3. Use the software reset and is RCON to tell it is a software reset.
4. Think of something even more Clever
#9
eminkiran
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2018/06/20 01:04:41
  • Location: 0
  • Status: offline
Re: Jump to bootloader from main application 2018/10/10 05:50:57 (permalink)
0
i tried EnableWDT(); or SYS_WDT_Enable() but i get undefined referance error message. Why ?
#10
friesen
Super Member
  • Total Posts : 2036
  • Reward points : 0
  • Joined: 2008/05/08 05:23:35
  • Location: Indiana, USA
  • Status: offline
Re: Jump to bootloader from main application 2018/10/10 05:52:06 (permalink)
5 (1)
My personal preference is to check RCON.  That way if you do a software reset from your application, RCONbits.SWR will be set.  Just be sure to clear RCON before jumping back to the main application, it doesn't self clear.

Erik Friesen
#11
eminkiran
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2018/06/20 01:04:41
  • Location: 0
  • Status: offline
Re: Jump to bootloader from main application 2018/10/10 06:47:02 (permalink)
0
i use SYS_RESET_SoftwareReset(); function. but not become 1 on SWR bit
#12
friesen
Super Member
  • Total Posts : 2036
  • Reward points : 0
  • Joined: 2008/05/08 05:23:35
  • Location: Indiana, USA
  • Status: offline
Re: Jump to bootloader from main application 2018/10/10 07:22:14 (permalink)
0
How exactly are you checking?  You can't check with a debugger.

Erik Friesen
#13
eminkiran
New Member
  • Total Posts : 17
  • Reward points : 0
  • Joined: 2018/06/20 01:04:41
  • Location: 0
  • Status: offline
Re: Jump to bootloader from main application 2018/10/11 00:12:06 (permalink)
0
Hi all,
Problem solved
 
Tanks for advice
 
I called in Main program
void reset_cpu(void)  //Don't miss wdt prescaller 1:1 for booth application main program and bootloader
  {
        WDTCONbits.ON = 1;      //Enable the WDT    
  }
 
Bootloader Read
if (RCONbits.WDTO)
    {
            RCONbits.WDTO=0;
            return (1);
    }
#14
Jump to:
© 2019 APG vNext Commercial Version 4.5