BBB - problems with dallas one-wire devices

This forum is for supported devices using an ARMv7 Texas Instruments (TI) SoC.

BBB - problems with dallas one-wire devices

Postby cswank » Tue Dec 08, 2015 1:27 am

I've spent a couple of weeks trying to get a dallas one wire temperature sensor to work with latest arch-linux for beagle bone black (rev c). If someone would be so kind, I'd love to hear if someone can reproduce the problem I'm having. And perhaps someone could suggest where the problem might be (if it is not me or my setup) so I can file an issue in the proper place.

The sensor is a DS18B20 and here are the steps that I take. After installing the latest arch linux arm (as of 2 days ago) onto my sd card I install sudo and add the 'alarm' user to /etc/sudoers. Then I install dtc-overlay:

$this->bbcode_second_pass_code('', '
$ sudo pacman -S dtc-overlay
')

Next I compile this file:

$this->bbcode_second_pass_code('', '
/dts-v1/;
/plugin/;

/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";
part-number = "DS1820";
version = "00A0";

exclusive-use = "P9.12";

fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
ds1820_pins: pinmux_ds1820_pins {
pinctrl-single,pins = <0x78 0x37>;
};
};
};

fragment@1 {
target = <&ocp>;
__overlay__ {
onewire@0 {
status = "okay";
compatible = "w1-gpio";
pinctrl-names = "default";
pinctrl-0 = <&ds1820_pins>;
gpios = <&gpio2 28 0>;
};
};
};
};
')

to a dtbo file with this command:

$this->bbcode_second_pass_code('', '
$ dtc -O dtb -o BB-W1-00A0.dtbo -b 0 -@ BB-W1-00A0.dts
$ sudo mv BB-W1-00A0.dtbo /lib/firmware
')

The sensor is connected to Port 9 pin 12. The pins are connected similar to this post:
Then load it to the cape manager:

$this->bbcode_second_pass_code('', '
$ sudo su
# echo BB-W1:00A0 > /sys/devices/platform/bone_capemgr/slots
')

The devices does not appear in /sys/bus/w1/devices and dmesg shows:

$this->bbcode_second_pass_code('', '
[ 215.205841] bone_capemgr bone_capemgr: part_number 'BB-W1', version 'N/A'
[ 215.213142] bone_capemgr bone_capemgr: slot #4: override
[ 215.218644] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[ 215.225644] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BB-W1'
[ 215.251364] bone_capemgr bone_capemgr: slot #4: dtbo 'BB-W1-00A0.dtbo' loaded; overlay id #0
[ 215.276132] Driver for 1-wire Dallas network protocol.
[ 217.232052] w1_master_driver w1_bus_master1: w1_search: max_slave_count 64 reached, will continue next search.
[root@alarm alarm]#
')

I've searched all over for that max_slave_count error and I find references to people having a bad wire and stuff like that. I've switched wires, switched beaglebones, switched sensors, tried different versions of the dts file above that use P9.22, P8.11 and others but no matter what I get that same error message and the device never appears.

If someone could reproduce what I'm seeing then that would be great. If someone sees something I'm doing wrong (I've been using 1-wire devices on the 3.8 kernel for years, so I've had this working before) then that would be great too. If someone knows were I can file a bug then that's helpful too.

Thanks,

Craig
cswank
 
Posts: 10
Joined: Tue May 13, 2014 1:04 am

Re: BBB - problems with dallas one-wire devices

Postby Butze » Sun Feb 14, 2016 1:48 pm

$this->bbcode_second_pass_code('', '')Hello Craig,

unfortunately I get nearly the same issue like you.

$this->bbcode_second_pass_code('', '
[ 1127.489770] bone_capemgr bone_capemgr: part_number 'BB-W1', version '00B0'
[ 1127.497074] bone_capemgr bone_capemgr: slot #4: override
[ 1127.502490] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[ 1127.509535] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00B0,Override Manuf,BB-W1'
[ 1127.533196] bone_capemgr bone_capemgr: slot #4: dtbo 'BB-W1-00B0.dtbo' loaded; overlay id #0
...
[ 1129.507126] w1_master_driver w1_bus_master1: w1_search: max_slave_count 64 reached, will continue next search.
')


The only difference seems to be that I do not get the message:
$this->bbcode_second_pass_code('', '
[ 215.276132] Driver for 1-wire Dallas network protocol.
')

With:

$this->bbcode_second_pass_code('', '
[root@alarm alarm]# cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pinmux-pins
Pinmux settings per pin
Format: pin (name): mux_owner gpio_owner hog?
...
pin 13 (44e10834.0): ocp:onewire@0 (GPIO UNCLAIMED) function pinmux_bb_w1_pins group pinmux_bb_w1_pins
...
')
and
$this->bbcode_second_pass_code('', '
cat: /sys/kernel/debug/pinctrl/44e10800.pinmux/pind: No such file or directory
[root@alarm alarm]# cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pins
registered pins: 142
...
pin 13 (44e10834.0) 00000037 pinctrl-single
...
')

I see that the single wire driver is attached to "my" pin13 (P8.11) and that it is configured as mode7 pin, but with the oscilloscope, I can not detect any activity. I assumed that the BBB requests the DS1820 chip periodically, at least if I do:

$this->bbcode_second_pass_code('', '
[root@alarm w1_bus_master1]# cat /sys/devices/w1_bus_master1/w1_master_search
-1
')

but ...nothing! ;-(

I checked if the port pin works, it does -> no HW issue.

If I look at the dtc file, I do not understand the second part of the file at all:

$this->bbcode_second_pass_code('', '
fragment@1 {
target = <&ocp>;
__overlay__ {
onewire@0 {
status = "okay";
compatible = "w1-gpio";
pinctrl-names = "default";
pinctrl-0 = <&bb_w1_pins>;

gpios = <&gpio2 13 0>;
};
};
};

')
What I read is that the "w1-gpio" driver of the kernel is mapped to bb_w1_pins. But what is

$this->bbcode_second_pass_code('', '
gpios = <&gpio2 13 0>;
')
for?

Has anybody any idea what's wrong here?

- How could I debug this?
- How is this bb_w1 driver triggered? May I check if it is triggered at all?
- Any idea how solve this, respectively how I could check what the problem is?


Thanks a lot,

Butze

Complete dts overlay file:

$this->bbcode_second_pass_code('', '
/*
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Modified by Russell Senior from the weather cape's DTS file.
* Minor formatting by C W Rose.
*/
/dts-v1/;
/plugin/;

/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";
part-number = "BB-W1";
version = "00B0";

exclusive-use = "P8.11";

fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
bb_w1_pins: pinmux_bb_w1_pins {
pinctrl-single,pins = <0x34 0x37 /* gpmc_ad13.gpio1_13, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE7 - w1-gpio */ >;
};
};
};

fragment@1 {
target = <&ocp>;
__overlay__ {
onewire@0 {
status = "okay";
compatible = "w1-gpio";
pinctrl-names = "default";
pinctrl-0 = <&bb_w1_pins>;

gpios = <&gpio2 13 0>;
};
};
};
};

')
Butze
 
Posts: 1
Joined: Sun Feb 14, 2016 11:54 am


Return to Texas Instruments (TI)

Who is online

Users browsing this forum: No registered users and 3 guests

cron