How to increase i2c frequency -> no "bus_clk_rate" file to edit?
-
Hello! I'd like to permanently change the I2C frequency of the data from my lsm9ds1 IMU to a higher setting (currently reads at around 638 Hz on the VOXL2 using
rostopic hz /imu_lsm9ds1/imu
, but I find nobus_clk_rate
file in/sys/bus/i2c/devices/i2c-1
(nor in the otherdevices
for that matter) to open and write the desired frequency to (id like it as close to 1000Hz as possible).Is doing so possible; and if so, is there a file to be edited or command to be used for this?
Thanks!
-
Hi! Anyone have an idea how to fix this?
-
This post is deleted! -
Sorry for the lag bruh (your comment got my attention haha
"638 Hz" is not a standard I2C frequency really so I don't think that's what you need to be touching? I2C frequencies are generally 100k/400k (a LOT higher than 638).
Where are you connecting your sensor on VOXL2?
The VOXL 2 architecture has a few processors, the I2C on the 5G modem port is mapped to the applications processor. The I2C we use by default in PX4 is connected to a DSP (image here https://docs.modalai.com/images/voxl2/m0054-px4-block-diagram-0.4.png).
For each driver we've used on the DSP, we've had to make a few small mods to get going. Here's an example of an I2C driver we use on the DSP for talking to a baro:
https://github.com/modalai/px4-firmware/tree/voxl-dev/src/drivers/barometer/icp10100
It's enabled in the build here:
https://github.com/modalai/px4-firmware/blob/voxl-dev/boards/modalai/rb5-flight/qurt.cmake#L55So what I think you likely need to do is modify your lsm9ds1 driver to obtain the rate you want?
-
@modaltb Hey! Thank you for the reply ahaha, I understand its a busy quarter for everyone We are connecting the IMU to the I2C3 pins of the J9 6-pin pinout of the 5G Modem. On other devices (such as the jetson AGX orin) we are able to get a data rate of 928 hz , but on the VOXL its stuck at around 628 Hz in ROS. For the ORIN we were able to increase the rate by modifying a bus_clk_rate file in /sys/bus/i2c/devices/i2c-1 but there appears to be no equivalent here. I found a voxl_i2c_write function in your docs that looks like it could increase I2C bus rate, but unsure how to access and use it. Also tried changing the device tree file to increase the rate ceiling and making a .patch to change it and add changes to kernel_patches but that dropped the rate to 120-ish, and never increased it. Quite confusing! Thanks for your time and have a nice day!