davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

wishful: Jessie Kernel, I2C clock-stretching compliant

Sun Feb 14, 2016 11:11 am

wishful:
a new Raspbian Jessie Kernel which is I2C clock-stretching compliant.

FTM, Arduinos (AVR: Uno, Mega, Nano) can not be plugged as i2c slaves, I2c bus hangs up then.
Arduino DUE (ARM) works fine though.

The Issue has been reported and discussed in this topic:

viewtopic.php?f=33&t=133334&start=25#p896363

viewtopic.php?f=33&t=133334&start=50#p904479
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

fsr
Posts: 88
Joined: Wed Jan 13, 2016 2:29 am

Re: wishful: Jessie Kernel, I2C clock-stretching compliant

Sun Feb 14, 2016 11:30 am

There has been some movement in this direction recently
https://github.com/raspberrypi/linux/pull/1241

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: wishful: Jessie Kernel, I2C clock-stretching compliant

Sun Feb 14, 2016 12:50 pm

@fsr,
is this github thing a private investigation or will it come to an official Raspberry.org Jessie kernel update?
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

fsr
Posts: 88
Joined: Wed Jan 13, 2016 2:29 am

Re: wishful: Jessie Kernel, I2C clock-stretching compliant

Sun Feb 14, 2016 1:06 pm

Github is where all the development happens on the rPi kernel.
so yes it will eventually make its way to you via an update

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: wishful: Jessie Kernel, I2C clock-stretching compliant

Sun Feb 14, 2016 1:36 pm

+1
:)
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

DeFy
Posts: 3
Joined: Sun Dec 27, 2015 2:48 am

Re: wishful: Jessie Kernel, I2C clock-stretching compliant

Mon Feb 15, 2016 9:58 pm

I would assume it would roll out in the next kernel update but not sure when they plan that stuff. The driver/RPi always did support clock stretching but it was only at the default value of 64 cycles or something which is short and also frequency dependant. So I set it to be SMBus compliant at 35ms timeout which should be enough.

If you can't wait, you could compile the driver to make the i2c-bcm2708.ko and replace the original one in "cd /lib/modules/$(uname -r)/kernel/drivers/i2c/busses/". I followed this procedure although realized after that's the hard way and you don't need to compile the entire kernel, just require the appropriate header files. I could give you the compiled kernel module although it's probably better to compile it yourself or wait until it's in the repository.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: wishful: Jessie Kernel, I2C clock-stretching compliant

Mon Feb 15, 2016 10:06 pm

thank you, of course I can wait. I'm using a Arduino Due which surprisingly works well with Raspi I2c, just the AVRs are stalling.
A friend from another forum tried bitbanging with a Mega using pigpio library, but there are still lot of issues.

So I decided to abandon the AVRs for the moemnt and better wait for a kernel update. :)
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

Return to “Raspberry Pi OS”