Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
2
answers
203
views
how do I find the current i2c bus speed?
I am building custom game controllers on Linux that use the i2c bus present in video ports such as HDMI, dvi, and VGA, on standard PC hardware (x86_64). I would like to verify my current i2c bus speed settings, and maybe change them. As I would understand it, this would be a setting of a Linux kerne...
I am building custom game controllers on Linux that use the i2c bus present in video ports such as HDMI, dvi, and VGA, on standard PC hardware (x86_64).
I would like to verify my current i2c bus speed settings, and maybe change them.
As I would understand it, this would be a setting of a Linux kernel driver, though I haven't figured it out yet, so maybe I'm way off on this.
So what I tried is:
lsmod | grep i2c
i2c_algo_bit 16384 1 i915
i2c_i801 36864 0
i2c_smbus 20480 1 i2c_i801
ok the i2c_algo_bit is the device I am using (I think), looked at i2c_smbus also.
modinfo i915
modinfo i915 | grep -i "baud \| freq \| hz \| rate \| speed"
I tried reading the module info for i2c-i801, and i915
but I don't see anything indicative of the currently set bus speed. I2c, (DDC) has several possible settings, from 50kHz to 400kHz. I would like to set it to 400kHz if it is not already set to that.
How do I verify the frequency of the i2c bus? and how do I change it?
j0h
(3949 rep)
Apr 27, 2025, 05:52 PM
• Last activity: Apr 27, 2025, 08:40 PM
0
votes
1
answers
148
views
Customized Linux system cannot recognize i2c?
When I use `ubuntu22.04`, I use `i2c-tools` to identify that my current i2c adapter is a Synopsys DesignWare I2C adapter. However, when I use the Linux kernel `6.1` compiled by myself and load the two modules `i2c-ccgx-ucsi.ko` and `i2c-designware-pci.ko`, the adapter cannot be recognized. Is there...
When I use
ubuntu22.04
, I use i2c-tools
to identify that my current i2c adapter is a Synopsys DesignWare I2C adapter. However, when I use the Linux kernel 6.1
compiled by myself and load the two modules i2c-ccgx-ucsi.ko
and i2c-designware-pci.ko
, the adapter cannot be recognized. Is there a problem? I am currently using the x86 platform.
on ubuntu22.04:
gyz@gyz-IELKQD01B:~$ sudo i2cdetect -l
i2c-1 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-2 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-3 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-4 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-5 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-6 i2c Synopsys DesignWare I2C adapter I2C adapter
i2c-7 i2c i915 gmbus dpa I2C adapter
i2c-8 i2c i915 gmbus dpb I2C adapter
i2c-9 i2c i915 gmbus dpc I2C adapter
i2c-10 i2c i915 gmbus tc1 I2C adapter
i2c-11 i2c i915 gmbus tc2 I2C adapter
i2c-12 i2c i915 gmbus tc3 I2C adapter
i2c-13 i2c i915 gmbus tc4 I2C adapter
i2c-14 i2c i915 gmbus tc5 I2C adapter
i2c-15 i2c i915 gmbus tc6 I2C adapter
i2c-16 i2c AUX B/DDI B/PHY B I2C adapter
Vimer
(67 rep)
Feb 20, 2025, 09:43 AM
• Last activity: Feb 20, 2025, 11:03 AM
1
votes
0
answers
21
views
Adding MCP23017 to device-tree and accessing ICs connected to expander
I try access multiple ICs via I2C over the MCP23017 I/O Expander for a custom embedded board. I know ICs I2C adresses. *How should I add the MCP23017 to the device-tree?* I think I need to add the ICs as **child nodes** under MCP2301 in device-tree, but I don't know how to do it. There are a device-...
I try access multiple ICs via I2C over the MCP23017 I/O Expander for a custom embedded board. I know ICs I2C adresses.
*How should I add the MCP23017 to the device-tree?*
I think I need to add the ICs as **child nodes** under MCP2301 in device-tree, but I don't know how to do it.
There are a device-tree example below. Will Linux detect the ICs when implemented this way? What is the easiest way to access ICs?
&i2c1 {
clock-frequency = ;
pinctrl-names = "default";
pinctrl-0 = ;
status = "okay";
/* mcp23017 I2C IO Expander */
gpio_ex3: gpio_mcp@20 {
compatible = "microchip,mcp23017";
gpio-controller;
#gpio-cells = ;
reg = ;
status = "okay";
};
alpd4
(35 rep)
Feb 6, 2025, 02:03 PM
• Last activity: Feb 6, 2025, 02:22 PM
2
votes
2
answers
1519
views
Ubuntu 24.04 System Instability After BIOS Update: Random reboots
I’ve been experiencing significant system instability on my Ubuntu 24.04 machine after a recent BIOS update. The system randomly resets itself, and the logs show various errors. I’m hoping to get some guidance on how to troubleshoot and resolve these issues. **System Information:** -----------------...
I’ve been experiencing significant system instability on my Ubuntu 24.04 machine after a recent BIOS update. The system randomly resets itself, and the logs show various errors. I’m hoping to get some guidance on how to troubleshoot and resolve these issues.
**System Information:**
-----------------------
- **OS**: Ubuntu 24.04 (Previously Ubuntu 22.04 with the same issue)
- **Kernel**: 6.8.0-40-generic
- **Motherboard**: Gigabyte Z790 GAMING X AX DDR5 LGA1700 (Rev 1.1)
- **CPU**: Intel i7-13700k
- **BIOS Version**: Updated to F11d (latest) from Gigabyte’s website due to issues with microcode for 13th and 14th generation Intel processors. The problem started after updating to F11c, and F11d did not resolve it.
- **Dual Boot**: Windows and Ubuntu (Issue does not appear on Windows, at least not yet)
**Issue Description:**
----------------------
Since updating the BIOS, my system has been crashing randomly, and the logs are filled with various errors. I’ve tried resetting the BIOS to its default settings, but the issue persists. The crashes occur at random moments, even when the system is idle, with no applications running. Here’s a snapshot of the errors occurring shortly after boot:
$journalctl --since "2024-08-14 12:15:00" --until "2024-08-14 12:34:00" -p 0..3
sie 14 12:16:17 BMO kernel: i2c i2c-1: Invalid 7-bit I2C address 0xffff
sie 14 12:16:18 BMO kernel: iwlwifi 0000:00:14.3: WRT: Invalid buffer destination
sie 14 12:16:18 BMO kernel:
sie 14 12:16:19 BMO kernel: Bluetooth: hci0: Malformed MSFT vendor event: 0x02
sie 14 12:16:19 BMO bluetoothd: profiles/sap/server.c:sap_server_register() Sap driver initialization failed.
sie 14 12:16:19 BMO bluetoothd: sap-server: Operation not permitted (1)
sie 14 12:16:29 BMO gdm-password]: gkr-pam: unable to locate daemon control file
sie 14 12:16:32 BMO systemd: Failed to start app-gnome-gnome\x2dkeyring\x2dpkcs11-2688.scope - Application launched by gnome-session-binary.
sie 14 12:16:32 BMO systemd: Failed to start app-gnome-gnome\x2dkeyring\x2dsecrets-2685.scope - Application launched by gnome-session-binary.
sie 14 12:16:32 BMO systemd: Failed to start app-gnome-gnome\x2dkeyring\x2dssh-2682.scope - Application launched by gnome-session-binary.
sie 14 12:16:32 BMO systemd: Failed to start app-gnome-snap\x2duserd\x2dautostart-2942.scope - Application launched by gnome-session-binary.
sie 14 12:16:32 BMO systemd: Failed to start app-gnome-user\x2ddirs\x2dupdate\x2dgtk-2950.scope - Application launched by gnome-session-binary.
sie 14 12:16:33 BMO kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
sie 14 12:16:33 BMO kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
sie 14 12:16:33 BMO kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
sie 14 12:16:33 BMO kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
sie 14 12:16:33 BMO kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
sie 14 12:16:33 BMO kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
sie 14 12:16:33 BMO kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
sie 14 12:16:33 BMO kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
sie 14 12:16:33 BMO kernel: [drm:nv_drm_master_set [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to grab modeset ownership
Troubleshooting Steps Taken So Far:
-----------------------------------
- **I2C**: Running i2cdetect -y -r 1 shows a device at address 0x48, but the Invalid 7-bit I2C address 0xffff error persists.
sudo i2cdetect -y -r 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
- **WiFi**: The Intel WiFi card (iwlwifi 0000:00:14.3: WRT: Invalid buffer destination) continues to show errors even with updated drivers.
- **Bluetooth**: Reinstalling bluez did not resolve the Bluetooth errors related to malformed MSFT vendor events.
- **GNOME Keyring**: Multiple GNOME Keyring components fail to start, affecting other system processes.
- **NVIDIA DRM**: The DRM module for NVIDIA (nv_drm_master_set) fails to grab modeset ownership, potentially causing graphical instability.
- **Memtest86+**: Passed without errors, so RAM issues are unlikely.
- **Temperatures**: I’ve been monitoring component temperatures closely, and none of them appear to be overheating.
Additional Information:
-----------------------------------
- **Dual Boot**: I have a dual-boot setup with Windows, and this issue does not occur on Windows (at least, not yet).
- **BIOS Reset**: I’ve reset the BIOS to its default settings, but the issue persists.
- **Random Ubuntu reboots**: The system reboot itself randomly, even when idle with no applications running.
- **Previous Ubuntu Version**: The problem started on Ubuntu 22.04 after the BIOS update, so I reinstall to Ubuntu 24.04, but the issue remains.
Request for Help:
-----------------------------------
I’m looking for:
- Guidance on identifying which of these errors might be causing the system resets.
- Could the BIOS update have introduced hardware or firmware incompatibilities with the current Ubuntu kernel?
- What steps can I take to isolate whether this is a hardware or software issue?
Has anyone encountered similar issues post-BIOS update, and if so, how were they resolved? Any insights or suggestions would be greatly appreciated!
Thank you in advance!
Terixer
(21 rep)
Aug 14, 2024, 09:17 AM
• Last activity: Sep 26, 2024, 05:36 PM
1
votes
0
answers
247
views
Does udev have an issue with the 'hwmon' subsystem?
I have a temp/humidity sensor connected to the `i2c-0` interface on a Raspberry Pi: Rpi OS ver 'bookworm'. It works fine, and I can read sensor values from the files in `/sys/class/hwmon/hwmon2` (or equivalently in `/sys/bus/i2c/devices/0-0044/hwmon/hwmon2` or `/sys/devices/platform/soc/3f205000.i2c...
I have a temp/humidity sensor connected to the
i2c-0
interface on a Raspberry Pi: Rpi OS ver 'bookworm'. It works fine, and I can read sensor values from the files in /sys/class/hwmon/hwmon2
(or equivalently in /sys/bus/i2c/devices/0-0044/hwmon/hwmon2
or /sys/devices/platform/soc/3f205000.i2c/i2c-0/0-0044/hwmon/hwmon2
) using a bash script:
#!/usr/bin/bash
dev_folder='/sys/class/hwmon/hwmon2'
humid_r=$(To minimize the risk of breaking users of sysfs, which are in most cases low-level userspace applications, with a new kernel release, the users of sysfs must follow some rules to use an as-abstract-as-possible way to access this filesystem. The current udev and HAL programs already implement this and users are encouraged to plug, if possible, into the abstractions these programs provide instead of accessing sysfs directly.
I take this to mean that instead of accessing the sensor data directly from sysfs
- as I'm currently doing in my bash script - I should be using udev
.
I've also read a bit on udev
. *My current understanding of udev
* is that **one way** udev
might help me is to *"translate"* the **variable** sysfs
folder name into a **fixed** one (or at least a fixed symlink). This is apparently done on the basis of .rule
files that contain a series of *device attributes* used as *filters* (aka **match keys**), followed by a *command* (aka **assignment key**). The *device attributes* I used were selected from the [output of this command](https://pastebin.com/VGLxA5vp) :
bash
udevadm info --attribute-walk --path=/sys/bus/i2c/devices/0-0044/hwmon/hwmon2
I created the following udev
*rule file*:
# filename: /etc/udev/rules.d/80-local.rules
ACTION=="add", SUBSYSTEM=="hwmon", ATTR{name}=="sht3x", KERNELS=="0-0044", SUBSYSTEMS=="i2c", NAME="sht30", SYMLINK+="i2c_sht3x"
This rule was derived from a variety of sources, and guesswork using a *trial-and-error* approach. The *filtering* part of the rule seems to work: I've tested the rule using a script to create a /tmp
file. However, the NAME="sht30"
and SYMLINK+="i2c_sht3x"
fails to create a corresponding entry in my /dev
folder as I expected (hoped) it would.
I've also tried *variants* of this rule that attempted to create a symlink in sysfs
; i.e. /sys/class/hwmon/hwmon_sht3x
. But this didn't work either - it seems the symlinks are restricted to the /dev
folder?? And I've looked at man udevadm
for something I overlooked, but found nothing that helped me.
Persistence often pays, and so I modified the above rule as follows:
# filename: /etc/udev/rules.d/80-local.rules
ACTION=="add", SUBSYSTEM=="hwmon", ATTR{name}=="sht3x", KERNELS=="0-0044", SUBSYSTEMS=="i2c", RUN+="/bin/sh -c 'ln -s /sys$devpath /dev/hwmon_sht3x'"
```
And this rule actually works! (so far at least): It creates the symlink /dev/hwmon_sht3x
to /sys/devices/platform/soc/3f205000.i2c/i2c-0/0-0044/hwmon/hwmon2
- **OR** to the folder currently assigned by the kernel. I've tested it several times by forcing a change to hwmonX
, and it (so far) hasn't failed.
So, the question is:
#### Why will the matching rule not create the SYMLINK+="i2c_sht3x"
?
Seamus
(3772 rep)
Jun 6, 2024, 11:50 PM
• Last activity: Jun 7, 2024, 05:43 PM
1
votes
1
answers
33
views
How remove/debug Stylus Asus pen which sends events every time laptop starts since is disabled
Week ago stylus have been added somehow between devices (I do not have own stylus for few months) and spam me with events every time laptop starts: ``` $ sudo libinput debug-events | grep event5 -event5 DEVICE_ADDED ELAN9009:00 04F3:2E36 seat0 default group5 cap:t size 300x184mm ntouches 10 calib -e...
Week ago stylus have been added somehow between devices (I do not have own stylus for few months) and spam me with events every time laptop starts:
$ sudo libinput debug-events | grep event5
-event5 DEVICE_ADDED ELAN9009:00 04F3:2E36 seat0 default group5 cap:t size 300x184mm ntouches 10 calib
-event5 TOUCH_DOWN +69.894s 0 (0) 85.20/92.85 (255.67/170.92mm)
event5 TOUCH_FRAME +69.894s
-event5 TOUCH_UP +69.909s 0 (0)
event5 TOUCH_FRAME +69.909s
-event5 TOUCH_DOWN +96.373s 0 (0) 85.23/92.89 (255.75/171.00mm)
event5 TOUCH_FRAME +96.373s
event5 TOUCH_UP +96.387s 0 (0)
event5 TOUCH_FRAME +96.387s
-event5 TOUCH_DOWN +115.360s 0 (0) 85.20/93.12 (255.67/171.42mm)
event5 TOUCH_FRAME +115.360s
-event5 TOUCH_UP +115.374s 0 (0)
event5 TOUCH_FRAME +115.374s
-event5 TOUCH_DOWN +129.771s 0 (0) 85.23/92.98 (255.75/171.17mm)
event5 TOUCH_FRAME +129.771s
event5 TOUCH_UP +129.786s 0 (0)
event5 TOUCH_FRAME +129.786s
-event5 TOUCH_DOWN +138.171s 0 (0) 85.23/92.76 (255.75/170.75mm)
So every laptop restart is device added.
Quick solution was every laptop start call:
$ xinput disable "ELAN9009:00 04F3:2E36
$ xinput disable "ELAN9009:00 04F3:2E36 Stylus
$ xinput # when are devices disabled
...
∼ ELAN9009:00 04F3:2E36 id=9 [floating slave]
∼ ELAN9009:00 04F3:2E36 Stylus id=10 [floating slave]
...
$ cat /proc/bus/input/devices
I: Bus=0018 Vendor=04f3 Product=2e36 Version=0100
N: Name="ELAN9009:00 04F3:2E36"
P: Phys=i2c-ELAN9009:00
S: Sysfs=/devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-ELAN9009:00/0018:04F3:2E36.0001/input/input19
U: Uniq=
H: Handlers=mouse0 event5
B: PROP=2
B: EV=1b
B: KEY=400 0 0 0 0 0
B: ABS=3273800000000003
B: MSC=20
And now I try figure out what happened and how permanently remove this unreal device. Any idea?
ldrahnik
(11 rep)
Mar 27, 2024, 08:49 AM
• Last activity: Mar 27, 2024, 02:27 PM
1
votes
1
answers
271
views
x86 ACPI SSDT for I2C device
I'm trying to register I2C gpio expander (PCF8575) on Odroid H3+/Ubuntu 22.04 using ACPI SSDT so later I can easly assign each GPIO as led and use nice names for toggling pins. I have following SSDT table: ``` DefinitionBlock ("gpio-expander.aml", "SSDT", 1, "Vendor", "Accel", 0x00000004) { External...
I'm trying to register I2C gpio expander (PCF8575) on Odroid H3+/Ubuntu 22.04 using ACPI SSDT so later I can easly assign each GPIO as led and use nice names for toggling pins. I have following SSDT table:
DefinitionBlock ("gpio-expander.aml", "SSDT", 1, "Vendor", "Accel", 0x00000004)
{
External (\_SB.PC00.I2C0, DeviceObj)
Scope (\_SB.PC00.I2C0)
{
Device (PCF0)
{
Name (_CID, "PRP0001")
Name (_DDN, "GPIO-Expander")
Name (_ADR, 0x0020)
Name (_DSD, Package ()
{
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package ()
{
Package () { "compatible", Package() { "nxp,pcf8575" } },
}
})
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (0x0F)
}
Name (_CRS, ResourceTemplate()
{
I2cSerialBusV2 (
0x20,
ControllerInitiated,
100000,
AddressingMode7Bit,
"\\_SB.PC00.I2C0",
0x00
)
})
}
}
}
(loaded using GRUB or acpi_configfs - effect is the same), there is node appearing in /sys in correct place but for same, unknown to me, reason kernel is not assigning any driver. if I add device using echo "pcf8575 0x20" > ../new_device
driver is assigned correctly, so it should also assign it using ACPI
I tried different variations: with or without _ADR
, _CRS
being method or not.
Novakov
(111 rep)
Aug 9, 2023, 03:46 PM
• Last activity: Aug 9, 2023, 05:00 PM
1
votes
0
answers
212
views
Register I2C RTC on x86 platform
I'm trying to register an I2C RTC device on an x86 platform. I've disabled the PC-Style CMOS driver because I'm on an embedded platform and only my I2C RTC is properly backed up. Now when I load the RV3028 kernel module, no `/dev/rtc` is registered. To see if the probe function of the module is call...
I'm trying to register an I2C RTC device on an x86 platform.
I've disabled the PC-Style CMOS driver because I'm on an embedded platform and only my I2C RTC is properly backed up.
Now when I load the RV3028 kernel module, no
/dev/rtc
is registered. To see if the probe function of the module is called, I added some printk
to the probe function, but no kernel messages appear when I load the module with modprobe
.
On ARM platforms, I need to define devices in the devices tree, but there are no device trees for x86 platforms.
The RV3028 kernel module has no parameters to specify the bus number or the I2C address.
What is the correct way to register an I2C RTC on an X86 platform without device trees?
Davi Jones
(11 rep)
Jun 10, 2022, 10:01 AM
• Last activity: Jun 21, 2023, 10:07 AM
0
votes
0
answers
83
views
Giving www-data access to i2c
I have a light sensor that uses I2C for data transmision. Now I want to display that data on a Website. The problem is `www-data` can't access I2C. I use a Python script that gets run by PHP (I know it's not the best idea) and it throws ``` ERROR: "PermissionError: [Errno 13] Permission denied" ```...
I have a light sensor that uses I2C for data transmision. Now I want to display that data on a Website.
The problem is
www-data
can't access I2C. I use a Python script that gets run by PHP (I know it's not the best idea) and it throws
ERROR: "PermissionError: [Errno 13] Permission denied"
I tried giving the script 777 and gave the file to www-data
. Nothing changed.
What can I do?
Bhasim
(1 rep)
Mar 6, 2023, 09:34 AM
• Last activity: Mar 15, 2023, 04:03 PM
1
votes
0
answers
150
views
Read data from LIS2DE12 accelerometer
I am trying to read the acceleration data in the X, Y and Z axes from the [LIS2DE12][1] accelerometer which is connected to an I2C-to-USB adapter, it is [UMFT201XB][2]. I am using a virtual machine in VirtualBox whose operating system is a lubuntu 20.04.5 LTS. I was planning to read it directly from...
I am trying to read the acceleration data in the X, Y and Z axes from the LIS2DE12 accelerometer which is connected to an I2C-to-USB adapter, it is UMFT201XB .
I am using a virtual machine in VirtualBox whose operating system is a lubuntu 20.04.5 LTS. I was planning to read it directly from the linux terminal without using any kind of C program as I found on this website but /sys/bus/iio... directories do not exist for me. I have also read in other posts like this where the user @Ashutosh said that the UMFT201XB adapter has the FT201X chipset so it only has I2C slave functionality and since the accelerometer is another slave, you can't initialize the communication.
In VirtualBox, the USB device is being detected as when I run the
I get the following output:
$ dmesg
usb 1-1: new full-speed USB device number 6 using ohci-pci
usb 1-1: New USB device found, idVendor=0403, idProduct=6015, bcdDevice=10.00
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: UMFT201XB
usb 1-1: Manufacturer: FTDI
usb 1-1: SerialNumber: FT5BIUOL
ftdi_sio 1-1:1.0: FTDI USB Serial Device converter detected
usb 1-1: Detected FT-X
usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0
This way I know it's in located in /dev/ttyUSB0
but I've been trying tools like screen or stty but I don't get any results. Neither when using cat or tail to read the output.
**EDIT 1**
After some research i found this entrance on FT201X datasheet:
> Please note that the FT200XD and FT201X are I2C slave devices only and
> should be interfaced to an I2C host (often in a microcontroller or
> FPGA). If an I2C master is required, please see the FT232H, FT2232H,
> FT4232H and FT2232D devices.
So I decided to look for devices with those chipsets. They all have MPSSE interface so I don't really know where the SDA and SCL pins are but, I managed to find a picture of UM232H device which indicated where these pins are, SDA being a short between AD1 and AD2 and, SCL being the AD0 pin. So, my question now is a bit different... before I buy anything is this device good for the application I want to do?
Escris
(11 rep)
Mar 7, 2023, 08:30 AM
• Last activity: Mar 13, 2023, 03:19 PM
3
votes
2
answers
993
views
i2c port change randomly
I'm using an Up squared computer. I connect a device via the i2c port in the HAT connector. When using `i2cdetect` I detect the same device (identified by the address) on different ports. Changes occur between reboots. To my understanding, I may be able to resolve this by setting a rule in `etc/udev...
I'm using an Up squared computer.
I connect a device via the i2c port in the HAT connector.
When using
i2cdetect
I detect the same device (identified by the address) on different ports. Changes occur between reboots.
To my understanding, I may be able to resolve this by setting a rule in etc/udev/rules.d
, but I'm not sure how to do this. Specifically, I'm not sure how to filter the sensor to create the rule.
The kernel
I see is i2c-2
, but I wonder if this will change on the next reboot.
LAR marine
(31 rep)
Jul 28, 2021, 12:40 PM
• Last activity: Nov 15, 2022, 09:18 AM
2
votes
0
answers
604
views
How to configure an I2c Controller in the PS of the Zynq 7000 as a slave from Linux
I am using a zed board with a Zynq 7000 on it. The end goal is to have the I2c-0 controller in the physical PS of the Zynq7000 to act as an I2c slave device. I am using yocto/bitbake to generate linux images for my device. So far, I have been able to map my I2c-0 device SDA and SCK lines to physical...
I am using a zed board with a Zynq 7000 on it. The end goal is to have the I2c-0 controller in the physical PS of the Zynq7000 to act as an I2c slave device.
I am using yocto/bitbake to generate linux images for my device. So far, I have been able to map my I2c-0 device SDA and SCK lines to physical pins on the zed board. I have overwritten the zynq-7000.dtsi with my own device tree to enable the i2c0 device.
From the linux shell of my board, I can see the i2c device with "i2cdetect -l" which gives the following output:
root@zed-board:~# i2cdetect -l
i2c-0 i2c Cadence I2C at e0004000 I2C adapter
From a simple hello.c program I can use
#include
#include
#include
to write data with the i2c master and I can see the data coming out of my pins.
However, I have no idea how to configure this device as a slave. I can see from the cadence i2c driver code https://github.com/torvalds/linux/blob/master/drivers/i2c/busses/i2c-cadence.c
that slave mode is supported. I used the kernel configuration menu from yocto to enabled i2c slave support then added that config to my image so it should be enabled.
I just don't know what i need to do so that from a user space application I can put the device into slave mode and register the callbacks for slave events.
Any help is much appreciated.
alexv9
(21 rep)
May 13, 2022, 02:38 PM
• Last activity: May 13, 2022, 03:36 PM
0
votes
1
answers
2975
views
Is there any difference between #include <linux/ioctl.h> and #include <sys/ioctl.h>?
I have to write a device driver code for temperature sensor using IOCTL, when I was going through a lot of sample codes, I found while surfing the net, I came across this difference in header file, I counldn't get an accurate answer for it, hence I'm posting it here, hoping that I may get a lead to...
I have to write a device driver code for temperature sensor using IOCTL, when I was going through a lot of sample codes, I found while surfing the net, I came across this difference in header file, I counldn't get an accurate answer for it, hence I'm posting it here, hoping that I may get a lead to work with my code.
hari
(9 rep)
May 3, 2022, 07:01 AM
• Last activity: May 3, 2022, 08:36 AM
1
votes
1
answers
1659
views
i2cdetect addresses 7-bit or 8-bit?
Are the addresses reported by `i2cdetect` 7-bit or 8-bit I2C addresses? My hope is the more general 7-bit address. I'm starting to run some experiments, but it would be nice if the [manpages](http://manpages.ubuntu.com/manpages/bionic/en/man8/i2cdetect.8.html) were a bit more explicit about the repo...
Are the addresses reported by
i2cdetect
7-bit or 8-bit I2C addresses? My hope is the more general 7-bit address.
I'm starting to run some experiments, but it would be nice if the [manpages](http://manpages.ubuntu.com/manpages/bionic/en/man8/i2cdetect.8.html) were a bit more explicit about the reported format.
$ sudo i2cdetect -y 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- 1d -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- 61 -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
tarabyte
(4506 rep)
May 24, 2021, 09:12 PM
• Last activity: Feb 15, 2022, 11:09 AM
0
votes
0
answers
335
views
i2c bus not seen on debian
I have a single board computer with debian jessie installed on it. On this board, there is 2 RTC. One that is not backed up that correspond to rtc-cmos and the other one that is backed up and is accessible by i2c bus. With a i2cdetect -l I obtain only : i2c-0 smbus SMBus I801 adapter at 4000 SMBus a...
I have a single board computer with debian jessie installed on it.
On this board, there is 2 RTC. One that is not backed up that correspond to rtc-cmos and the other one that is backed up and is accessible by i2c bus.
With a i2cdetect -l I obtain only :
i2c-0 smbus SMBus I801 adapter at 4000 SMBus adapter
I thought that normally i will have another line with i2c-1 etc...
How can i know that the i2c bus is activated ?
Do I need to load a specific kernel module or do I need a driver ?
Thanks in advance for any hints
naeco
(1 rep)
Jan 6, 2022, 12:54 PM
1
votes
0
answers
547
views
How is simultaneous i2c bus access handled by Linux kernel?
I have two sensors with different slave addresses connected on an i2c bus in my custom board. If two different programs try to read the different sensors a same moment of time, will it lead to an contention in i2c subsystem for Linux kernel? I tried doing that on the board with both the sensors but...
I have two sensors with different slave addresses connected on an i2c bus in my custom board. If two different programs try to read the different sensors a same moment of time, will it lead to an contention in i2c subsystem for Linux kernel?
I tried doing that on the board with both the sensors but was not able to produce the contention. And didn't find any definitive documentation which suggest either way.
Is there any document which explains how a simultaneous read call to different slave address on a given i2c bus is handled by Linux kernel?
skjoshi
(151 rep)
Nov 16, 2021, 04:25 PM
• Last activity: Nov 16, 2021, 05:35 PM
1
votes
0
answers
452
views
Unable to enable TLV320AIC3104 codec driver /simple sound card for iMx8M with SAI2 BCLK/MCLK provided with external clock
I am trying to access codec driver (TLV320AIC3104) connected to iMX8M over I2C3 and SAI2 lines. The codec clocks bclk is 4096000 and it is provided from an FPGA and its mclk is grounded. iMx8M SOM SAI2 BCLk& MCLK is connected to clock line provided by FPGA and it frequency is 4.096 Mhz.Unable to reg...
I am trying to access codec driver (TLV320AIC3104) connected to iMX8M over I2C3 and SAI2 lines. The codec clocks bclk is 4096000 and it is provided from an FPGA and its mclk is grounded. iMx8M SOM SAI2 BCLk& MCLK is connected to clock line provided by FPGA and it frequency is 4.096 Mhz.Unable to register simple sound card or the driver get enabled. I have to configure the CODEC in tdm mode with 16 slots and capture audio at 16khz.
Here is my dts file changes
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "tdm-audio";
simple-audio-card,format = "tdm";
simple-audio-card,routing =
"Headphone Jack", "HPOUTL",
"Headphone Jack", "HPCOMR",
"IN2L", "Line In Jack",
"IN2R", "Line In Jack",
"IN1L", "Mic Jack",
"Playback", "CPU-Playback",
"CPU-Capture", "Capture";
status = "okay";
simple-audio-card,cpu {
sound-dai = ;
dai-tdm-slot-num = ;
dai-tdm-slot-width = ;
};
simple-audio-card,codec {
audio-codec = ;
clocks = ;
clock-names = "bclk";
};
};
pinctrl_i2c3: i2c3grp {
fsl,pins = ;
};
pinctrl_sai2: sai2grp {
fsl,pins = ;
};
&i2c3 {
clock-frequency = ;
pinctrl-names = "default";
pinctrl-0 = ;
status = "okay";
codec: tlv320aic3x@18 {
/* ai3x-micbias-vg = ; */
compatible = "ti,tlv320aic3104";
reg = ;
/* gpio-reset = ; */
#sound-dai-cells = ;
clocks = ;
clock-names = "bclk";
AVDD-supply = ;
IOVDD-supply = ;
DRVDD-supply = ;
DVDD-supply = ;
status = "okay";
};
};
And also I have updated
Makefile
and added imx-tlv320aic3x.c
in sound/soc/fsl
and patched clk-imx8mm.c
for CLK_EXT3
+ pr_info("i.MX*MM clock driver before setting CLK_EXT3");
+ clk_set_parent(clks[IMX8MM_CLK_SAI2_ROOT], clks[IMX8MM_CLK_EXT3]);
+ pr_info("i.MX*MM clock driver after setting CLK_EXT3");
I am getting the following error
OF: /sound/simple-audio-card,cpu: could not get #sound-dai-cells for /sai@30020000
asoc-simple-card sound: parse error -22
asoc-simple-card: probe of sound failed with error -22
clk: failed to reparent sai2_root_clk to audio_pll1_out: -22
Any help or guidance to update the dts appropriately to get the codec working is appreciated.
user480313
(11 rep)
Sep 7, 2021, 07:06 PM
• Last activity: Sep 8, 2021, 06:30 AM
0
votes
0
answers
132
views
When ever new i2c device(slave) is inserted/poweredON, kernel/host has to detect slave device dynamically just like USB. How to achieve it?
The power conditions are that the i2c device(slave) is powered off and the host controller is on. And kernel module should be loaded while booting. When ever new i2c device(slave) is inserted/poweredON, kernel has to detect slave device dynamically just like USB. How to write a device driver or kern...
The power conditions are that the i2c device(slave) is powered off and the host controller is on. And kernel module should be loaded while booting.
When ever new i2c device(slave) is inserted/poweredON, kernel has to detect slave device dynamically just like USB. How to write a device driver or kernel module for this?. Is there any method to achieve these? Please help me i am new to this driver programing. Thanks
HarshaFeliz
(1 rep)
Aug 17, 2021, 10:42 AM
0
votes
0
answers
385
views
How to Change VL53L0X(TOF) sensor I2C address using c language on BeagleBone Black
Aim: To read Data from 4 VL53L0X(TOF) sensors using I2C communication in C language on BeagleBone Black Board (Debian OS). I have implement c code for a single VL53L0X(TOF) sensor which is: *https://github.com/bitbank2/VL53L0X* From the Above Link : ``` #include #include #include #include #include /...
Aim: To read Data from 4 VL53L0X(TOF) sensors using I2C communication in C language on BeagleBone Black Board (Debian OS).
I have implement c code for a single VL53L0X(TOF) sensor which is: *https://github.com/bitbank2/VL53L0X*
From the Above Link :
#include
#include
#include
#include
#include // time of flight sensor library
int main(int argc, char *argv[])
{
int i;
int iDistance;
int model, revision;
// For Raspberry Pi's, the I2C channel is usually 1
// For other boards (e.g. OrangePi) it's 0
i = tofInit(2, 0x29, 1); // 2=I2CBus, 0x29 i2c slave address, 1 = long range.
if (i != 1)
{
return -1; // problem - quit
}
printf("VL53L0X device successfully opened.\n");
i = tofGetModel(&model, &revision);
usleep(50000); // 50ms
printf("Model ID =%d,\n", model);
printf("Revision ID =%d,\n", revision);
for (i=0; i<1200; i++) // read values 20 times a second for 1 minute
{
iDistance = tofReadDistance();
if (iDistance < 4096) // valid range?
printf("Distance = %dmm\n", iDistance);
usleep(50000); // 50ms
}
return 0;
} /* main() */
But My Application is to work with **4** VL53L0X(TOF) sensor.
Or another way to code in c to get the solution.
Thank you.
Raj Mehta
(36 rep)
Jun 23, 2021, 06:31 AM
• Last activity: Jun 24, 2021, 11:49 AM
1
votes
1
answers
2030
views
hwmon: add missing kernel module
**TL;DR:** The kernel module sht3x (https://www.kernel.org/doc/html/latest/hwmon/sht3x.html) seems to be missing in a standard debian installation. I need it in order to read an external sensor. How can I install this kernel module? **The whole story** I try to connect an SHT31 temperature/humidity...
**TL;DR:**
The kernel module sht3x (https://www.kernel.org/doc/html/latest/hwmon/sht3x.html) seems to be missing in a standard debian installation. I need it in order to read an external sensor. How can I install this kernel module?
**The whole story**
I try to connect an SHT31 temperature/humidity sensor to my Debian notebook. In order to do so, I flashed an ATTiny85 micro controller to act as [i2c-tiny-usb](https://github.com/harbaum/I2C-Tiny-USB) interface.
I got this part working -
lsusb
lists the device as
Bus 003 Device 003: ID 0403:c631 Future Technology Devices International, Ltd i2c-tiny-usb interface
and I also get a promising response from i2cdetect
$ sudo i2cdetect -l
i2c-3 i2c i915 gmbus dpc I2C adapter
i2c-1 i2c i915 gmbus vga I2C adapter
i2c-8 i2c i2c-tiny-usb at bus 001 device 017 I2C adapter
i2c-6 i2c AUX B/port B I2C adapter
i2c-4 i2c i915 gmbus dpb I2C adapter
i2c-2 i2c i915 gmbus panel I2C adapter
i2c-0 i2c i915 gmbus ssc I2C adapter
i2c-7 i2c AUX D/port D I2C adapter
i2c-5 i2c i915 gmbus dpd I2C adapter
$ sudo i2cdetect 8
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-8.
I will probe address range 0x08-0x77.
Continue? [Y/n] Y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- 45 -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
However, I cannot read sensor data, because the kernel module sht3x is not installed on my (standard Debian) system and is not listed in lsmod
.
**Question**
How can I install and make use of the sht3x kernel module on my Debian notebook?
Marcel
(1144 rep)
Jun 14, 2021, 06:27 AM
• Last activity: Jun 14, 2021, 08:19 AM
Showing page 1 of 20 total questions