I don't want to setup the vector table for all my external interrupts. For instance I only need the timer4 IRQhandler at IRQn 30. How can I make an offset in the table? Is this necessary?
Hi jvanmont,
I'm not sure that the timer4 interrupt is assigned to IRQ30. What is your device? Anyway, if you would like to know the vector offset of IRQ30 of Cortex-M4, it is 0x000000B8. You should at least put the timer4 IRQhandler address into 0x000000B8.
Best regards,
Yasuhiko Koumoto.
yasuhikokoumoto Hi, my device is STM32F429. I think I can assign it in my startup.s but I'm not sure how to assign the address to tim4 IRQHandler.
yasuhikokoumoto very much appreciated. I forgot about the .ALIGN 7. Great.
yasuhikokoumoto Hi, can you explain me the .align 7. I know .align 4 align to a word boundary.
The .align directive is a bit 'unnatural' and very confusing.
in fact, it is based upon the power of two, and it's one directive, which I would like to change the rules for, if I could.
But it is what it is, and it's too late to change it, because it's been like this for more than 15 years already.
To give you a visual overview:
.align /* aligns to the default alignment for your architecture */
.align 1 /* aligns to the next 16-bit boundary (halfword, 2-byte) */
.align 2 /* aligns to the next 32-bit boundary (word, 4-byte) */
.align 3 /* aligns to the next 64-bit boundary (double-word, 8-byte) */
.align 4 /* aligns to the next 128-bit boundary (quad-word, 16-byte) */
.align 5 /* aligns to the next 256-bit boundary (octa-word, 32-byte) */
.align 6 /* aligns to the next 512-bit boundary (hexa-word, 64-byte) */
.align 7 /* aligns to the next 1024-bit boundary (well, eh, 128-byte) */
... and so on.
You can calculate the alignment by (1 << n) ... or if your calculator can handle it: 2 ^ n.
View all questions in Embedded forum