How do I access VTOR in the STM32F107 Rowley Port?

Folks, Am trying to use a stripped down version of the Rowley port of the STM32F107 demo to make a UDP bootlader. I therefore need to access the VTOR register. A search shows that misc.c has functions for changing the value of that register, but once it’s included in the project it tells me it can’t find corecm3.h. If I give the project access to that header, it then tells me that things like #define SCSBASE is redefined and gives errors such as: static declaration of ‘__WFI’ follows non-static declaration __WFI was previously defined in cortexm3_macros.h Does anyone know how I can get access to the VTOR register without all these errors please? I should stress that I’ve been using this demo for a while now with no problems, it’s just this issue of reloacting the vector table that’s the problem! Thanks. :~)

How do I access VTOR in the STM32F107 Rowley Port?

The VTOR register is always in the same place, so you can access it directly. For example, first define the address (you might want to check the actual address in case I have it wrong here): ~~~~

define VTOR ( * ( ( uint32_t * ) 0xE000ED08 ) )

~~~~ Then simply set it to point to whichever vector table you want: ~~~~ VTOR = [address]; ~~~~ Regards, Richard Barry.

How do I access VTOR in the STM32F107 Rowley Port?

Fair enough! Thanks, Richard.

How do I access VTOR in the STM32F107 Rowley Port?

Actually, this has not helped in the long term because I need to access all the flash registers and I’m getting the same errors when I include stm32f10x_flash.h That file accress stm32f10x.h which in turn accesses core_cm3.h and then I get the same errors such as: static declaration of ‘__WFI’ follows non-static declaration __WFI was previously defined in cortexm3_macros.h So, I am still needing to know and understand what goes on with these headers and libraries and what I can do to resolve the issues. Why does this port not access corecm3.h, but does acceess cortexm3macros.h by the way? Thanks!

How do I access VTOR in the STM32F107 Rowley Port?

Why does this port not access corecm3.h, but does acceess cortexm3macros.h by the way?
The port does not access either. As a general rule nothing in the FreeRTOS code, including the portable layer, relies on any third party code that is out of our control. It might be that something in the demo application accesses these header files, and if so it will most likely be the start up code or peripheral drivers which may have originally come from ST. Regards.

How do I access VTOR in the STM32F107 Rowley Port?

Hmmm, there is a file called stm32f10x_conf.h and if I add this line: “#define _FLASH” Then it compiles. There are other similar lines that are there for the other peripherals that exist on this demo (!) (no malice or any snideness was intended in saying port rather than demo, was just a mistake/misunderstanding). I had to also add all the register bit definitions from another project – stuff like FLASHRDPRDP. I guess/assume that because it’s rare to access the flash registers as most programs perhaps don’t need to reprogram on-chip memory, this was missed out of being defined in the stm32f10x_conf.h file.