Skip to content

Commit b5c7a67

Browse files
ABESTMkartben
authored andcommitted
drivers: i3c: stm32: Fix issue with DAA command
The TXFNF needs to be disabled for additional I3C targets during the DAA process. Otherwise the TX interrupt might be triggered before receiving full PID for target. Signed-off-by: Adam BERLINGER <[email protected]>
1 parent a50dc9f commit b5c7a67

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/i3c/i3c_stm32.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,14 +1090,14 @@ static int i3c_stm32_do_daa(const struct device *dev)
10901090

10911091
if (data->msg_state == STM32_I3C_MSG_ERR) {
10921092
i3c_stm32_clear_err(dev, false);
1093-
/* Enable TXFNF interrupt in case an error occurred before it was enabled by RXFNE
1094-
*/
1095-
LL_I3C_EnableIT_TXFNF(i3c);
10961093
ret = -EIO;
10971094
goto i3c_stm32_do_daa_ending;
10981095
}
10991096

11001097
i3c_stm32_do_daa_ending:
1098+
/* We enable TX interrupt again in any case */
1099+
LL_I3C_EnableIT_TXFNF(i3c);
1100+
11011101
k_mutex_unlock(&data->bus_mutex);
11021102

11031103
return ret;
@@ -1622,6 +1622,11 @@ static void i3c_stm32_event_isr_tx(const struct device *dev)
16221622
dcr = data->pid & 0xFF;
16231623
data->pid >>= 16;
16241624

1625+
/* Disable TXFNF interrupt, the RXFNE interrupt will enable it once all PID bytes
1626+
* are received for next I3C target, or in i3c_stm32_do_daa after frame complete
1627+
*/
1628+
LL_I3C_DisableIT_TXFNF(i3c);
1629+
16251630
/* Find the device in the device list */
16261631
ret = i3c_dev_list_daa_addr_helper(&data->drv_data.attached_dev.addr_slots,
16271632
&config->drv_cfg.dev_list, data->pid, false,

0 commit comments

Comments
 (0)