View previous topic :: View next topic |
Author |
Message |
edgarp
Joined: 18 Jun 2024 Posts: 6
|
example documentation |
Posted: Tue Jun 18, 2024 2:09 pm |
|
|
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: 9232 Location: Greensville,Ontario
|
|
Posted: Tue Jun 18, 2024 5:10 pm |
|
|
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: 1934 Location: Norman, OK
|
|
Posted: Tue Jun 18, 2024 5:50 pm |
|
|
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: 9232 Location: Greensville,Ontario
|
|
Posted: Tue Jun 18, 2024 7:53 pm |
|
|
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: 1934 Location: Norman, OK
|
|
Posted: Tue Jun 18, 2024 7:56 pm |
|
|
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: 19529
|
|
Posted: Wed Jun 19, 2024 1:10 am |
|
|
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
|
|
Posted: Wed Jun 19, 2024 10:31 am |
|
|
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
|
|
Posted: Wed Jun 19, 2024 11:19 am |
|
|
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: 19529
|
|
Posted: Thu Jun 20, 2024 12:35 am |
|
|
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. |
|
|
|