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 CCS Technical Support

solved: Bootloader - remove or relocate startup code
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ttelmah



Joined: 11 Mar 2010
Posts: 20145

View user's profile Send private message

PostPosted: Sat Sep 26, 2026 11:02 am     Reply with quote

Er.

For PCH (PIC18), needs to be:
Code:

#fuses NONE
#build (reset=0x800, interrupt=0x0808)
#org 0x0000, 0x07FF{}


The loader_end+5 address is for PCM (PIC16's).
vtrx



Joined: 11 Oct 2017
Posts: 151

View user's profile Send private message

PostPosted: Fri Oct 02, 2026 6:09 pm     Reply with quote

I'm having a problem with the low-priority interrupt.
It isn't executing as it should.

Code:
#define APP_INICIO   0x10C0
#build (reset=APP_INICIO, interrupt=APP_INICIO + 0x0008)
//#build(reset=0x10C0:0x10C7, interrupt=0x10C8:0x10FF)
#org 0x0000,APP_INICIO - 1{}


In the bootloader:
Code:
#define ENDERECO_APP 0x10C0
#define FLASH_FIM   0x8000   // p

#int_global
void high_isr_vector(void)
{
   #asm
   //GOTO ENDERECO_APP + 0x0008  //
   GOTO 0x10C8
   #endasm
}

#org 0x0018, 0x0027
void low_isr_vector(void) 
{
    #asm
    //GOTO ENDERECO_APP + 0x018   //
    GOTO 0x10D8
    #endasm
}


The registers are programmed with the correct values; the problem lies in the main application—it seems CCS isn't routing low-priority interrupts correctly.
vtrx



Joined: 11 Oct 2017
Posts: 151

View user's profile Send private message

PostPosted: Sat Oct 03, 2026 6:44 pm     Reply with quote

I decided to place the bootloader at the end of the flash memory; this way, the main application can be compiled normally without modifications, making things easier.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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