Wrong code generated on dual-core stm32h747, M4 side
I want to generate an interrupt on the rising edge of PI0 on the M4 CPU.
Unfortunately, when I program the GPIO With ARM Cortex-M4 pin context assignment, the code generated is as follows in gpio.c:
EXTI_InitStruct.Line_0_31 = LL_EXTI_LINE_0;
EXTI_InitStruct.Line_32_63 = LL_EXTI_LINE_NONE;
EXTI_InitStruct.Line_64_95 = LL_EXTI_LINE_NONE;
EXTI_InitStruct.LineCommand = ENABLE;
EXTI_InitStruct.Mode = LL_EXTI_MODE_IT;
EXTI_InitStruct.Trigger = LL_EXTI_TRIGGER_RISING;
LL_EXTI_Init(&EXTI_InitStruct);and in stm32h7xx_it.c:
void EXTI0_IRQHandler(void)
{
...
if (LL_EXTI_IsActiveFlag_0_31(LL_EXTI_LINE_0) != RESET)
{
LL_EXTI_ClearFlag_0_31(LL_EXTI_LINE_0);
...But this is incorrect because while both init + IRQ executes on the M4, it programs the M7 interrupts delivery.
The correct way to make it work is to replace the following is the code above:
LL_EXTI_MODE_IT => LL_EXTI_MODE_C2_IT
LL_EXTI_IsActiveFlag_0_31() => LL_C2_EXTI_IsActiveFlag_0_31
LL_EXTI_ClearFlag_0_31 => LL_C2_EXTI_ClearFlag_0_31
