moving vector table to ram

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

moving vector table to ram

Jump to solution
806 Views
barbercolman
Contributor III

I though by default MQX would have to have the vectors in ram. However, I was reading a note about bootloaders and it talked about setting an option in user_config.h to move the vectors from rom to ram. Could not find this option in user_config.h. So are vectors moved by default or what?

 

Any help?

I have an application that needs a short 1ms timers and so I need to directly access a timer ISR. It works now but I am woried about after bootload process.

0 Kudos
1 Solution
379 Views
DavidS
NXP Employee
NXP Employee

Hi Barber,

The MQX_ROM_VECTOR definition by default has been set to 1 to have the vector table in ROM/Flash.  Setting it to 1 in the user_config.h will over ride the default setting in the twrk60n512.h header in the BSP (this example is for Tower K60 but each BSP has a unigue header in the BSP-->BSP Files folder).

Another thread speaks on this topic:

https://community.freescale.com/message/91476#91476

 

For having a direct interrupt, you need to stick your timer vector in the table (in the same folder listed above and in the vectors.c file).  Then have your ISR have the prefixed __declspec(interrupt).  This case is for running vector table from ROM/Flash.

 

If setting up the vector table for RAM, then your code can insert the vector directly in to the vector table...reference this post:

https://community.freescale.com/message/60097#60097 

 

Hope this helps.

Regards,

David

View solution in original post

0 Kudos
1 Reply
380 Views
DavidS
NXP Employee
NXP Employee

Hi Barber,

The MQX_ROM_VECTOR definition by default has been set to 1 to have the vector table in ROM/Flash.  Setting it to 1 in the user_config.h will over ride the default setting in the twrk60n512.h header in the BSP (this example is for Tower K60 but each BSP has a unigue header in the BSP-->BSP Files folder).

Another thread speaks on this topic:

https://community.freescale.com/message/91476#91476

 

For having a direct interrupt, you need to stick your timer vector in the table (in the same folder listed above and in the vectors.c file).  Then have your ISR have the prefixed __declspec(interrupt).  This case is for running vector table from ROM/Flash.

 

If setting up the vector table for RAM, then your code can insert the vector directly in to the vector table...reference this post:

https://community.freescale.com/message/60097#60097 

 

Hope this helps.

Regards,

David

0 Kudos