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

Questions about 18F4525 WIFI Bootloader

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



Joined: 08 Sep 2008
Posts: 38

View user's profile Send private message

Questions about 18F4525 WIFI Bootloader
PostPosted: Fri Jun 10, 2016 7:16 am     Reply with quote

My WIFI bootloader works, but I do have some concerns. It would be great if someone could look at my #build and #org settings and offer any suggestions since I am not clear on how these directives are to be used. My fear is that although it is working now, at some point if settings are incorrect the bootloader will be damaged by an upload.

This is my header that locates the bootloader in upper memory.

Code:
#define LOADER_ADDR 0xB200
#define FLASH_SIZE getenv("FLASH_ERASE_SIZE") // Smallest number of bytes that can be erased in FLASH
#define LOADER_END ((LOADER_ADDR + FLASH_SIZE - (LOADER_ADDR % FLASH_SIZE)) - 1)
#build(reset=LOADER_END+1, interrupt=LOADER_END + 9)
#org 0, LOADER_END {}


When HEX file data starts arriving over the WIFI a routine is called indirectly. Examples show using an #org directive here, but I cannot without getting an illegal range error. The code works without the #org as shown. What would be the correct way?

Code:
// #ORG LOADER_ADDR  // LOADER_ADDR, LOADER_ADDR + 9
void load_program () {
   hv_loadProgram();
}


This was added after the main function, but I am not sure what it does or if it is correct. The code works with or without it.

Code:
#ORG default
#int_global
void isr () {
   jump_to_isr(LOADER_END+5*(getenv("BITS_PER_INSTRUCTION")/8));
}
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