<awygle> i feel that the entire data model of kicad's component libraries is flawed, which makes it difficult to drum up motivation to help with their scripts and things
<awygle> but i strongly agree with esden's description of the problem as chicken-and-egg
noobos has joined #glasgow
esden has quit [Ping timeout: 248 seconds]
eddyb[legacy] has quit [Ping timeout: 248 seconds]
futarisIRCcloud has quit [Ping timeout: 248 seconds]
daveshah has quit [Ping timeout: 248 seconds]
midnight has quit [Ping timeout: 248 seconds]
furan- has quit [Ping timeout: 248 seconds]
_florent_ has quit [Ping timeout: 248 seconds]
eddyb[legacy] has joined #glasgow
esden has joined #glasgow
daveshah has joined #glasgow
futarisIRCcloud has joined #glasgow
furan- has joined #glasgow
_florent_ has joined #glasgow
midnight has joined #glasgow
m4ssi has joined #glasgow
<emily> "the data model is flawed, so I can't bring myself to help with the implementation" is such a mood ;w;
noobos_ has joined #glasgow
noobos has quit [Ping timeout: 260 seconds]
mbglas has joined #glasgow
mbglas has left #glasgow [#glasgow]
Stormwind_mobile has joined #glasgow
noobos_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
noobos has joined #glasgow
<Stormwind_mobile> whitequark: a propos i2c scanning and repstart: I tinkered with a Melexis I2C IR temperature sensor in December, I think it was MLX60314 or similar. Getting repstarts right, or at all, proved to be crucial with this device. Not sure if it matters for scanning, though.
ronyrus has joined #glasgow
<whitequark> hmm
noobos has quit [Quit: Textual IRC Client: www.textualapp.com]
<whitequark> Stormwind_mobile: that's just SMBus
<whitequark> my proposal is a superset of SMBus so it's fine
m4ssi has quit [Ping timeout: 248 seconds]
m4ssi has joined #glasgow
m4ssi has quit [Ping timeout: 255 seconds]
m4ssi has joined #glasgow
m4ssi has quit [Remote host closed the connection]
m4ssi has joined #glasgow
m4ssi has quit [Client Quit]
Stormwind_mobile has quit [Ping timeout: 265 seconds]
Stormwind_mobile has joined #glasgow
Stormwind_mobile has quit [Read error: Connection reset by peer]
Stormwind_mobile has joined #glasgow
Stormwind_mobile has quit [Ping timeout: 240 seconds]
bvernoux has joined #glasgow
<electronic_eel> whitequark: about the internal i2c access and timeout due to a device holding scl low (again, hope you don't mind)
davidc__ has quit [Quit: leaving]
<whitequark> sure
<electronic_eel> the fx2 will detect this condition without interaction from the host, issue the reset and so on
<electronic_eel> correct?
<whitequark> partially
<whitequark> detect: yes
<whitequark> reset: we don't have one
<electronic_eel> ok, not yet
<whitequark> the thing is we mostly can't have one
<whitequark> I2C devices with reset are very rare
<electronic_eel> maybe reset the i2c hardware of the fx2 if a bug in that causes it
<whitequark> huh? what bug?
<whitequark> (also it doesn't have a reset either)
<electronic_eel> don't know, maybe some hardware design issue we don't know about yet?
<whitequark> that seems extremely unlikely compared to just noise or glitches on external i2c lines
<whitequark> not that it's impossible, but the latter category is very common.
<whitequark> or just a misused microcontroller peripheral, or a buggy software i2c implementation
<electronic_eel> ok, let's say glitches and noise. wasn't there some condition where both master and slave pulled the scl low at the same time?
<whitequark> that's just clock stretching, no?
<whitequark> that's how it works. the fx2 pulls scl low, and the device keeps it low until it's ready
<electronic_eel> yeah, but the master doesn't pull low anymore during stretching
<electronic_eel> I thought you posted some condition in the spec where it could happen that both keep pulling low at the same time and you can't easily resolve it
<electronic_eel> but maybe I misremember and it was a bug in an implementation somewhere
<electronic_eel> they even have a paragraph in the i2c spec where they recommend using a reset line to resolve these cases
<electronic_eel> (or switch off vcc of the devices if they don't have reset)
<whitequark> ohh
<whitequark> that condition in the spec is in multimaster I think
<whitequark> well, there are a few
<electronic_eel> ah, ok, with multimaster this seems more likely
<whitequark> let's see, the only two cases where a chip drives SCL is when it is (a) master, or (b) something that does clock stretching
<whitequark> in the multimaster case, the problem is when two masters transmit an exactly identical write for example
<whitequark> both will think theirs succeeded
<whitequark> so if it's not idempotent it's a problem
<whitequark> but I think that doesn't require a reset
<whitequark> what you need a reset for is when the device hogs the *SDA* line
<whitequark> i.e. you have a desync between the fx2 and the device in our case
<whitequark> there are only two possible ways out of that: either you reset the device, or you blindly clock SCL and hope for the best
<whitequark> at some point the device will release SDA and then you can transmit the stop condition
<electronic_eel> yes, clocking out is common.
<whitequark> unfortunately, you might end up e.g. corrupting an EEPROM
<electronic_eel> of course
<whitequark> (which is why I2C should have just required a time based reset...)
<whitequark> (I think SMBus does)
<gruetzkopf> oh, now you're requiring a _timer_
<electronic_eel> I guess they didn't want to require internal clocks when they first developed it
<gruetzkopf> no videotext decoder has a - oh wait there's the vsync .. :D
<electronic_eel> so, how should the fx2 handle these problems?
<electronic_eel> if a device keeps sda low we could detect it on the host and send the clock out stuff from the host in the next request
<electronic_eel> if a device keeps scl low we can for now just detect it on the fx2 but can't do anything about it
<electronic_eel> in the future we will be able to isolate the bus that has this problem
<whitequark> IMO a practical way to solve this is to disable that branch of mux and ask the user to power cycle the device
<electronic_eel> yes. but disabling the mux branch means the mux handling should be completely done on the fx2
<whitequark> the clock out (or whatever other way we use to unscrew the bus) should be done autonomously on the FX2
<whitequark> yes, sure.
<whitequark> how else?
<electronic_eel> do you want to plan for that now in the access protocol or should it be extended later?
<whitequark> we can stuff the port number in wIndex, the same way it's currently done for ADCs/DACs
<whitequark> so it comes naturally
<electronic_eel> ok
<electronic_eel> if the bus-unscrew is done by the fx2, shouldn't the host be informed about it so that it can try to repeat the transfer or similar?
<electronic_eel> also if one mux-branch was disabled due to errors we should inform the host
<whitequark> yes. it'll be another error flag, we already have some (e.g. for voltage failure)
<electronic_eel> so I'm not sure if your proposal to just let the control transfer read timeout is the best way to do it
<whitequark> no, not *just* timeout
<whitequark> and for that matter, not even timeout at all
<whitequark> if the time limit is enforced on FX2 then it should stall EP0, which immediately kills the transfer
<whitequark> with -EPIPE on Linux
<whitequark> then the host can send a status request to see exactly what happened
<whitequark> that's the way a similar condition is already handled
<electronic_eel> how does the usb stall work exactly? the host tries to read from the device, but the device nacks
<electronic_eel> or is stall a special kind of packet?
<whitequark> latter
<electronic_eel> ok, so there is no timeout, very good. and then a bunch of i2c error flags. that should be enough to handle everything
<whitequark> yep
Stormwind_mobile has joined #glasgow
Stormwind_mobile has quit [Ping timeout: 260 seconds]
Stormwind_mobile has joined #glasgow
bvernoux has quit [Quit: Leaving]
<esden> Repost from Discord:
<esden> I am looking for people that have blogs and YT channels, and want to do projects they can talk about using the glasgow. I have a few prototype units for that purpose.
<esden> I am not interested in "mailtime" -> "drawer" at the moment.
<esden> Also if you have specific, interesting applets you want to develop for glasgow and need the hardware for it I do want to hear about the project, and I might be able to help out. :slight_smile:
<esden> (cut and pasted bit too much ... damn emoji stuff :P )