2007-11-28 05:57 AM
STM32F103 UART I2C problems
2011-05-17 03:16 AM
Hi,
I use i2c1 in master mode, when in receiving process, if run without break, it works fine. But if run the program step by step, it doesn't work. So i use uart1 to print running information, but a new problem comes. After POR(power on reset) the uart1 works fine, but when press the reset button to reset STM32, the TX1 is 1.5V, uart1 doesn't work, (GPIO works fine). When using IAR to debug the program in flash, it works fine when execute IAR RESET command. Can anybody give me some suggestions? Thanks a lot!2011-05-17 03:16 AM
When debugging the i2c library in IAR, you cannot monitor the I2C1 directly in the Registers window. This is because the i2c library acts on specific states of the SR1 and SR2 registers, and these states can be changed just by reading the registers. If IAR reads the registers before the code does, it changes the state, and the i2c code gets locked up.
Also be careful when using the code optimizations. The i2c_ee sample code will not work under some optmizations. I am not sure about your uart problem - I do not have the eval board. Hope this helps