@@ -306,6 +306,7 @@ struct uarte_nrfx_data {
306306#endif 
307307#ifdef  UARTE_ANY_ASYNC 
308308	struct  uarte_async_cb  * async ;
309+ 	nrfx_timer_t  timer ;
309310#endif 
310311	atomic_val_t  poll_out_lock ;
311312	atomic_t  flags ;
@@ -448,7 +449,6 @@ struct uarte_nrfx_config {
448449	size_t  bounce_buf_swap_len ;
449450	struct  uarte_async_rx_cbwt  * cbwt_data ;
450451#endif 
451- 	nrfx_timer_t  timer ;
452452	uint8_t  * tx_cache ;
453453	uint8_t  * rx_flush_buf ;
454454#endif 
@@ -878,7 +878,7 @@ static void uarte_periph_enable(const struct device *dev)
878878#ifdef  UARTE_ANY_ASYNC 
879879	if  (data -> async ) {
880880		if  (HW_RX_COUNTING_ENABLED (config )) {
881- 			const   nrfx_timer_t  * timer  =  & config -> timer ;
881+ 			nrfx_timer_t  * timer  =  & data -> timer ;
882882
883883			nrfx_timer_enable (timer );
884884
@@ -1067,26 +1067,26 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev)
10671067
10681068	if  (HW_RX_COUNTING_ENABLED (cfg )) {
10691069		nrfx_timer_config_t  tmr_config  =  NRFX_TIMER_DEFAULT_CONFIG (
1070- 						NRF_TIMER_BASE_FREQUENCY_GET (cfg -> timer .p_reg ));
1070+ 						NRF_TIMER_BASE_FREQUENCY_GET (data -> timer .p_reg ));
10711071		uint32_t  evt_addr  =  nrf_uarte_event_address_get (uarte , NRF_UARTE_EVENT_RXDRDY );
1072- 		uint32_t  tsk_addr  =  nrfx_timer_task_address_get (& cfg -> timer , NRF_TIMER_TASK_COUNT );
1072+ 		uint32_t  tsk_addr  =  nrfx_timer_task_address_get (& data -> timer , NRF_TIMER_TASK_COUNT );
10731073
10741074		tmr_config .mode  =  NRF_TIMER_MODE_COUNTER ;
10751075		tmr_config .bit_width  =  NRF_TIMER_BIT_WIDTH_32 ;
1076- 		ret  =  nrfx_timer_init (& cfg -> timer ,
1076+ 		ret  =  nrfx_timer_init (& data -> timer ,
10771077				      & tmr_config ,
10781078				      timer_handler );
10791079		if  (ret  !=  NRFX_SUCCESS ) {
10801080			LOG_ERR ("Timer already initialized" );
10811081			return  - EINVAL ;
10821082		}
10831083
1084- 		nrfx_timer_clear (& cfg -> timer );
1084+ 		nrfx_timer_clear (& data -> timer );
10851085
10861086		ret  =  nrfx_gppi_channel_alloc (& data -> async -> rx .cnt .ppi );
10871087		if  (ret  !=  NRFX_SUCCESS ) {
10881088			LOG_ERR ("Failed to allocate PPI Channel" );
1089- 			nrfx_timer_uninit (& cfg -> timer );
1089+ 			nrfx_timer_uninit (& data -> timer );
10901090			return  - EINVAL ;
10911091		}
10921092
@@ -3639,8 +3639,8 @@ static int uarte_instance_deinit(const struct device *dev)
36393639		IF_ENABLED(CONFIG_UARTE_NRFX_UARTE_COUNT_BYTES_WITH_TIMER,     \
36403640			(UARTE_COUNT_BYTES_WITH_TIMER_CONFIG(idx)))	       \
36413641		IF_ENABLED(CONFIG_UART_##idx##_NRF_HW_ASYNC,		       \
3642- 			(.timer = NRFX_TIMER_INSTANCE(			        \
3643- 				CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER),))      \
3642+ 			(.timer = NRFX_TIMER_INSTANCE(NRF_TIMER_INST_GET(       \
3643+ 				CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER)) ,))    \
36443644		IF_ENABLED(INSTANCE_IS_FAST(_, /*empty*/ , idx , _),	       \
36453645			(.clk_dev = DEVICE_DT_GET_OR_NULL(DT_CLOCKS_CTLR(UARTE(idx))), \
36463646			 .clk_spec = {					       \
0 commit comments