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

example documentation

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



Joined: 18 Jun 2024
Posts: 6

View user's profile Send private message

example documentation
PostPosted: Tue Jun 18, 2024 2:09 pm     Reply with quote

I am working to make a bootloader using interrupts and I came across this line in one of the examples provided by CCS (bootloader.c)

#build(share_interrupts)// allows both programs to receive interrupts

does anyone knows exactly what did does?
I was not able to find any references in google or the manual


Thanks in advance for any help.
Edgar
temtronic



Joined: 01 Jul 2010
Posts: 9160
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Jun 18, 2024 5:10 pm     Reply with quote

Interesting and I'm curious too !

The bootloader would be THE program running and once it's completed, then the loaded program would be THE running program...
so.....
only one or the other CAN run
not sure how they could share interrupts.....
dyeatman



Joined: 06 Sep 2003
Posts: 1923
Location: Norman, OK

View user's profile Send private message

PostPosted: Tue Jun 18, 2024 5:50 pm     Reply with quote

Interesting. What version of CCS C are you using?
I have searched every file in the latest version and cannot find that line
and there is no reference to that in any documentation I can find.
_________________
Google and Forum Search are some of your best tools!!!!
temtronic



Joined: 01 Jul 2010
Posts: 9160
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Jun 18, 2024 7:53 pm     Reply with quote

hmm... historically, CCS examples were prefaced as EX_program.c so I wonder if it's another compiler or someone's modified version of the CCS bootloader ?
dyeatman



Joined: 06 Sep 2003
Posts: 1923
Location: Norman, OK

View user's profile Send private message

PostPosted: Tue Jun 18, 2024 7:56 pm     Reply with quote

I specifically checked ex_bootloader.c and that line is not in it that I could find.
That looks interestingly like some stuff in QNX that I have worked with.
_________________
Google and Forum Search are some of your best tools!!!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19326

View user's profile Send private message

PostPosted: Wed Jun 19, 2024 1:10 am     Reply with quote

That's in the API.ZIP archive with the examples.
It helps handle the re-vectoring (actually done by the #INT_GLOBAL in
this code). Creates a separate vector table, that can be called by this
routine. So it doesn't do the sharing for you, just makes it easier by
creating the separate table.
edgarp



Joined: 18 Jun 2024
Posts: 6

View user's profile Send private message

PostPosted: Wed Jun 19, 2024 10:31 am     Reply with quote

dyeatman wrote:
Interesting. What version of CCS C are you using?
I have searched every file in the latest version and cannot find that line
and there is no reference to that in any documentation I can find.


I am using version 5.116
edgarp



Joined: 18 Jun 2024
Posts: 6

View user's profile Send private message

PostPosted: Wed Jun 19, 2024 11:19 am     Reply with quote

Ttelmah wrote:
That's in the API.ZIP archive with the examples.
It helps handle the re-vectoring (actually done by the #INT_GLOBAL in
this code). Creates a separate vector table, that can be called by this
routine. So it doesn't do the sharing for you, just makes it easier by
creating the separate table.


thank you for the input, I am bit confused.
if it allows for multiple vector tables, why does the code seem to be using the vector table from the application? from lines 31- 35 of the example.

wouldn't this break the bootloader's interrupts if the application is corrupted?

where did you find the information about share_interrupts?
Ttelmah



Joined: 11 Mar 2010
Posts: 19326

View user's profile Send private message

PostPosted: Thu Jun 20, 2024 12:35 am     Reply with quote

If you look at the bootloader, it creates the jump to the offset ISR handler:
Code:

#int_default
void default_isr(void) {
   if(app_running)
      jump_to_isr(LOADER_END+5*(getenv("BITS_PER_INSTRUCTION")/8));
}

So it jumps to the ISR handler _inside the application code_.

The 'shared_interrupt' flag can be done in other ways. If you specify
the address for the interrupts in the build, the compiler does the same
relocation. It is just a 'shorthand' for this.
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