diff --git a/drivers/counter/counter_mcux_lptmr.c b/drivers/counter/counter_mcux_lptmr.c index 4e1007d9b4927ca..2ff0cbb5a83ebf9 100644 --- a/drivers/counter/counter_mcux_lptmr.c +++ b/drivers/counter/counter_mcux_lptmr.c @@ -134,9 +134,10 @@ static int mcux_lptmr_init(const struct device *dev) lptmr_config.pinSelect = config->pin; lptmr_config.pinPolarity = config->polarity; } - LPTMR_Init(config->base, &lptmr_config); + LPTMR_SetTimerPeriod(config->base, config->info.max_top_value); + config->irq_config_func(dev); return 0; @@ -205,7 +206,11 @@ static void mcux_lptmr_irq_config_0(const struct device *dev); static struct mcux_lptmr_config mcux_lptmr_config_0 = { .info = { +#if defined(CONFIG_SOC_SERIES_MCXNX4X) + .max_top_value = UINT32_MAX, +#else .max_top_value = UINT16_MAX, +#endif .freq = DT_INST_PROP(0, clock_frequency) / DT_INST_PROP(0, prescaler), .flags = COUNTER_CONFIG_INFO_COUNT_UP,