Moving EXTI Interrupt line from Mode-Button to D0

Hi everyone,

We have multiple devices in the field that need interrupt capability on Pin D0 which has a shared EXTI-Line with the Mode-/Setup-Button.

We dig deep into System-Firmware and found some different functions that setup up Interrupts for Mode-Button. We tried to deactivate it and set EXTI-Line to Port-Group of Pin D0.

But we had no success at all.

We are looking for help to move that Interrupt to D0 since we are working with a final designed PCB and have no chance to change layout currently.

Many thanks in advance!

Let me ping someone that might be able to help, @rickkas7 or @ParticleD are you able to assist?

We know exactly where the problem - or lets say - where the part lies:

void EXTI9_5_IRQHandler(void)
{
    if (EXTI_GetITStatus(EXTI_Line5) != RESET)
    {
        /* Clear the EXTI line pending bit */
        EXTI_ClearITPendingBit(EXTI_Line5);

        HAL_EXTI_Handler(5);
    }

    if (EXTI_GetITStatus(EXTI_Line6) != RESET)
    {
        /* Clear the EXTI line pending bit */
        EXTI_ClearITPendingBit(EXTI_Line6);

        HAL_EXTI_Handler(6);
    }

    if (EXTI_GetITStatus(EXTI_Line7) != RESET)
    {
        Handle_Mode_Button_EXTI_irq(BUTTON1);
    }

    if (EXTI_GetITStatus(EXTI_Line8) != RESET)
    {
        /* Clear the EXTI line pending bit */
        EXTI_ClearITPendingBit(EXTI_Line8);

        HAL_EXTI_Handler(8);
    }

    if (EXTI_GetITStatus(EXTI_Line9) != RESET)
    {
        /* Clear the EXTI line pending bit */
        EXTI_ClearITPendingBit(EXTI_Line9);

        HAL_EXTI_Handler(9);
    }
}

This part should be extended so that DO can be used as a normal Interrupt Handler:

    if (EXTI_GetITStatus(EXTI_Line7) != RESET)
    {
        Handle_Mode_Button_EXTI_irq(BUTTON1);
    }

We have tried extending it, overwriting parts of the System Firmware or setting Manual handlers but without any success.

The only way to handle this is a fork of the system firmware or a release candidate like 0.8.0-rc.10 … which has HAL_Interrupts_Trigger() exported.

Yes, the only solution is to use a modified version of system firmware.

Since D0 is listed in the docs as not being able to be used for interrupts it’s not likely to be a high priority for an official change to system firmware, unfortunately.

3 Likes

@rickkas7 -> Yes we know that this is stated in the docs. We hadn’t intended to use D0 as an interrupt pin but after having devices in the field the customer had changed his mind.

We exposed JTAG Connector on our devices and the short fix is to map D0 to one of the free JTAG pins by applying / soldering a bridge between those two. But this makes it necessary to exchange devices that are already in the field and we were trying to prevent that.