Putting vector table in RAM

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

Putting vector table in RAM

2,358 Views
vrg6
Contributor I

Hello all,

I am currently working on a project that uses a mcuboot and application on the same flash memory. So far everything is working fine, but I have ran into a problem. The application uses MQX and has a special start of file signature that it needs for mcuboot configuration parameters. This is the same spot as the vector table. 

I was pointed to this guide that said to set MQX_ROM_VECTORS to 0 and compile. It appears that the vector reset table is no longer at 0 and is getting put in the RAM area, but when I try to program my board I get the following error .

pastedImage_1.png

When I don't have MQX_ROM_VECTORS set to 0 and have a base version of the project, everything programs and builds just fine.

Attached is the linker file I am using. 

How do I get the vector table into RAM?

Labels (1)
0 Kudos
Reply
1 Reply

2,161 Views
soledad
NXP Employee
NXP Employee

Hi, 

Typically you don't put vector table directly to RAM for internal flash targets. The vector table is located physically in internal flash in non-volatile memory and the startup code makes a copy from flash to RAM. 

In general with the supported toolchain, all need is to build BSP and PSP with #define MQX_ROM_VECTORS 0.

 

In user configuration of your board user_config.h:

 

#define MQX_ROM_VECTORS 0 

#define BSPCFG_ENABLE_ITTYF 1   

#define BSP_DEFAULT_IO_CHANNEL "ittyf:"  

 

Build MQX libraries. Then build /mqx/examples/hello2 application for internal flash Debug target. Load hello2 executable to MCU and run.

I break in idle task, in debugger I can see Cortex-M4 VTOR = 0x1FFF0000. At address 0x1FFF0000 I can see vector table, most of vectors point to _int_kernel_isr().

 

Please let me know if this helps,

have a nice day!

Soledad

0 Kudos
Reply