![Pololu P-Star 25K50 Micro Скачать руководство пользователя страница 26](http://html1.mh-extra.com/html/pololu/p-star-25k50-micro/p-star-25k50-micro_user-manual_1574946026.webp)
6. The P-Star Bootloader
The P-Star comes with a proprietary bootloader developed by Pololu that uses a native USB protocol.
The bootloader allows you to read and write the flash and EEPROM memories of the chip without
using an external programmer.
There are two different versions of the P-Star bootloader:
• The
P-Star 25K50 Bootloader
is used on the P-Star 25K50 Micro.
• The
P-Star 45K50 Bootloader
is used on the P-Star 45K50 Mini SV.
These versions are essentially the same, but they have different USB product IDs and different USB
string descriptors.
6.1. Memory organization
Flash memory sections
The bootloader occupies the first 8 KB (8192 bytes) of the PIC microcontroller’s flash memory. The
remaining 24 KB of flash is available for the application. The bootloader places no restrictions on what
data can be written to the application section. However, the bootloader will consider the application to
be invalid and not allow any code in the application section to run if the first word of the application
section (at address 0x2000) is 0xFFFF, which would correspond to a NOP.
Entry and interrupt vectors
The entry vector and interrupt vectors are remapped by the bootloader to the beginning of the
application section:
• The application’s entry vector should be placed at 0x2000. This is the location where code
will start executing when the application is started.
• The high-priority interrupt vector should be at 0x2008.
• The low-priority interrupt vector should be at 0x2018.
The interrupt vectors can be ignored and those locations can hold normal code if interrupts are not
enabled in the application.
The application can start the bootloader by jumping to address 0x0004 using a
goto
instruction. This
method of starting the bootloader does not involve a reset, so the state of the microcontroller matters
and certain configurations could cause problems for the bootloader. For example, an application that
changes the configuration of the system oscillators will most likely have to revert its changes before
starting the bootloader. Also, an application that uses USB should disable the USB module by clearing
USBEN and then wait for at least 100 ms before starting the bootloader, in order to give the computer
Pololu P-Star User’s Guide
© 2001–2019 Pololu Corporation
6. The P-Star Bootloader
Page 26 of 46