2022-06-01 07:36 AM
Hi, I have a problem where my basic master send data code stuck at the generate start condition function. I am using STM32F302R8,
based on the reference manual, the flow chart stated that SET the I2C_CR2.START.
Then, inside my code, here is my basic code to send the data.
When it goes to inside MasterSendData(), It stuck in the GenerateStartCondition function.
Here is inside the GenerateStartCondition function and the start bit is register number 13.
But, after it finish executing the I2C_GenerateStartCondition, the register I2C_CR2_START does not SET, But, it looping inside the startup file of stm32f302r8 from CopyDataInit to LoopCopyDataInit as shown below.
So, I dont know what is the cause of this problem. Am I missing something in the setup? Hope someone can help me on this
2022-06-01 08:00 AM
Isn't there a short, which causes the mcu to reset when it pulls down SDA/SCK?
JW
2022-06-01 08:04 AM
The looping in the startup means the mcu reset? And it is because a short circuit? If there is a short circuit, why it happen during the generate start condition only? Not from the beginning of the program?
2022-06-01 09:06 AM
That was just a tip. You can check it using an ohmmeter. You can also check it using oscilloscope, measuring NRST, and/or power supply.
JW
2022-06-01 03:39 PM
So the looping in the startup file is indicating what condition usually?