Page 1 of 1

ICU interrupt not firing

Posted: Mon Dec 25, 2023 8:31 pm
by hybridA
Not sure if this belongs in bug reports instead, but I have issues with ICU on my board.
There's a total of 2 ICU channels, one using Timer 8(ch1), and the second one using Timer 15(ch1). The channel using Tim8 works as expected, but Tim15 ICU callback never fires. I checked for hardware pitfalls.
This is part of a ported design that also runs on F405 and works well there.
Current MCU is H735*

Code: Select all

static void icuperiodcb_in1(ICUDriver *icup) {
    ICU1_ISR_Handler(0, icuGetPeriodX(icup));
}

/**
 * CH1 (TIM8_CH1)
*/
static ICUConfig icu1cfg = {
    .mode = ICU_INPUT_ACTIVE_LOW,
    .frequency = FIFTY_MHZ,
    .width_cb = nullptr,
    .period_cb = icuperiodcb_in1,
    .overflow_cb = nullptr,
    .channel = ICU_CHANNEL_1,
    .dier = 0U,
    .arr = 0xFFFFFFFFU,
};

static void icuperiodcb_in2(ICUDriver *icup) {
    ICU2_ISR_Handler(0, icuGetPeriodX(icup));
}

/**
 * CH2 (TIM15_CH1)
*/
static ICUConfig icu2cfg = {
    .mode = ICU_INPUT_ACTIVE_LOW,
    .frequency = FIFTY_MHZ,
    .width_cb = nullptr,
    .period_cb = icuperiodcb_in2,
    .overflow_cb = nullptr,
    .channel = ICU_CHANNEL_1,
    .dier = 0U,
    .arr = 0xFFFFFFFFU,
};

palSetPadMode(GPIOJ, 8, PAL_MODE_ALTERNATE(3)); // tim8, ch1
palSetPadMode(GPIOE, 5, PAL_MODE_ALTERNATE(4)); // tim15, ch1
icuStart(&ICUD8, &icu1cfg);
icuStart(&ICUD15, &icu2cfg);
icuStartCapture(&ICUD8);
icuStartCapture(&ICUD15);
icuEnableNotifications(&ICUD8);
icuEnableNotifications(&ICUD15);


icuperiodcb_in2() never gets called

Re: ICU interrupt not firing

Posted: Mon Dec 25, 2023 10:53 pm
by Giovanni
Hi,

Moving in bug reports, some inclusions are missing.

Giovanni

Re: ICU interrupt not firing

Posted: Tue Dec 26, 2023 12:49 pm
by Giovanni
Hi,

Fixed as bug #1280.

Giovanni