Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pinguino OTG Bootloader call
29-08-2014, 02:49 PM, (This post was last modified: 29-08-2014, 05:38 PM by zenogueira.)
#1
Pinguino OTG Bootloader call
Hey guys,

Is there any way to call the Pinguino OTG bootloader through software?

Thanks.

Kindly,
José Nogueira
Reply
30-08-2014, 07:59 AM,
#2
RE: Pinguino OTG Bootloader call
If you look at the procdefs.ld for Pinguino-OTG (and other PIC32 boards), you will notice the following statement.

Code:
boot_software_key : ORIGIN = 0xA0000000, LENGTH = 0x4

This RAM location is reserved to start bootloader from the software.

First disable the USB module and disable interrupts. Then execute;

Code:
unsigned int * SoftwareKey;
SoftwareKey = (unsigned int *)0xA0000000;
*SoftwareKey = 0x12345678;

followed by system reset. System reset can be done by SystemReset() in system.c library.

One extra note: if you call System.reset() instead, you will get the error. The system.pdl32 file needs to be corrected from

Code:
System.reset SystemReset#include <system.c>#SYSTEMRESET

to

Code:
System.reset SystemReset#include <system.c>#define SYSTEMRESET

If the bootloader does not support software key, update the bootloader with enhanced USB bootloader (http://forum.pinguino.cc/showthread.php?tid=4265).

DJ
Reply
01-09-2014, 02:45 PM,
#3
RE: Pinguino OTG Bootloader call
Hey!
Beforehand, I want to thank you for you response. I managed to start the bootloader mode.
One more question:
Why do you write some (it seems) random value in the boot_software_key address and why does it trigger bootloader mode on the next reset?
Reply
01-09-2014, 04:28 PM,
#4
RE: Pinguino OTG Bootloader call
It is not a random number, it must be 0x12345678. And it is a feature of the bootloader to start a bootloader when it detects 0x12345678 at *0xa0000000.

The Olimex Pinguino-OTG comes with the bootloader preinstalled by Olimex. I couldn't find any information or source code from Olimex but I think the bootloader is based on UBW32 bootloader which in turn is based on Microchip HID bootloader. I don't think the Pinguino bootloader from SVN has this feature.

DJ
Reply
07-09-2014, 06:17 PM,
#5
RE: Pinguino OTG Bootloader call
system.pdl32 fixed in Pinguino v11.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)