Vector Table Mapping Topic is solved

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
jbrandmeyer_bwp

Vector Table Mapping

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Vector Table Mapping

Post 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
jbrandmeyer_bwp

Re: Vector Table Mapping

Post 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.
Post Reply