cancel
Showing results for 
Search instead for 
Did you mean: 

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

DCorn
Associate III

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?

6 REPLIES 6
TDK
Guru

> 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
Principal III

VTOR always needs 10 bit alignment.

FBL
ST Employee

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 Accept as Solution on the reply which solved your issue or answered your question.

DCorn
Associate III

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
Chief II

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