CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug Reports on this forum. Send them to support@ccsinfo.com

Tiny Bootloader

 
Post new topic   Reply to topic    CCS Forum Index -> Code Library
View previous topic :: View next topic  
Author Message
Matias



Joined: 12 Sep 2005
Posts: 5

View user's profile Send private message

Tiny Bootloader
PostPosted: Fri Jun 02, 2006 8:24 am     Reply with quote

http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm
Code:
///////////////////////////////////////////////////////////////////////////
////                       AppForTiny.H                                ////
////  For CCS-PICCC (PIC C Compiler) by Matias                         ////
////  This include file must be included by any application that       ////
////  is going to be loaded by Tinybootloader (checked in VER 1.91).   ////
////                                                                   ////
////  Tinybootloader 1.9 relocate the reset and interrupt automatically////
////  You have only to reserve space for the bootloader.                ////
////                                                                   ////
////  Probably you'll have problems configuring fuses (especially      ////
////  Code Protect). Modify the ASM file of the bootloader with MPLAB  ////
///////////////////////////////////////////////////////////////////////////
#define MAX_FLASH 0x8000 //for PICs with 32KB of mem

#define LOADER_SIZE   0xFF   //tinybld size + a bit more (200 bytes is enough)

#org MAX_FLASH-LOADER_SIZE , MAX_FLASH-1 void boot_loader(void) {}

VanHauser



Joined: 03 Oct 2005
Posts: 88
Location: Ploiesti, Romania

View user's profile Send private message

PostPosted: Thu Jun 08, 2006 4:24 am     Reply with quote

I have used Tiny Bootloader heavily with 18F452 straight on, without any workarounds in the C code. Just compiled and wrote the resulting hex with the host program. Nothing more. Your solution is indeed useful if the program is large and would overwrite the bootloader, in this case the compiler would issue an error.

As an improvement, you can use the getenv() function to define the flash size automatically for any chip:
Code:
#define MAX_FLASH getenv("PROGRAM_MEMORY")
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> Code Library All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group