Closed nyway closed 6 years ago
@nyway The I2C driver is not capable of handling alternate functions other than AF=4 atm.
I’ll enhance it, probably tonight.
@jflyper Thank you very much.
@nyway PR is ready. Since I don't have the board, you have to test it.
@jflyper Will test immediately
@jflyper One more place i change: bus_i2c_stm32f10x.c
{
.device = I2CDEV_2,
.reg = I2C2,
.sclPins = { DEFIO_TAG_E(PB10), DEFIO_TAG_E(PF1) },
.sdaPins = { _**DEFIO_TAG_E(PB3),**_ DEFIO_TAG_E(PF0) },
.rcc = RCC_APB1(I2C2),
.ev_irq = I2C2_EV_IRQn,
.er_irq = I2C2_ER_IRQn,
},
now CLI mode like this: B03: I2C_SDA 2 B04: MOTOR 1 B05: LED 1 B06: MOTOR 2 B07: MOTOR 3 B08: FREE B09: FREE B10: I2C_SCL 2 But my barometer still not working I'm not very familiar in github
@nyway
I'm not very familiar in github
You have to build your firmware based on the branch: https://github.com/jflyper/cleanflight/tree/bfdev-i2c-allow-exotic-af
If you have a trouble, publish your branch and give me the URL so that I can pull your tagret.[ch], or paste me these files at slack.
@jflyper Got it. I update code from your PR. I2C Pins were configured success.Use CLI Mode can see : B03: I2C_SDA 2 B10: I2C_SCL 2 But my barometer(SDO to GND,slave address 0x76) still not working(I2C). I looking for the cause.
What does set baro
say?
In Betaflight Configurator.Barometer turn on,but Mag icon gray. I will try my compass HMC5883 to confirm if the bmp280 chip trouble
Oh, if you have the baro icon turned on, then baro chip has been detected, so is the I2C is working. You can also use CLI command ‘status’ to confirm the detection.
What I meant by “what does set baro say?” was to use CLI ‘set baro’ to see relevant variables.
Oh, okay :)
sorry im a newbie, im trying to hook up a Beitan BN-880 gps to a Matek f405 -osd obsolete lol. there is no scl or sda pins , can i remap or something to wire up compass for gps. thanks
On my target,just for test,MCU is STM32F411CEU6. I configured the Pin of SCL is PB10,SDA is PB3. I read datasheet of STM32F411xc(Alternate function mapping,page 48), PB10 can use for I2C2_SCL,alternate is AF4, PB3 can use for I2C2_SDA,alternate is AF9. In target.h:
define I2C2_SCL PB10 // SCL pad
define I2C2_SDA PB3 // SDA pad
And compile target success,but in betaflight configurator,CLI mode -resource list-I2C2 configured fail,can't see anything. When I
define I2C2_SCL PB10 // SCL pad
define I2C2_SDA PB11 // SDA pad
CLI mode -resource list,Then i can see I2C2 pins have configured success. I have not enough pin for I2C,how can I use for PB10 and PB3? And if use soft-i2c,could it work? Thanks a lot.(sorry about my English express..)