2023-09-11 02:12 AM
I2C was used in stm32, but
In the picture below, I am using the Write and Read functions, but the error message “busy” appears. Is there a way to resolve this?
I'll post pictures and code together.
Solved! Go to Solution.
2023-09-11 02:21 AM - edited 2023-09-11 02:22 AM
Hello @younginpark ,
Which STM32 board do you use ?
I recommend you to use an oscilloscope to check SDA and SCL behavior.
Foued
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-09-11 02:21 AM - edited 2023-09-11 02:22 AM
Hello @younginpark ,
Which STM32 board do you use ?
I recommend you to use an oscilloscope to check SDA and SCL behavior.
Foued
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-09-11 02:25 AM
Hello @younginpark
I think you have the same problem as in this post. You may need to use external pull-up.
Best regards.
II
2023-09-11 02:32 AM
I currently have SDA and SCL pull-up resistors installed. Is there another reason?
4.7K Resister
2023-09-11 02:47 AM
Probably an I2C STOP command missing somewhere.
2023-09-11 02:49 AM
Could you please explain in detail?
2023-09-11 03:05 AM - edited 2023-09-11 03:06 AM
Typical I2C transfer is:
- master issues I2C start
- master writes command / address byte(s)
- master reads or writes data
- master issues I2C stop
If I2C bus is not stopped correctly, with both SDA and SCL pin in tristate / HI after the last transfer, then I guess that HAL I2C detects that and issues the BUSY error.
Next guess is that in HAL's I2C stop the internal state is reset from BUSY to IDLE, so if stop is not sent, then bus and state are still busy.
Edit: Check with a scope, especially bus state after last transfer