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

24FJ128GA106 bootloader

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ljbeng



Joined: 10 Feb 2004
Posts: 205

View user's profile Send private message

24FJ128GA106 bootloader
PostPosted: Wed Aug 31, 2011 4:17 pm     Reply with quote

I have a bootloader from CCS that works great from a pc serial port to bootload a 24FJ128GA106.

I then modifed their example to work with a VNC1L-1A usb interface. This interfaces the serial port to files on a thumb drive.

The only modifcations I made were in the area the standard bootloader was sending xon/xoff, I am sending a request to read the next byte. I read an entire line of hex code, write it to the chip, then start requesting more data from the VNC1L.

I can get the file from the usb thumb drive to boot load once but the chip will not bootload again. The app will always run once bootloaded.

The file size is 1886 bytes with the code I had to add to enable the vnc1l and set it up to work for this application.

The newly bootloaded application will run after bootloaded. If I try to boot load again, the chip is basically dead and nothing happens. If I then just reset the chip, the bootloaded program runs again. It's like the chip knows I want to bootload again, it just does nothing.

Code:
///////////////////////////////////////////////////////////////////////////
////                 pcd_bootloader_stand_alone.h                      ////
////                                                                   ////
////  This include file must be included by any application loaded     ////
////  by the example bootloader (ex_pcd_bootloader_stand_alone.c).     ////
////                                                                   ////
////  The directives in this file relocates the reset vector as well   ////
////  as reserving space for the bootloader.                           ////
///////////////////////////////////////////////////////////////////////////
////        (C) Copyright 1996,2009 Custom Computer Services           ////
//// This source code may only be used by licensed users of the CCS    ////
//// C compiler.  This source code may only be distributed to other    ////
//// licensed users of the CCS C compiler.  No other use,              ////
//// reproduction or distribution is permitted without written         ////
//// permission.  Derivative programs created using this software      ////
//// in object code form are not restricted in any way.                ////
///////////////////////////////////////////////////////////////////////////

#ifndef __BOOTLOADER_H__
   #define __BOOTLOADER_H__
   
   #define __BOOTLOADER_INCLUDED__ TRUE
   
   #if (getenv("PROGRAM_MEMORY")%0x100==0)
      #define LOADER_SIZE   0x7FF
   #elif ((getenv("PROGRAM_MEMORY")+4)%0x100==0)
      #define LOADER_SIZE   0x7FB
   #elif ((getenv("PROGRAM_MEMORY")+8)%0x100==0)
      #define LOADER_SIZE   0x7F7   //This is the correct size to use for this PIC.  This was also incorrect in our example.
   #endif
   #endif
   
#if (getenv("FLASH_ERASE_SIZE")==2048)
   #define RESET_VECTOR    0x200
#else
   #define RESET_VECTOR    0x100
#endif
   
//BOOTLOADER AT END
// LOADER_END - This is the end of the general purpose bootload code.
#ifndef LOADER_END
   #define LOADER_END      (getenv("PROGRAM_MEMORY")-1)
   #define LOADER_ADDR     (LOADER_END-LOADER_SIZE)
#endif

#ifndef _bootloader
   #build (reset=RESET_VECTOR)
   #org LOADER_ADDR, LOADER_END {}
#endif

#ifdef _bootloader
   //#include "loader_pcd_stand_alone.c"//if serial port bootloader
   #include "gps_5_loader_usb.c"//if usb boot loader
#endif
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion 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