This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/BEAGLEBK: 1-wire access

Part Number: BEAGLEBK

Tool/software: Linux

I'm using SDK on BeagleBone black as development environment.

For my application I need access to the 1-wire bus ( Linux, not PRU ).

Have 8 temp sensors, not critical regarding timing.

It did work some time ago in Debian environment ( kernel 4.4 ).

How to get 1-wire access in SDK Linux environment?

Pepito

 

  • Hi Pepito,

    1-wire support driver presents in the Linux kernel but it should be enable before compiling the kernel.
    You should execute "make menuconfig" command and check at:
    Device Drivers --->
    < > Dallas's 1-wire support --->
    whether it is enabled. If it is disabled enable it.
    You find some resources about Linux 1-wire in the kernel documentation at:
    ../linux-4.4xxx/Documentation/w1

    BR
    Tsvetolin Shulev
  • Also take a look at the linked below article which gives you an example for device tree configuration in addition:
    www.bonebrews.com/.../

    BR
    Tsvetolin Shulev
  • Hi Tsvetolin,
    thanks for the hint. Some time ago I used it in Debian environment, worked fine.
    But now I have to recompile the kernel ... on BeagleBone. Will take some time, but that's not an issue as long it works.
    Pepito
  • Part Number: BEAGLEBK

    Tool/software: Linux

    Because I have to develop on BeagleBone, I have to compile the kernel on it

    to get access for 1-wire bus.

    Question is: how to do that on beaglebone?

    Or is already an image available with 1-wire support?

    I did think that 1-wire is a kernel module and it's possible to load/unload at run time ( modeprobe / rmmod ).

     Pepito

  • Pepito,

    I checked the menuconfig and found that "Dallas's 1-wire support" by default is set as module which means that you can use it with "modprobe w1-gpio".
    But you should have 1-wire configuration in device tree as it is described in kernel documentation:
    www.kernel.org/.../w1-gpio.txt
    www.kernel.org/.../w1-gpio

    BR
    Tsvetolin Shulev
  • modprobe w1-gpio
    modprobe: FATAL: Module w1-gpio not found in directory /lib/modules/4.9.69-g9ce43c71ae
    Hi Tsvetolin,
    the module is not existing.
    I'm trying to compile the kernel, make menuconfig works,
    was not enabled.
    Would like to start kernel compilation from ti default, did not work.

    make ARCH=arm distclean
    ti_config_fragments/defconfig_builder.sh -t ti_sdk_am3x_release
    mktemp: Invalid argument
    mktemp: Invalid argument
    mktemp: Invalid argument
    cp: invalid option -- 'T'
    BusyBox v1.24.1 (2018-03-26 13:29:31 EDT) multi-call binary.

    Usage: cp [OPTIONS] SOURCE... DEST
    Creating defconfig file /home/ln/Programme/processor-sdk-processor-sdk-linux/arch/arm/configs/ti_sdk_am3x_release_defconfig
    mv: can't rename '.config': No such file or directory
    am335x-evm:/home/ln/Programme/processor-sdk-processor-sdk-linux#

    ls -als /home/ln/Programme/processor-sdk-processor-sdk-linux/arch/arm/configs/ti_sdk_am3x_release_defconfig
    ls: /home/ln/Programme/processor-sdk-processor-sdk-linux/arch/arm/configs/ti_sdk_am3x_release_defconfig: No such file or directory

    Think I need this starting point. Then I can select the 1-wire module in make menuconfig and compile afterwards.

    What do you think?

    Pepito
  • Yes, if "Dallas's 1-wire support" is not enabled by default in your config enable it.

    BR
    Tsvetolin Shulev
  • Hi Tsvetolin,
    I'm unable to generate the TI default .config file. Is it possible to provide a default ".config" for BeagleBone black ( C release )?
    ti_config_fragments/defconfig_builder.sh -t ti_sdk_am3x_release
    fails
    Or is the any other way to start make menuconfig from defaults?
    There are so many possibilities ..... think it good idea to start from factory defaults and add then specific functionality like 1-wire, AD etc.
    Pepito
  • You should use command:
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
    as it is described at the linked below guide (only for clarification the command must be executed on an Ubuntu host PC):
    software-dl.ti.com/.../Foundational_Components.html

    BR
    Tsvetolin Shulev
  • Hi Tsvetolin,
    I don't have access to Ubuntu. We have only Suse installed. But .... right now I was able to generate the default .config on Suse PC.
    ti_config_fragments/defconfig_builder.sh -t ti_sdk_am3x_release worked fine
    I copied the .cofig via scp to BeagleBone and execute make menuconfig.
    The 1-wire is enabled as module. The is a sub group for master and slaves, which module is required for 1-wire Dallas temp sensors?

    I start make zimage, just to see if it works ... up to now it's working.

    Thanks
    Pepito
  • Good news
    1.) was able to configure and compile the kernel on a Suse Linux PC
    > LD arch/arm/boot/compressed/vmlinux
    > OBJCOPY arch/arm/boot/zImage
    > Kernel: arch/arm/boot/zImage is ready
    2.) make zImage is still working on BeagleBone :-)

    One hour ago I was standing on cliffs edge, now I made a huge step forward. ;-)
    Thanks for support, I have to install and reboot, hope it works.

    Have a nice weekend
    Pepito