cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to clear I2C BUSY bit in STM8S-discovery

rgovindappa9
Associate II
Posted on March 01, 2011 at 11:28

Hello Friends,

 I am a newbie to the world of microcontroller programming. I am stuck with a deadlock and am not able to move even a bit. The BUSY bit in I2C.SR3 is set it is not getting freed, according to datasheet it can be set only Hardware, it is also listed in errata list to be solved in future versions. I tried unplugging & plugging the board  again it worked in one or two instances, I am tired of doing this again and again with no success - it is completely undeterministic. Please help my way out

Regards,

Raghavendra

#i2c-busy-bit-set
7 REPLIES 7
saurabh23
Associate II
Posted on July 16, 2011 at 01:47

We too are facing the same problem as you do. We are using STM32F103R8 controller.

We tried to do timeouts and then reset the I2C bus, but that does not help it recover. We first thought it was the slave not responding but it took us a lot of time to find that the controller is the culprit. We see that the I2C is stuck up in the while loop waiting for the ack from the slave (EV6) after sending the slave address on the bus.

Could you please tell us if you have found a soultion to this I2C stuck up in EV6 loop issue.

Tobias Kruehn
Associate II
Posted on October 06, 2017 at 10:56

Hello,

same hiere. I am using a stm8s003 with I2C sometimes the I2C statemachine get stuck. The Osci tells my the same: Address sent but then bus stops. Reducing the bus speed from 100 kHz to 50 Hz helps a bit and reducing the interrupt priority of all other interrupts helps a bit. Looks like a timing issue though.

Nevertheless, sometimes the controller hangs. So far I did not find a solution.

Posted on November 10, 2017 at 01:28

Hi Tobias,

were you be able to solve the BUSY_Flag issue? I have the same problem.

Lucian Romonti
Associate
Posted on April 29, 2018 at 02:09

Hi guys, same thing here. What a piece of crap these STM uC and tools are. I am used with Texas Instruments, Microchip, Renesas. I have 10 years + experience in embedded world both programming and HW design. I tried to give a chance to STM and use it to build a gyro stabilizer for an RC car because it was cheap and i had a few kits laying arround. Tried both STM8S103 and STM8S105 the past 3 days. On 103 somethimes the I2C works but most of the time it does not. On 105 does not pass the busy flag. The ST Visual Develop keeps crashing. The documentation is crap. The support is crap. I am giving up on this. It is a waste of my time. I am going to use a 5 times more expensive uC but at least I am not going to want to smash my computer out of frustrations. Stay away from STM.

henry.dick
Senior II
Posted on April 30, 2018 at 12:15

make sure you follow the datasheet, particularly about EV5/EV6. The SPL is incorrect not in compliance with the datasheet on that. The datasheet however is correct, at least at the standard rate.

I can post a piece of demo code on that if you want.

DClar
Associate

I am getting an intermittent I2C CLK being stuck low when reading from a SEEED multi-channel gas sensor. I'm pretty sure it is the STM8S driving the clock line low, as I have unplugged the slave end and it's still low. I though about trying to find a firmware solution to clear this error and release the CLK line, but the only certain way is to reset the STM8, which is not an ideal solution. I'd prefer to find out why it is doing this... any ideas, anyone?​

I understand your point. I am facing a problem with I2C. First that busy flag which seems to be fixed with a workaround found on first stack exchange and then on ST errata. After, the I2C bus is not able to send the slave address and can't figure out the issue. What a frustrating experience. Haven't got this with other manufacturers. I think I going to give up with ST hardware...