Hi,I am using I.MX6Q Sabre sd board (cortex-a9 ). I am trying to build custom image with my own start script and ld script. The image is to be loaded with u-boot. Where should i place the Interrupt vector table? Now, when i reffered the "1.1.0_iMX6_Platform_SDK", The vector table was given as,
vectors: ldr pc, .Lreset_addr ldr pc, .Lundefined_addr ldr pc, .Lswi_addr ldr pc, .Lprefetch_abort_addr ldr pc, .Ldata_abort_addr ldr pc, .Lreserved_addr ldr pc, .Lirq_addr ldr pc, .Lfiq_addr .word 0
and is loaded at "ORIGIN(OCRAM) + LENGTH(OCRAM) - 72", ie at 0x0093ffb8, as,
.ram_vectors (ORIGIN(OCRAM) + LENGTH(OCRAM) - RAM_VECTORS_SIZE) (NOLOAD) : { __ram_vectors_start = .; . += RAM_VECTORS_SIZE; __ram_vectors_end = .; } > OCRAM
and later copied to RAM in start script as,
ldr r1,=__ram_vectors_start ldr r2,=__ram_vectors_end ldr r3,=vectors1: cmp r1,r2 ldmlt r3!,{r4,r5,r6} stmlt r1!,{r4,r5,r6} blt 1b
But when i enable uart interrupt, it does not enter the ISR. Is there any problem with this approach? Where should i place the Interrupt vector table? I am attaching my linker script and the start scripts. This is my first time. Please help.
Note: i am using GNU toolchain(arm-none-eabi-) and not using any IDE.
Hi ajeeshb4u,
I am afraid that you had not changed VBAR (Vector Base Address Register) to point to the __ram_vectors_start.
Best regards,
Yasuhiko Koumoto.
Hi yasuhikokoumoto,
Thank you for your reply.
My vector table is at 0x0093ffb8. I have set the VBAR as,
movw r6,#0xfb80;
movt r6,#0x093f;
MCR p15, 0, r6, c12, c0, 0;
MCR p15, 0, r6, c12, c0, 1;
I have shifted the address by 4 bits. Is this how its supposed to do?
Hi ajeeshb4u ,
No, you should not shift the value.
Instead you should set the value into VBAR without shift.
Also, the VBAR value should be 32 byte aligned. That is, the lower 5 bits should be zero.
Can you try this?
Thanks yasuhikokoumoto. That did the trick.