CodeWarrior PE Interrupt Vector Table Copy To RAM On Boot

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

CodeWarrior PE Interrupt Vector Table Copy To RAM On Boot

2,344 Views
rickw
Contributor I

I am using CodeWarrior V7.1.2 on a MCF52211 processor.

 

I have been writing a bootloader application for the 52211EVB board and started the application from scratch using PE to setup my initialization code and using beans to configure my interrupts.

 

I require the vector table to be altered after the bootloader has finished flashing the new code and entered it startup function.  I have found on a previous application using CodeWarrior 6.4 framework that the vector table is copied to RAM during hardware init, on the new application using PE framework the cpu.c code does not copy the vector table to RAM??  The VBR reg is set to the RAM area but the RAM area does not contain the vector entries and the program crashes once a interrupt is fired.  PE did create a file called MCU_Init() which does copy the vector table to RAM but if I include this file I get duplicate functions errors with respect to cpu.c.  Both files state they are created by PE and should NOT be edited!!

 

The CPU bean does allow an option for vector table in RAM but if selected PE throws an error stating vector table cannot be placed in RAM for this processor!!

 

Maybe I have missed something as PE is all new to me, hopefully someone can help.

 

Thank You

Rick

Labels (1)
0 Kudos
1 Reply

320 Views
ProcessorExpert
Senior Contributor III

Hello,

 

Interrupts table generation is controlled by the
settings in the CPU component / Build options tab.
There is a RAM/ROM area in the 'ROM/RAM areas group' named 'interrupts'
which contains 'Address' and 'Size' property.
In the '__initialize_hardware' function in CPU.c module there is a code
that configures VBR register to the placement where interrupts are
stored.
These CPU properties are set by default differently for each target -
for INTERNAL_RAM the address is in SRAM, for INTERNAL_FLASH, it's in flash (there
are two preconfigured CPU beans that are automatically switched when the
target changes). Howver, you can adjust the settings manually.
 
The MCU_Init() function is generated by the Device Initialization, which is
another Rapid Application Development tool in CodeWarrior, however, this tool
cannot be used together with Processor Expert.

I'm not sure how your bootloader works, but is should work, if the memory
areas (interrupts, code, data) for the bootloader and downloaded apllication
won't overlap and when you ensure that VBR register will get changed to
the apllication vectors base address when it will jump into the Application.
(PE application does it in the initialiation so if you are bootloading
application produced by PE, it should be fine to jump to it's starting address).

best regards
Petr Hradsky
Processor Expert Support Team

0 Kudos