Page 1 of 1

Vector Table Mapping

Posted: Fri May 30, 2014 11:44 pm
by jbrandmeyer_bwp
I see that the STM32F4 port supports remapping the NVIC vector table by re-defining CORTEX_VTOR_INIT, located in ARMCMx/STM32F4xx/cmparams.h. However, I would like to re-define this variable on a per-project basis. Due to the order of inclusion, re-defining it in chconf.h or with a compiler -D directive will not override the definition of this macro. Can the definition in cmparams.h be changed to a default definition? Ie,

Code: Select all

#ifndef CORTEX_VTOR_INIT
#define CORTEX_VTOR_INIT 0x00000000
#endif


This way, it can be re-defined in chconf.h.

Re: Vector Table Mapping

Posted: Sat May 31, 2014 7:30 am
by Giovanni
Hi,

It is not located in cmparams.h, it is located in chcore_v7m.h as follow:

Code: Select all

/**
 * @brief   NVIC VTOR initialization expression.
 */
#if !defined(CORTEX_VTOR_INIT) || defined(__DOXYGEN__)
#define CORTEX_VTOR_INIT                0x00000000
#endif


You just need to add

Code: Select all

#define CORTEX_VTOR_INIT                0x00000000


to chconf.h or as a -Dxxx in your makefile.

Giovanni

Re: Vector Table Mapping

Posted: Sat May 31, 2014 9:24 pm
by jbrandmeyer_bwp
Well, the egg is on my face. I think I made that modification (moving the definition from chcore_v7m.h to chparams.h) in my local copy.