Question
F411 I2C LL Call Hangs
I am using F411 to communicate with ADXL355 through I2C1.
I have a very strange issue:
LL_I2C_GenerateStartCondition(I2C1);
/* (1.3) Loop until Start Bit transmitted (SB flag raised) ********************/
/* Loop until SB flag is raised */
while(!LL_I2C_IsActiveFlag_SB(I2C1)) { }
/* (2.1) Send a 7-Bit SLAVE ADDRESS for a write request because my next step
is also write (putting register address on SDA line). */
LL_I2C_TransmitData8(I2C1, (dev_Addr << 1) | I2C_REQUEST_WRITE);
/* (2.2) Loop until ADDR flag is raised, i.e. address is fully sent */
while(!LL_I2C_IsActiveFlag_ADDR(I2C1)) { }Sometimes the above code hangs at step 2.2 when I change other part of the firmware, which is totally unrelated to this one.
FYI I made my own PCB and run this code on it.
Can anybody give any advice or hint on why it happens?
