diff --git a/drivers/i2s/i2s_nrfx.c b/drivers/i2s/i2s_nrfx.c index e1b3684c4f7..aced4db9693 100644 --- a/drivers/i2s/i2s_nrfx.c +++ b/drivers/i2s/i2s_nrfx.c @@ -226,6 +226,10 @@ static void free_rx_buffer(struct i2s_nrfx_drv_data *drv_data, void *buffer) static bool supply_next_buffers(struct i2s_nrfx_drv_data *drv_data, nrfx_i2s_buffers_t *next) { + uint32_t block_size = (drv_data->active_dir == I2S_DIR_TX) + ? drv_data->tx.cfg.block_size + : drv_data->rx.cfg.block_size; + drv_data->last_tx_buffer = next->p_tx_buffer; if (drv_data->active_dir != I2S_DIR_TX) { /* -> RX active */ @@ -236,6 +240,8 @@ static bool supply_next_buffers(struct i2s_nrfx_drv_data *drv_data, } } + next->buffer_size = block_size / sizeof(uint32_t); + LOG_DBG("Next buffers: %p/%p", next->p_tx_buffer, next->p_rx_buffer); nrfx_i2s_next_buffers_set(drv_data->p_i2s, next); return true; @@ -661,10 +667,10 @@ static int start_transfer(struct i2s_nrfx_drv_data *drv_data) : drv_data->rx.cfg.block_size; nrfx_err_t err; + initial_buffers.buffer_size = block_size / sizeof(uint32_t); drv_data->last_tx_buffer = initial_buffers.p_tx_buffer; - err = nrfx_i2s_start(drv_data->p_i2s, &initial_buffers, - block_size / sizeof(uint32_t), 0); + err = nrfx_i2s_start(drv_data->p_i2s, &initial_buffers, 0); if (err == NRFX_SUCCESS) { return 0; } diff --git a/modules/hal_nordic/nrfx/nrfx_config_common.h b/modules/hal_nordic/nrfx/nrfx_config_common.h index 28a3a15b0de..88a1a8b95e8 100644 --- a/modules/hal_nordic/nrfx/nrfx_config_common.h +++ b/modules/hal_nordic/nrfx/nrfx_config_common.h @@ -18,7 +18,7 @@ /** @brief Symbol specifying minor version of the nrfx API to be used. */ #ifndef NRFX_CONFIG_API_VER_MINOR -#define NRFX_CONFIG_API_VER_MINOR 2 +#define NRFX_CONFIG_API_VER_MINOR 3 #endif /** @brief Symbol specifying micro version of the nrfx API to be used. */