PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2586
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: New device tree kernel is in testing

Sat Jan 24, 2015 4:06 am

@DirkS Well done, you are correct on all counts.

@DougieLawson Please read up a bit before posting more misinformation. Not only is the syntax correct, it is not a good idea to enable options that you don't need. Besides, Tinue has already got it working - see the Update?

User avatar
DougieLawson
Posts: 37095
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: New device tree kernel is in testing

Sat Jan 24, 2015 3:53 pm

PhilE wrote:Please read up a bit before posting more misinformation. Not only is the syntax correct, it is not a good idea to enable options that you don't need. Besides, Tinue has already got it working - see the Update?
There's too much detail missing from the official docs and nobody has responded to my Github issue
https://github.com/raspberrypi/documentation/issues/150

Basically the RPF documentation is not fit for purpose at the moment.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

funtomas
Posts: 9
Joined: Mon Dec 02, 2013 10:12 am

Re: New device tree kernel is in testing

Sat Jan 24, 2015 9:09 pm

what version of firmware / kernel will be officialy in jessie?
3.16 ???

User avatar
DougieLawson
Posts: 37095
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: New device tree kernel is in testing

Sat Jan 24, 2015 10:57 pm

funtomas wrote:what version of firmware / kernel will be officialy in jessie?
3.16 ???
I'd guess 3.18, since that's due to arrive in Wheezy when the RPF have ironed out the DT stuff.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

n7wlc
Posts: 4
Joined: Mon Sep 29, 2014 8:24 pm

Re: New device tree kernel is in testing

Wed Jan 28, 2015 12:17 am

I've also found a problem with the SPI interface. I'm using the PiFace board, With the new kernel (and enabling SPI in config.txt), I get an error during the write to the SPI interface.

This does not work under the rpi-config kernel: 9ae54e3eb780309baf770a10c4e467ddcb011ef8
But it does work under the older (pre DT) kernel: f74b92120e0d469fc5c2dc85b2b5718d877e1cbb

In the new kernel, the /dev/spidev0.0 and .1 files are present. The C code that opens and initializes the port (via ioctl() calls) completes without complaint. But at the first write, I get an error (write via an ioctl call).

I was using the wiringPi library to talk to the PiFace and observed the same error.

I'd be glad to share code or do remote testing if that is helpful.

Sincerely,

Mike

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2586
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: New device tree kernel is in testing

Wed Jan 28, 2015 8:44 am

Have you tried adding:

Code: Select all

dtparam=spi=on
to your config.txt ?

As an aside, it is likely that these optional interfaces will be enabled by default in a future release, and raspi-config will be able to manipulate these DT settings.

n7wlc
Posts: 4
Joined: Mon Sep 29, 2014 8:24 pm

Re: New device tree kernel is in testing

Thu Jan 29, 2015 11:11 pm

It was turned on. I found the answer in a different post (http://www.raspberrypi.org/forums/viewt ... 65#p680665) where the spi_ioc_transfer structure was not completely initialized. Adding the suggested memset(&spi, 0, sizeof(spi)) did the trick.

Mike

User avatar
DougieLawson
Posts: 37095
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: New device tree kernel is in testing

Fri Jan 30, 2015 12:26 am

I've written patch and opened a Github issue for the broken piface/libmcp23s17 stuff.
https://github.com/piface/libmcp23s17/issues/8
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

mmi
Posts: 85
Joined: Sun Feb 24, 2013 3:53 am
Location: Bavaria-Germany

Re: New device tree kernel is in testing

Fri Jan 30, 2015 2:27 pm

My onewire temperature sensor (DS18B20) always reports 85 degrees if device tree is used.

I have uncommented w1 in config.txt (2 lines) and i use the latest firmware (dated Jan-28) and kernel 3.18.4. The w1 modules are loaded and when i do
cat /sys/bus/w1/devices/w1_bus_master1/28-000002db4902/w1_slave
it's normal behaviour: it replies the two lines with crc and temperature, but it's always 85°.
I have the 'old' RPi Model B Rev. 2 (without +).

If i switch off the device tree ('device_tree=' in config .txt) it works fine !
Any ideas?

Thanks and regards, mmi

User avatar
rpdom
Posts: 16104
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: New device tree kernel is in testing

Fri Jan 30, 2015 6:10 pm

Which w1 options in config.txt did you activate?

As I understand it you should have only one, either "dtoverlay=w1-gpio" or "dtoverlay=w1-gpio-pullup" depending if you need a pull-up pin or not.

mmi
Posts: 85
Joined: Sun Feb 24, 2013 3:53 am
Location: Bavaria-Germany

Re: New device tree kernel is in testing

Fri Jan 30, 2015 9:00 pm

In config.txt i activated

Code: Select all

device_tree_overlay=w1-gpio
device_tree_param=gpiopin=4
and nothing else.

Additionally i have in modprobe.conf

Code: Select all

options w1_gpio gpiopin=4 pullup=1
and no extra params for w1_therm.

But disabling 'pullup=1' is not a solution, it shows 85° then with and without devicetree.
Although i connected the sensor in its simplest way with 3 wires and a 4k resistor.

EDIT:
Although the sensor has worked without DT since over a year, it's getting weird for me now:
- principially i don't need an extra gpio pin in addition to gpio 4 where the sensors data line is connected
- setting 'pullup=1' as an option for w1_gpio configures gpio pin1 (which isn't a known gpio) for a extern pullup - is it right?

I ask myself why the sensor returns valid values (without DT) only with 'options w1_gpio pullup=1' although at gpio1 i didn't connect anything. Until now my misunderstanding was this would set the internal pullup on pin 4 in my case but that seems to be wrong.

I think best is to take a second sensor and try it on another RPi. I will report, so far sorry for the inconvenience.

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: New device tree kernel is in testing

Sat Jan 31, 2015 8:10 am

mmi wrote:In config.txt i activated

Code: Select all

device_tree_overlay=w1-gpio
device_tree_param=gpiopin=4
and nothing else.

Additionally i have in modprobe.conf

Code: Select all

options w1_gpio gpiopin=4 pullup=1
and no extra params for w1_therm.

But disabling 'pullup=1' is not a solution, it shows 85° then with and without devicetree.
Although i connected the sensor in its simplest way with 3 wires and a 4k resistor.

EDIT:
Although the sensor has worked without DT since over a year, it's getting weird for me now:
- principially i don't need an extra gpio pin in addition to gpio 4 where the sensors data line is connected
- setting 'pullup=1' as an option for w1_gpio configures gpio pin1 (which isn't a known gpio) for a extern pullup - is it right?

I ask myself why the sensor returns valid values (without DT) only with 'options w1_gpio pullup=1' although at gpio1 i didn't connect anything. Until now my misunderstanding was this would set the internal pullup on pin 4 in my case but that seems to be wrong.

I think best is to take a second sensor and try it on another RPi. I will report, so far sorry for the inconvenience.
Before device tree I also have a parameter for w1_therm, in /etc/modules:

Code: Select all

w1-therm strong_pullup=1
I haven't tried the new firmware again recently. I had it working by turning device tree off, but then I had to reformat, which put me back to the old version, and I didn't run rpi-update again.

I have four temperature sensors running in parasitic mode. All good, but I want to run a DS2406 sensor, so I need the later firmware which includes new modules.

User avatar
peepo
Posts: 305
Joined: Sun Oct 21, 2012 9:36 am

Re: New device tree kernel is in testing

Sat Jan 31, 2015 1:21 pm

PhilE

not clear to me this is exactly the problem I now need to understand, but LogiPi instructions do not seem to mention any issues around spi or spidev, yet I cannot currently seem to use....

so how do I load if hashing raspi-blacklist.conf and modprobe are no longer the way to go?

apologies if I'm confused, it comes naturally...

thanks again

Jonathan

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2586
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: New device tree kernel is in testing

Sat Jan 31, 2015 1:27 pm

@ame and @mmi - There is a problem with the w1-gpio driver and its device tree implementation. We have accepted a non-upstreamed patch in order to support the parasitic power feature (I presume you are just using two wires, not the usual three), but it doesn't work as intended in device tree mode. If this device is important to you then I suggest you disable DT for now, but I assure you that we will get it working soon.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2586
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: New device tree kernel is in testing

Sat Jan 31, 2015 1:35 pm

@peepo: Do /dev/spidev* exist? If not, you probably haven't enabled the SPI interfaces. The next raspi-config release will be able to do this for you, but until then you will need to add "dtparam=spi=on" to /boot/config.txt and reboot.

It is also possible that you are using a library that hasn't been updated to work with the latest driver. See n7wlc's post above. Do you see any error messages?

User avatar
peepo
Posts: 305
Joined: Sun Oct 21, 2012 9:36 am

Re: New device tree kernel is in testing

Sat Jan 31, 2015 1:40 pm

Phil,

tx that makes much more sense, the first post felt like flannel...
had been looking for the rpi-update post (i2c), but Google found this first...

not the one, but:
http://raspberrypi.stackexchange.com/qu ... -no-such-f

should be there xxxx

wfm

~:"

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: New device tree kernel is in testing

Sat Jan 31, 2015 8:04 pm

PhilE wrote:@ame and @mmi - There is a problem with the w1-gpio driver and its device tree implementation. We have accepted a non-upstreamed patch in order to support the parasitic power feature (I presume you are just using two wires, not the usual three), but it doesn't work as intended in device tree mode. If this device is important to you then I suggest you disable DT for now, but I assure you that we will get it working soon.
Thank you. My temperature sensors are indeed wired for parasitic power, and they are working. My DS2406 is parasitic-only and is visible on the bus (but no driver yet until I run rpi-update).

I'll run rpi-update later and disable device tree, then I'll load the drivers the conventional way.

Thanks.

sbp
Posts: 128
Joined: Wed Sep 26, 2012 7:54 pm

Re: New device tree kernel is in testing

Sat Jan 31, 2015 9:01 pm

Hi Phil

Can there be a problem with initramfs and the new device tree?

The reason for my question is that we have been trying to build piCore on the new 3.18.5 with DT - however we are not able to get it to boot from RAM.
We have had no problems with building before the new DT.
Cmdline

Code: Select all

dwc_otg.fiq_fsm_mask=0x7 bcm2708.vc_i2c_override=1 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 initrd=0xa00000,4175913 root=/dev/ram0 elevator=deadline rootwait nortc loglevel=3 cron
config

Code: Select all

# kernel image
kernel=zImage.img

# Specify initramfs
ramfsfile=pCP3185m.gz
ramfsaddr=0x00a00000

#device_tree=

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
arm_freq=800
core_freq=250
sdram_freq=400
force_turbo=1



# for more options see http://elinux.org/RPi_config.txt
hdmi_force_mode=1
But it result in kernel panic:
Kernel panic - Not syncing: VFC: Unable to mount root fs on unknown-block(1,0)


piCore is found here http://forum.tinycorelinux.net/index.ph ... ,57.0.html
piCorePlayer webpage: https://sites.google.com/site/picoreplayer/home

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2586
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: New device tree kernel is in testing

Sat Jan 31, 2015 9:23 pm

I've had reports of it working. Does it boot if you disable device tree? Can you post extracts from the boot log in both cases?

mmi
Posts: 85
Joined: Sun Feb 24, 2013 3:53 am
Location: Bavaria-Germany

Re: New device tree kernel is in testing

Sun Feb 01, 2015 2:59 am

PhilE wrote:@ame and @mmi - There is a problem with the w1-gpio driver and its device tree implementation. We have accepted a non-upstreamed patch in order to support the parasitic power feature (I presume you are just using two wires, not the usual three), but it doesn't work as intended in device tree mode. If this device is important to you then I suggest you disable DT for now, but I assure you that we will get it working soon.
Thanks Phil and ame, but mine is not parasitic powered. I use the simple 3 wire connection and i thought it works with the current dt version.

By the way, in 'config.txt' for parasitic and normal powered sensors the same overlay is called. Who should ever call 'w1-gpio-pullup' ?

I think this has to be changed for parasitic powered sensors only from

Code: Select all

device_tree_overlay=w1-gpio
to

Code: Select all

device_tree_overlay=w1-gpio-pullup
Am i wrong or is it only for a while due to the bug you wrote above?

ktb
Posts: 1441
Joined: Fri Dec 26, 2014 7:53 pm

Re: New device tree kernel is in testing

Sun Feb 01, 2015 4:52 am

sbp wrote:Hi Phil

Can there be a problem with initramfs and the new device tree?
http://www.raspberrypi.org/forums/viewt ... 29#p667529

It hasn't worked for me since then ^.
Last edited by ktb on Sun Feb 01, 2015 5:31 am, edited 1 time in total.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6183
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: New device tree kernel is in testing

Sun Feb 01, 2015 5:14 am

The folks saying initramfs doesn't work... what does vcgencmd version say?

There's a fix for an initramfs-related issue in this commit: https://github.com/Hexxeh/rpi-firmware/ ... 026a25ff37

Is the firmware you're running before or after that commit?

ktb
Posts: 1441
Joined: Fri Dec 26, 2014 7:53 pm

Re: New device tree kernel is in testing

Sun Feb 01, 2015 5:24 am

ShiftPlusOne wrote:The folks saying initramfs doesn't work... what does vcgencmd version say?

There's a fix for an initramfs-related issue in this commit: https://github.com/Hexxeh/rpi-firmware/ ... 026a25ff37

Is the firmware you're running before or after that commit?
I believe the problem first showed up for me after running an update for 3.18.1+.

I'm currently running 3.18.3. I'll try out 3.18.4 or 3.18.4+. I might not have a chance to do that until tomorrow.

User avatar
carriba
Posts: 140
Joined: Tue Nov 18, 2014 5:55 pm
Contact: ICQ

Re: New device tree kernel is in testing

Mon Feb 02, 2015 8:32 am

With this kernel release I do not longer see the I2C adapter files under the directory /sys/class/i2c-adapter :(

This is also the case with previous releases up to kernel release 3.12.36+. This is the latest release where I have back the I2C adapter files visible again as /sys/class/i2c-adapter/i2c-1.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2586
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: New device tree kernel is in testing

Mon Feb 02, 2015 10:02 am

This question has been answered in this thread, this thread, and several others. But the short answer is that you need to add:

Code: Select all

dtparam=i2c=on
to /boot/config.txt.

Return to “Advanced users”