eminkiran
New Member
- Total Posts : 19
- Reward points : 0
- Joined: 2018/06/20 01:04:41
- Location: 0
- Status: offline
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
|
NKurzman
A Guy on the Net
- Total Posts : 19115
- 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)
You could Jump. But a Software Reset, or a Watch dog would be easier.
|
eminkiran
New Member
- Total Posts : 19
- 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)
Hi NKruzman how can i sens jump signal on bootloader side.
|
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
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
|
eminkiran
New Member
- Total Posts : 19
- 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)
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
|
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)
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
|
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)
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; } }
|
NKurzman
A Guy on the Net
- Total Posts : 19115
- 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)
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
|
NKurzman
A Guy on the Net
- Total Posts : 19115
- 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)
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
|
eminkiran
New Member
- Total Posts : 19
- 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)
i tried EnableWDT(); or SYS_WDT_Enable() but i get undefined referance error message. Why ?
|
friesen
Super Member
- Total Posts : 2168
- Reward points : 0
- Joined: 2008/05/08 05:23:35
- Location: Indiana, USA
- Status: online
Re: Jump to bootloader from main application
2018/10/10 05:52:06
(permalink)
☄ Helpfulby Geri 2020/05/29 11:33:06
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.
|
eminkiran
New Member
- Total Posts : 19
- 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)
i use SYS_RESET_SoftwareReset(); function. but not become 1 on SWR bit
|
friesen
Super Member
- Total Posts : 2168
- Reward points : 0
- Joined: 2008/05/08 05:23:35
- Location: Indiana, USA
- Status: online
Re: Jump to bootloader from main application
2018/10/10 07:22:14
(permalink)
How exactly are you checking? You can't check with a debugger.
|
eminkiran
New Member
- Total Posts : 19
- 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)
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); }
|