The PIC24F boot loaders have several different special memory regions. Some of these regions are defined by the hardware. Others are part of the boot loader implementation and usage. This section discusses what each of these memory regions are. For more information about how these sections are implemented or how to change them, please refer to the Understanding and Customizing the Boot Loader Implementation section.
The different memory regions are shown below:
1) Reset Vector - the reset vector is defined by the hardware. This is located at address 0x0000. Any reset of the CPU will go to the reset vector. The main responsibility of the reset vector is to jump to the code that needs to be run. In the case of the boot loader, this means jumping to the boot loader code (section 4).
2) The interrupt vector table (IVT) is another section that is defined by the PIC24F hardware. The IVT is a fixed set of addresses that specify where the CPU should jump to in the case of an interrupt event. Each interrupt has it's own vector in the table. When that interrupt occurs, the CPU fetches the address in the table corresponding to that interrupt and jumps to that address.
3) The alternate interrupt vector table (AIVT) behaves just like the IVT. The user must set a bit to select if they are using the IVT or AIVT for their interrupt handling. The IVT is the default. For the current boot loader applications, the AIVT is either used by the boot loader or is not remapped to user space so the AIVT is not available for application use.
4) The boot loader code - This section is where the boot loader code resides. This section handles all of the loading of the new application code.
5) User Remapped Reset Vector - This is a section that is defined by the boot loader. The boot loader must always know how to exit to the application on startup. The User Remapped Reset Vector is used as a fixed address that the boot loader can jump to in order to start an application. The application must place code at this address that starts their application. In the PIC24F implementations this is handled by the application linker file.
6) User Remapped Interrupt Vectors - Since the IVT is located in the boot loader space, the boot loader must remap all of the interrupts to the application space. This is done using the User remapped interrupt vectors. The IVT in the boot loader will jump to a specific address in the User remapped interrupt vector. The User remapped interrupt vector table jumps to the interrupt handler code defined in the user code. In the PIC24F implementations this table is generated by the application linker file and doesn't require any user modifications.
7) The user application code - this is the main application code for the project that needs to be loaded by the boot loader. In the PIC24F implementation, only the application linker file for the specific boot loader needs to be added to the project. No other files are required. No changes or additions are required to the user application code either in order to get the code working.
The boot loader and application linker files provided with the USB Library enforce all of the memory regions specified above. If an application tries to specify an address outside of the valid range, the user should get a linker error.
Separate linker files are required for the boot loader and the application. These linker files generate the material required for several of the different memory regions in the device. Below is a diagram showing which sections of the final device image are created by the linker files. All of the regions of the device are specified within one of the two linker files. This image merely shows where the content for each of those regions is generated.
MLA - USB Library Help Version : 2.16
![]() |