ICU interrupt not firing Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
hybridA
Posts: 37
Joined: Wed Jan 12, 2022 7:15 am
Has thanked: 10 times
Been thanked: 5 times

ICU interrupt not firing  Topic is solved

Postby hybridA » Mon Dec 25, 2023 8:31 pm

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

User avatar
Giovanni
Site Admin
Posts: 14458
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: ICU interrupt not firing

Postby Giovanni » Mon Dec 25, 2023 10:53 pm

Hi,

Moving in bug reports, some inclusions are missing.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14458
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: ICU interrupt not firing

Postby Giovanni » Tue Dec 26, 2023 12:49 pm

Hi,

Fixed as bug #1280.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 8 guests