You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the I2cDeviceWithConfig struct in embassy-embedded-hal, but it does not appear to be actually changing the I2C bus frequency. I'm using the bus with the ssd1306 crate to draw to a small display on an STM32F072CB microcontroller.
If I use a plain I2cDevice with the underlying I2C bus configured to 100kHz, it takes about 120ms to write to the device. If I configure the underlying I2C bus to 200kHz, it takes about 60ms (as expected).
However, if I use an I2cDeviceWithConfig set to 200kHz on top of an underlying I2C bus configured for 100kHz, the flush takes 120ms still. It looks like the configuration override isn't happening at all.
I'm using embassy-embedded-hal 0.3.0 and embassy-stm32 0.2.0. It looks like the implementation of this trait has not changed between 0.2.0 and the latest git.
The embassy docs link to v2 of the I2C peripheral for my MCU, but I must admit I don't know if the STM32F072CB uses v1 or v2.
The text was updated successfully, but these errors were encountered:
I had some time to look into this today. From STM's RM0091, PDF page 640, in the section describing the I2C timing register:
Looks like we need to disable the I2C peripheral before touching the timings register. This is what I2c::init does, earlier in the file, and I should just be able to copy that into SetConfig. I'll give that a shot and open a PR if it works.
I'm using the
I2cDeviceWithConfig
struct in embassy-embedded-hal, but it does not appear to be actually changing the I2C bus frequency. I'm using the bus with the ssd1306 crate to draw to a small display on an STM32F072CB microcontroller.If I use a plain
I2cDevice
with the underlying I2C bus configured to 100kHz, it takes about 120ms to write to the device. If I configure the underlying I2C bus to 200kHz, it takes about 60ms (as expected).However, if I use an
I2cDeviceWithConfig
set to 200kHz on top of an underlying I2C bus configured for 100kHz, the flush takes 120ms still. It looks like the configuration override isn't happening at all.I'm using embassy-embedded-hal 0.3.0 and embassy-stm32 0.2.0. It looks like the implementation of this trait has not changed between 0.2.0 and the latest git.
The embassy docs link to v2 of the I2C peripheral for my MCU, but I must admit I don't know if the STM32F072CB uses v1 or v2.
The text was updated successfully, but these errors were encountered: