-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i2cdriver hardware hangs up #30
Comments
Right, I see this:
This might just be a bad unit. So please can you confirm the basics:
The firmware does catch failures, using the SiLabs EFM8 system of timers and interrupts. |
I have only tested with an I2C slave microcontroller. I have connected to this microcontroller before with Linux GPIO I2C. I am 100% sure /dev/ttyUSB0 is the I2CDriver FT230X device I am not sure what you mean by "that nothing is plugged into the I2CDriver's I2C ports, at least to begin with"? Do you mean on power up, on i2c_connect()? Please provide specific context. You say the FW catches failures, but if it does they are not reported to the user via serial. For example if there is a watchdog failure, a brownout condition or some other exceptional HW condition this should be reported via serial. There is no bootup message sent out over UART when the unit starts. There is no pulse from the unit. There isn't even a blinking light on the OLED display. |
At startup, the display should look like this: To clarify, by "nothing plugged in" I mean no I2C peripherals are connected. So the full procedure:
Or have you already reached this point? |
This point has worked for me before. I have tried a few more times and got this openat(AT_FDCWD, "/dev/ttyUSB0", O_RDWR|O_NOCTTY) = 3 |
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 |
So sometimes I get a hangup and sometimes I don't. When it does hangup I have to power cycle and the Voltage reading never changes. |
OK, I think what you are saying is that the I2CDriver display and communications are working, and that after some communication with a microcontroller I2C Slave, the I2CDriver can hang. Can you provide any more details on the I2C transaction that leads to the hang? |
New information here! Three program invocations. This is quite possible a bug in the Linux ftdi driver. Or it is a bug in your FW. I don't know which. I think I have given you enough to reproduce it. Please ask more questions if needed. TRACES This runs fine
This does not
This is the error I was seeing:
|
I should note that I am running on an osboxes ubuntu VM Linux osboxes 4.18.0-25-generic #26-Ubuntu SMP Mon Jun 24 09:32:08 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
Aha, thanks. What is running this on the Linux box? I assume it is C code that you have for driving the I2CDriver, but want to confirm. |
This is all C code. Not sure I understand why I would need 2 separate reads after 'a N' (read N bytes with ack). It seems I need 1 call for the status and 1 for the data. Why is this so? |
Looking at the trace... first observation is that the 'x' (bus reset) command sends a response bye back, with the state of SDA,ACL lines in the two low bits. |
Thanks for patching, but can you please just fix up the documentation with precise definitions of what commands are accepted and precisely what responses are sent back. First off page 24 talks about toggling a CS??? line with commands not even in the table. Please go back and fix the documentation so someone skilled in the art can write a proper C API for it. The only reason I haven't tossed this product in the junk bin is because I think it is fundamentally good and just needs some rigorous attention. |
Agreed, on it. |
Updated doc, section 7.4 has all the core commands: https://i2cdriver.com/i2cdriver.pdf Capture mode is TBD. |
Did you get a chance to look at the updated docs? They should have enough detail to write an API. Reading through the C reference code, I notice that it is incorrect for long (>64 byte) reads, and have raised #34 for the fix. |
Yes I have and it makes more sense now. I am going forward with my own C code from scratch given your docs. I am looking forward to monitor mode! |
OK to close this one? |
There should be no issue at all receiving echo responses. i2cdriver fails to respond.
I am not a MyForth expert nor will I ever be, but I don't see that the watchdog timer is used. I don't see any exception vectors handled either. This looks like it could be a 5 star product but it needs the basics covered!
openat(AT_FDCWD, "/dev/ttyUSB0", O_RDWR|O_NOCTTY) = 3
ioctl(3, TCGETS, {B1000000 -opost -isig -icanon -echo ...}) = 0
ioctl(3, TCGETS, {B1000000 -opost -isig -icanon -echo ...}) = 0
ioctl(3, SNDCTL_TMR_START or TCSETS, {B1000000 -opost -isig -icanon -echo ...}) = 0
ioctl(3, TCGETS, {B1000000 -opost -isig -icanon -echo ...}) = 0
write(3, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"..., 64) = 64
write(3, "eA", 2) = 2
read(3,
The text was updated successfully, but these errors were encountered: