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.)
Pinguino OTG Bootloader call
Hey guys,

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


José Nogueira
30-08-2014, 07:59 AM,
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.

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;

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

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


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

If the bootloader does not support software key, update the bootloader with enhanced USB bootloader (

01-09-2014, 02:45 PM,
RE: Pinguino OTG Bootloader call
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?
01-09-2014, 04:28 PM,
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.

07-09-2014, 06:17 PM,
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.

Forum Jump:

Users browsing this thread: 1 Guest(s)