> You can always try Microchip forum which has many more PIC > related topics. > > I do not use PIC24/dsPIC myself. But in the following Microchip forum > thread, I have collected many bootloaders related to PICs. > http://www.microchip.com/forums/m424874.aspx > > This one seems to be quite good (written in assembly). > http://mrmackey.no-ip.org/elektronik/ds30loader/downloads.php > > -- > Xiaofan I had a look at ds30loader, but did not see a linker script, so it's difficult to determine how memory is organized. In my PIC24H bootloaders, I do the following: 0x0000 - goto code in boot section (under 0x200) that checks a switch or whatever else is used to determine if we want to run application or bootload. Between 0x0000 and 0x0200 is bootloader code. All interrupt vectors point to a jump table that starts above 0x0200. 0x0200 - goto application start. This includes stack initialization, variable initialization, etc., as generated by PIC24 C compiler. Right above 0x0200 is the interrupt jump table. The compiler can rewrite this. The bootloader is included in the application project. If I need to send out code to be bootloaded in the field, I use file - export to export a hex file that starts at 0x200. If the bootloader uses a uart, the entire bootloader code is in the space under 0x200. If the bootloader uses TCP, HTTP POST, or USB, the application handles most of the work. It writes to SPI flash as a buffer. When the copy to external flash is complete, the application calls a function in the boot section (under 0x200) that copies the external flash to internal flash, starting at 0x200. Because the application that was used to load the new code is now being overwritten, there is a chance of things going wrong leaving corrupt code in the application area so stuff could not be reloaded. To deal with this problem, I keep a copy of the factory installed code in external flash also. The user can hold down a couple front panel buttons during power up to copy that factory code back in to internal flash (starting at 0x200). I've done a similar thing with the PIC32, putting the boot stuff in the boot flash of the PIC32. Harold --=20 FCC Rules Updated Daily at http://www.hallikainen.com - Advertising opportunities available! --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .