Vector Table

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vector Table

2,218 Views
NeedHelp
Contributor I
Hi there!
I have various functions called Boot, SMBus_Init, SMBus_Process, etc. Unless I know the size of each function I can not stack them one top of another and keep track of the exact location where each function starts.
I know a better way of doing this is to use a jump table and know how to do it in SiLabs IDE. I was wondering if you guys know a way of doing this in CodeWarrior. Right now it is in SiLabs IDE format.

CSEG    AT      0x007B
EXTRN   CODE (Boot)  // tells the linker that Boot is an external function - go look for it.
EXTRN   CODE (SMBus_Init)
EXTRN   CODE (SMBus_Process)
AJMP        Boot // jump to Boot. Instruction stored at x7b
AJMP        SMBus_Init  //jump to SMBus_Init. Instruction stored at 0x7d. Jump instructions take 2 code                                                 //spaces.
AJMP        SMBus_Process // jump to SBus_Process. Instruction stored at 0x7f

If you give me a hint on how to do this in CodeWarrior, I can make constant function pointer calls to envoke my functions from outside the bootloader project.
typedef void (* ConstFunctPtr)(void);
ConstFunctPtr FunctPtr;
FunctPtr = (ConstFunctPtr)(HARD_CODED_ADDRESS_LOCATION);
FunctPtr();

I can think of a way to get around this but am not entierly happy with myself. One way of doing this would be creating one lined functions for making calls and stacking them on top of another. Then in the linker I could put these one lined functions at fixed addresses probably separating them by 4-5 address locations.
void CallBoot(void){
Boot();
}

Thanks guys/gals! And thanks for all your help in the past as well!

Labels (1)
Tags (1)
0 Kudos
Reply
2 Replies

846 Views
trytohelp
NXP Employee
NXP Employee
Hi,
 
Humm. I think this will be investigated by Technical team.
The better way will be to log it directly in the Technical support system.
Please use Freescale on line support web page.
  - Go to following URL: http://www.freescale.com/TechSupport
  - Click on Submit a Service Request. You will come to a login page.
  - You can submit your request through the web from there.
 
Pascal
0 Kudos
Reply

846 Views
NeedHelp
Contributor I
Thank you Pascal, the Service Request team is working on my request.
G'day mate.
0 Kudos
Reply