What is error "IOError: [Errno 16] Device or resource busy"?
Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You can check the connection between DART-MX6 and VAR-DT6 Custom board at page 9 of VAR-DT6Custom Board
For the chip set, please check it at DART-MX6 spec. RTC is ISL12057. I2C address of ISL12057 is 0x68. It seems that driver of DS1307 is used for ISL12057 because I see the RTC on my board is ISL12057, but during booting the board, ds1307 message is displayed.
If you need to refer more detail about DART-MX6 and VAR-DT6Custom board, you can check them at below links. Please select "DOCUMENTATION" tab in the web. DART-MX6 More ref VAR-DT6Custom More ref
For root permission, I am running as a root because my account is root. I will take care about security of root permission. At present, I need to solve the error about RTC accessing firstly.
I am trying to eliminate RTC driver from the kernel but I am not successful now. So, the error still occurs.
Right, disregard most of my output. I had the illusion you had an x86 board there; You have a 32bit arm A9 cored cpu.
I am suspicious of the address 0x68. I presume the Arm A9 can do an 8 bit instruction, but it's more usual to have an address range with input separated from output. i2c is a serial connection which needs an i2c serial port, not an I/O address. Something has to do serial/parallel translation before it can talk to the bus.
If you go at what i2c serial port it's talking to, and what's talking to that, what do you find?
I am suspicious of the address 0x68. I presume the Arm A9 can do an 8 bit instruction, but it's more usual to have an address range with input separated from output. i2c is a serial connection which needs an i2c serial port, not an I/O address. Something has to do serial/parallel translation before it can talk to the bus.
As above information, I can access to I2C-0 devices by i2c-tools, but accessing to I2C-2 is not successful.
By this result, I think ARM A9 can control i2c device well. But at 0x68 of i2c-2, there is some trouble. It may be a driver is controlling i2c-2, address 0x68, so I can not access to that I2C-2, address 0x68.
Code:
If you go at what i2c serial port it's talking to, and what's talking to that, what do you find?
So sorry. I can not get your idea. So, could you describe it in another way that is clearer?
If you go at what i2c serial port it's talking to, and what's talking to that, what do you find?
So sorry. I can not get your idea. So, could you describe it in another way that is clearer?
Yes. Each i2c port is a serial port. The port in question seems to be
0068 -> ../../../devices/soc0/soc/2100000.aips-bus/21a8000.i2c/i2c-2/2-0068.
Now either that's an Arm i2c port, or on some device. I presumed the latter; My point was that you should investigate the i2c device if possible. The ds1307 has 56 bytes of ram, so I'm surprised at it only having a single byte of I/O.
Please see attachment named resolve_ioerror.png.
I can remove a driver that controls ISL12057 RTC, and access to the RTC by i2c-tools successfully.
Now Python can communicate with ISL12057 RTC by SMBus well. I can talk with it.
I will investigate more about this issue, but at now, I understand the problem is as below.
1. A driver is controlling my RTC, so I can not access to my RTC by i2c-tool or SMBus
2. Remove the driver will move my RTC to free state. I can talk to my RTC when it is in free state.
Thank you Mr.business_kid so much for giving many good opinions in this topic.
Quote:
Now either that's an Arm i2c port, or on some device. I presumed the latter;
I checked the block diagram of DART-MX6 board. At page 8, I2C Master Port is in "AP Peripherals" block. So I am thinking I2C-2 master port is on some device. Does it match with your expectation?
Quote:
My point was that you should investigate the i2c device if possible
If my above thinking is correct, I will just use i2c-tool or SMBus to issue a read/write command to my slave RTC. I assume that the I2C device master works well, so I do not spend so much time about the detail of that I2C master.
Quote:
The ds1307 has 56 bytes of ram, so I'm surprised at it only having a single byte of I/O.
Sorry sir. I do not understand that idea well. Below is my understanding. If it is not correct, please give me your opinion.
I think you mention about single byte of I/O is 0x68? If it is correct, this is slave address of my RTC - I2C. 56 bytes of ram in DS1307 is internal RAM of that RTC. Is there any relationship between 0x68 and 56 bytes RAM?
The direct cause to this issue is, i2c slave address is set by I2C_SLAVE but I2C_SLAVE_FORCE.
See int set_slave_addr(int file, int address, int force)in i2c-tools-3.1.2\tools\i2cbusses.c
and static int SMBus_set_addr(SMBus *self, int addr) in i2c-tools-3.1.2\py-smbus\smbusmodule.c
So, if this occurs, please check i2cdump output with/without -f argument firstly.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.