Shadyman has joined #beagle
Freya has joined #beagle
Freya has quit [Quit: Ping timeout (120 seconds)]
starblue has quit [Ping timeout: 268 seconds]
starblue has joined #beagle
thinkfat_ has joined #beagle
thinkfat has quit [Ping timeout: 260 seconds]
vagrantc has quit [Quit: leaving]
brook has joined #beagle
brook has quit [Remote host closed the connection]
brook has joined #beagle
brook has quit [Remote host closed the connection]
<set_> docs!
<set_> You guys? Way to go!
<set_> bbl!
set_ has quit [Remote host closed the connection]
samnob has quit [Ping timeout: 246 seconds]
rob_w has joined #beagle
set_ has joined #beagle
samnob has joined #beagle
jfsimon1981_b has quit [Remote host closed the connection]
jfsimon1981 has joined #beagle
* mvaittin has the infamous "duck in a thunderstorm" - moment.
<mvaittin> for 3 days I
<mvaittin> sorry - message escaped :)
<mvaittin> for 3 days I've been trying to get my accelerometer driver working on beagle bone black SPI using the upstream v6.0-rc7 kernel.
<mvaittin> I just put the accel DT node directly in am335x-boneblack.dts. Tried both SPI0 and SPI1.
<mvaittin> configured spi-D0 as input (fore MISO) - AM33XX_PADCONF(AM335X_PIN_SPI0_D0, PIN_INPUT, MUX_MODE0)
<mvaittin> I can see correct-looking traffic in wires (, CS pulled low, clk, 8 bits register address in MOSI and 8 bit data reply in MISO)
<mvaittin> but the BBB spi driver always reads 0x0 :/
<mvaittin> Any good guesses what I am missing(?) I've used SPI on BBB previously with some temperature-sensor but don't remember if it used 4 or 3 wires.
<set_> Um...
<set_> I tried SPI recently too. The location of the file(s) may be located elsewhere.
<set_> So, one may need a .dts file or config-pin (either/or).
<set_> But...my spi device was not reading well either.
<set_> maybe /dev/bone/spi/?
<set_> I was trying CS1 w/ spidev1.0 but I think there are symlinks to spidev1.0 from /dev/bone/spi for now?
<mvaittin> set_: thanks :) I don't use spidev - I've done a kernel driver for the accelerometer. It has quite a lot of layers as I used regmap - but I added prints to the spi-omap2-mcspi.c pio_rx/tx just to ensure I don't lose data somewhere on the higher layers. It seems rx is all zeros already in the spi-omap2-mcspi.c
<mvaittin> and I did try setting the pinconf/mux from the dts
<mvaittin> pin 85 (PIN85) 3:gpio-96-127 44e10954 00000028 pinctrl-single - looks correct for SPI0 d0 to me.
<mvaittin> 0x28 being receiver enabled, no pull and mode 0
<mvaittin> (I guess the clk, MOSI and CS are fine as the data logged from wires look good).
Shadyman has quit [Remote host closed the connection]
<mvaittin> also the MISO data looks good, voltage levels being ~3.4V and data being what I expect to be read from the register. I just don't really know why the data in the driver is 0. I must be missing something obvious...
<mvaittin> driver being the spi-omap2-mcspi.c already
<mvaittin> (eg, not just the data from the regmap at my driver but already before the regmap layer).
<zmatt> mvaittin: check that your pinmux has the clock pin configured as input-enabled
<zmatt> i.e. PIN_INPUT
<zmatt> hmm actually if that weren't the case you also wouldn't have data out
<set_> Oh.
<zmatt> mvaittin: can you try running my show-pins utility and grep for spi: https://github.com/mvduin/bbb-pin-utils/#show-pins (hopefully it still works for kernel 6.0)
<zmatt> and share your DT fragment just in case
<mvaittin> zmatt: I don't think I have INPUT enabled for spi-clk
<mvaittin> let me see..
<zmatt> mvaittin: I'm pretty sure you wouldn't have any data out on mosi if you didn't
<mvaittin> AM33XX_PADCONF(AM335X_PIN_SPI0_SCLK, PIN_OUTPUT, MUX_MODE0)
<zmatt> well that definitely needs to be PIN_INPUT
<zmatt> even though it drives the clock pin, it also reads it back via the input receiver to get better timing specs
<mvaittin> zmatt: hmm. out of the curiosity - why is that? I think master (beagle bone) drivers the clock, right? Well, I'll change this and see what happens - Thanks!
<mvaittin> zmatt: thanks!
* mvaittin tries it out
<zmatt> so it's the signal from the input buffer that's actually used to clock the shift register
<zmatt> so you shouldn't be able to get address bits on MOSI if sclk is input-disabled, that's the part that confuses me here
<mvaittin> zmatt: I owe you a beer :)
<mvaittin> [ 58.069897] Test read ret 0xc8 0x20 0x20 0x0
<mvaittin> I got valid data now. Unfortunately I can't help with the MOSI data.
<mvaittin> I think I saved a screenshot from the saleae capture yesterday - I can recheck or even upload the image :)
ft has quit [Quit: leaving]
<mvaittin> but I am pretty sure the address was correctly output on MOSI
<zmatt> maybe I'm just wrong, maybe it uses the internal clock for MOSI and retimed clock for MISO
<mvaittin> zmatt: maybe :) But you definitely were right on the clock needing to be input!
<zmatt> in general just use PIN_INPUT... there's negligible benefit to using PIN_OUTPUT other than some tiny power savings, and sometimes using PIN_OUTPUT for a seemingly output-only pin breaks things :)
<zmatt> PIN_INPUT is always safe
<mvaittin> zmatt: Thanks for the tip :)
<zmatt> it doesn't help that the names are just terrible
<zmatt> since it's not input vs output, it's input-enabled vs input-disabled without having any impact on the output driver
<mvaittin> Well - pinmuxes are hard...
<mvaittin> zmatt: yes - the reference manual says 'receiver enable' which is better. But the typical GPIO programming model just uses of terms input/output
<zmatt> this has nothing to do with the gpio programming model though :)
<mvaittin> Still, it never came to my mind that the clk driven by BBB should also be received by BBB
<zmatt> (nor with the gpio controllers for that matter)
<mvaittin> well, pin c0nf/-control is probably influenced by people used to work with GPIOs
<mvaittin> s/c0nf/conf
<mvaittin> but ... BIG thanks :) It seems my driver works also on SPI - so next week I can proceed sending v2 to upstream - without RFC tag :)
<mvaittin> now I'll back my backpack and head to the wilderness :] - offline till the Monday - but matrix should log messages in case you guys want to ping me. Enjoy the weekend!
<set_> all is well again!
starblue has quit [Ping timeout: 265 seconds]
starblue has joined #beagle
otisolsen70 has joined #beagle
bradfa has quit [Read error: Connection reset by peer]
bradfa has joined #beagle
doppo has quit [Ping timeout: 260 seconds]
doppo has joined #beagle
otisolsen70 has quit [Quit: Leaving]
rob_w has quit [Quit: Leaving]
brook has joined #beagle
zjason` is now known as zjason
brook has quit [Remote host closed the connection]
GenTooMan has quit [Ping timeout: 244 seconds]
GenTooMan has joined #beagle
brook has joined #beagle
brook has quit [Remote host closed the connection]
brook has joined #beagle
GenTooMan has quit [Ping timeout: 248 seconds]
GenTooMan has joined #beagle
vagrantc has joined #beagle
brook has quit [Remote host closed the connection]
florian has quit [Quit: Ex-Chat]
brook has joined #beagle
GenTooMan has quit [Ping timeout: 260 seconds]
GenTooMan has joined #beagle
buzzmarshall has joined #beagle
ft has joined #beagle
brook has quit [Read error: Connection reset by peer]
brook_ has joined #beagle
brook_ has quit [Remote host closed the connection]
brook has joined #beagle
brook has quit [Ping timeout: 265 seconds]
brook has joined #beagle
lucascastro has joined #beagle
brook has quit [Remote host closed the connection]
brook has joined #beagle
brook has quit [Remote host closed the connection]
brook has joined #beagle
lucascastro has quit [Quit: Leaving]
brook has quit [Remote host closed the connection]
brook has joined #beagle
brook has quit [Remote host closed the connection]
brook has joined #beagle
javaJake has quit [Ping timeout: 260 seconds]
nparafe has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
nparafe has joined #beagle
javaJake has joined #beagle
brook has quit [Remote host closed the connection]
<set_> @zmatt: Thank you for making the subartic pins diagram.
<set_> You saved me 500 hrs. of work.
<set_> It is all about deducing time into nano amounts!