2015-02-19 01:31 AM
I'm a beginner in stm32Fx. I'm using Keil IDE and cubeMX code generator.
I've used I2C1 and I2C3 in my board with stm32f407 microcontroller and used cubeMX for generating initial codes. I've tried to use I2C3 and it didn't work but I2C1 worked correctly.
I've tested cubeMX code generator in my stmf429 discovery board and the same issue. I2C1 worked and I2C3 didn't work.
I have found a website that has very good libraries with drivers but not as complete as stm's, in that libraries all I2Cs work properly.
Does CubeMX code generator has some problems in I2C or not?
Thank you Best regaurds #auto-corrected-dyslexia #cubemx #i2c-stm32f42015-02-19 04:32 AM
Hi Hamid,
Please explain how exactly I2C3 doesn't work? Is there any error flag set?-Mayla-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.
2015-02-20 05:29 AM
2015-02-20 09:29 AM
Review the pin, perishable and clock configurations of the ''generated'' code. The search space here is relatively contained.
2015-02-20 11:54 AM
Review the pin, perishable and clock configurations of the ''generated'' code. The search space here is relatively contained.
What did I do there, I think Chrome auto-corrected on me, should of course be peripherals.2015-02-20 02:15 PM
Hi,
I had the same problem with I2C3 and STM32F4-Discovery board.The I2C communication reports always bus busy error.I couldnt find any solution for that, I changed to use I2C1 and I2C2.Regards2015-02-20 03:20 PM
I had the same problem with I2C3 and STM32F4-Discovery board. The I2C communication reports always bus busy error.I couldnt find any solution for that, I changed to use I2C1 and I2C2.
Well that does sound like a pin/mux issue, the I2C peripheral is very sensitive to low pins.2015-02-20 11:43 PM
hello i think that is not a board-specific problem because i encountered it with my own board, with a discovery f4 and i've tried to use another microcontroller (a stmf401 nucleo board ) and find out the same problem. clive, have you ever managed to use the i2c3?
what do you mean with sensitive to low pins? my pins stay fixed pull-upped. do you think that i can solve this problem trough software or do i have to patch the board?thank you Giovanni2015-02-21 03:37 AM
What I'm suggesting is that you carefully review the generated code, based on the thread direction, especially the code that programs the AF mux, namely GPIOx_AFRL/H which routes the peripheral function to the pins. Should be AF4 for I2C3
Once clearly identified to ST, I'd expect them to fix it. They want specific illustration, either through the .IOC file, or code fragments. Believe me this saves a lot of time trying to recreate failing cases, however simple they may be appear to be cause. Assume they are busy, the things which are easy to fix will get addressed first, or more quickly. The I2C peripheral is very sensitive to what it thinks it sees at it's pins, this can be impacted in how the peripheral and surrounding pin paths are initialized (ordering/sequence/enablement). If things are muxed to the correct source, etc. If it sees low pin levels, or glitches, from whatever source, it likes to get stuck in the busy state. Compare and contrast generated code for pin/peripheral cases that work against those that fail.2015-02-21 04:10 AM