William Salmon

Results 16 comments of William Salmon

Yep, bluepill I have also tried ```rust let mut i2c = BlockingI2c::i2c1( dp.I2C1, (scl, sda), &mut afio.mapr, Mode::Fast { frequency: 400_000.hz(), duty_cycle: DutyCycle::Ratio2to1, }, clocks, &mut rcc.apb1, 1000, 10, 1000,...

![IMG_20210226_091912](https://user-images.githubusercontent.com/5312786/109282371-5a537f80-7815-11eb-95c3-05bc5d389ecb.jpg) ![IMG_20210226_092149](https://user-images.githubusercontent.com/5312786/109282262-355f0c80-7815-11eb-9f38-df4b93cf5a76.jpg) Sorry for the less good pics. Even tho I have set the i2c to the same settings the starting pulse seems to be different when I change the...

I have spent some time investigating this and its seems that as the clock is increased the value set in i2c_trise i2c_ccr registers should tell the i2c unit how to...

So looking at your code, @LongHairedHacker https://github.com/LongHairedHacker/i2c-test/blob/main/src/main.rs#L67 and the stm32101/2/3/5/7xx reference manual prox page 724/1096 [1] it looks like you need to use fast mode to have 400khz bus speed,...

OOOO, i had lto=true but removing it allowed my i2c to work at higher clocks too, at least for my "genuine" chips but probably for all of mine. Thank you...

As far as i can tell the issue is that both sck32f103xx based blue pills as well as stm32f103xx based blue pills can run i2c at low clocks with lto=true...

> I added #338. Do you think it could be related? In my case setting the system clock to anything, really, panics already. Um, I would recommend using this lib...

> This sounds super interesting and certainly needs more looking into, especially as it differs between opt modes. Out of curiosity, what rust version is this? Could it potentially be...

> > This sounds super interesting and certainly needs more looking into, especially as it differs between opt modes. Out of curiosity, what rust version is this? Could it potentially...

Setting HSE is really important, on the blue pill it's a 8mhz crystal so always set it to 8 MHz in your case. But after that there are a lot...