PICoHolic
Joined: 04 Jan 2005 Posts: 224
|
USB Bootloader header |
Posted: Thu Nov 13, 2008 2:55 am |
|
|
Hey,
Here is a modified USB bootloader header file compatible with the Microchip USB HID bootloader that can be found in the USB framework (to be downloaded from http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2680&dDocName=en537044 ). A PC software is also included.
Just include this H file into your project. It sets the reset address and the ISR.
Code: |
///////////////////////////////////////////////////////////////////////////
//// USB_BOOTLOADER.H ////
//// ////
//// ////
///////////////////////////////////////////////////////////////////////////
//how big is the bootloader?
//the bootloader will reside from address 0x0000 to this location. the
//application will then sit at this location+1 to the end of program memory.
#define LOADER_SIZE (0xFFF)
#define LOADER_START (0)
#define LOADER_END (LOADER_SIZE)
#define APPLICATION_START (LOADER_SIZE+1)
#define APPLICATION_END (getenv("PROGRAM_MEMORY")-1)
#define APPLICATION_ISR (APPLICATION_START+8)
#ifndef _bootloader
//in the application, this moves the reset and isr vector out of the bootload
//space. it then reserves the loader space from being used by the application.
#build(reset=APPLICATION_START, interrupt=APPLICATION_ISR)
#org 0, LOADER_END {}
#endif
|
Enjoy... |
|