2022-11-11 03:09 AM
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?
2022-11-11 05:50 AM
> 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.
2022-11-11 06:04 AM
VTOR always needs 10 bit alignment.
2022-11-14 03:33 AM
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.
2022-11-14 04:12 AM
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.
2022-11-14 06:10 PM
For a detailed explanation look there:
https://community.st.com/s/question/0D53W00001MX2bLSAT/strange-interrupt-handler-problem-on-stm32h7
2022-11-14 06:24 PM
To get 0x298 you could just look at the address offset of the last interrupt vector 0x294 and add 4 bytes.