Skip to main content
DCorn
Associate II
November 11, 2022
Question

STM32H743 jumping to wrong interrupt when I move the vector table when using LPUART

  • November 11, 2022
  • 6 replies
  • 2296 views

I have an application using STM32H743 we wish to use the LPUART using the interrupt. We have a bootloader that is located 0x08000000 until 0x08020200. According to system_stm32h7xx.c we should move the vector table in steps of 0x200 this works for all of our interrupts apart from LPUART.

I have used cube MX to generate a new test project that just enables the LPUART and only has 1 line that send data HAL_UART_Transmit(&hlpuart1,TestData,9,1000); It also crashes. But is the code works if the start is at 0x8020000 or 0x8020400. I have tried 0x8020100 and 0x8020300 they do not work.

Is system_32h7xx.c wrong and the vector table should be in steps of 0x400?

This topic has been closed for replies.

6 replies

TDK
November 11, 2022

> Is system_32h7xx.c wrong and the vector table should be in steps of 0x400?

Correct. Size of vector table is above 0x200 and under 0x400, so it needs to be aligned to 0x400.

https://developer.arm.com/documentation/dui0646/a/Cortex-M7-Peripherals/System-control-block/Vector-Table-Offset-Register?lang=en

"If you feel a post has answered your question, please click ""Accept as Solution""."
Uwe Bonnes
Chief
November 11, 2022

VTOR always needs 10 bit alignment.

ST Technical Moderator
November 14, 2022

Hello @DCorn​,

According to RM0433, the offset address of LPUART global interrupt is 0x0000 0278. So, you should re-locate the vector table to

(150 lines +16 exceptions) *4 = 0x298 > 0x200

So, it should be aligned to the next 0x400 offsets (e.g., 0x08008000, 0x08008400, and so on).

When setting vector offset 0x200, this is aligned with a max of interrupt entries which then includes USART3 interrupt for example but excludes LPUART interrupts.

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL
Piranha
Principal III
November 15, 2022

To get 0x298 you could just look at the address offset of the last interrupt vector 0x294 and add 4 bytes.

DCorn
DCornAuthor
Associate II
November 14, 2022

Hi

Thanks for the replies. I now know why it did not work. I have changed my code to use vector table aligned to 0x400.

Piranha
Principal III
November 15, 2022