Jump to content

TRay

Members
  • Posts

    81
  • Joined

  • Last visited

Everything posted by TRay

  1. I try to understand problem [ 4.997793] sun50i-h616-pinctrl 300b000.pinctrl: pin PC10 already requested by onewire@0; cannot claim for 300b000.pinctrl:74 and I see this message is generate by: https://github.com/torvalds/linux/blob/master/drivers/pinctrl/pinmux.c#L102 /** * pin_request() - request a single pin to be muxed in, typically for GPIO * @pctldev: the associated pin controller device * @pin: the pin number in the global pin space * @owner: a representation of the owner of this pin; typically the device * name that controls its mux function, or the requested GPIO name * @gpio_range: the range matching the GPIO pin if this is a request for a * single GPIO pin */ ...... if ((!gpio_range || ops->strict) && desc->mux_usecount && strcmp(desc->mux_owner, owner)) { dev_err(pctldev->dev, "pin %s already requested by %s; cannot claim for %s\n", desc->name, desc->mux_owner, owner); goto out; } if ((gpio_range || ops->strict) && desc->gpio_owner) { dev_err(pctldev->dev, "pin %s already requested by %s; cannot claim for %s\n", desc->name, desc->gpio_owner, owner); goto out; } .....
  2. Maybe I need a change in my w1-gpio.dts looking to https://elixir.bootlin.com/linux/v6.6.30/source/arch/arm64/boot/dts/allwinner compatible = "allwinner,sun50i-h616"; to model = "OrangePi Zero3"; compatible = "xunlong,orangepi-zero3", "allwinner,sun50i-h618"; and add #include "sun50i-h616-orangepi-zero.dtsi" like in https://elixir.bootlin.com/linux/v6.6.30/source/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts
  3. Unfortunately, my programming knowledge is low and knowledge of DTS Overlays + source code of w1-gpio linux kernel does not allow me to find the source of the problem [ 4.997793] sun50i-h616-pinctrl 300b000.pinctrl: pin PC10 already requested by onewire@0; cannot claim for 300b000.pinctrl:74
  4. Ha, interesting ... I have put in armbianEnv.txt instead pc10 now param_w1_pin=gpio71 where gpio71 is number line for PC7 which is not connected DS18B20 🙂 at current is nothing connected and working w1-gpio with info log where is show PC10/gpio-74 [ 4.957396] Driver for 1-wire Dallas network protocol. [ 4.960325] w1-gpio onewire@0: there is not valid maps for state default [ 4.960433] gpio-74 (onewire@0): enforced open drain please flag it properly in DT/ACPI DSDT/board file [ 4.986579] w1_master_driver w1_bus_master1: Attaching one wire slave 28.03165129ecff crc 24 cat /sys/bus/w1/devices/28-03165129ecff/w1_slave 5f 01 4b 46 7f ff 0c 10 12 : crc=12 YES 5f 01 4b 46 7f ff 0c 10 12 t=21937 I can not understand this
  5. Summary, In all examples to use w1-gpio in Armbian in armbinaEnv.txt always is name of gpio is write in capital letters for example PC10 param_w1_pin=PC10 but when we use PC10 w1-gpio not works and in log is message: [ 4.997793] sun50i-h616-pinctrl 300b000.pinctrl: pin PC10 already requested by onewire@0; cannot claim for 300b000.pinctrl:74 command cat /sys/kernel/debug/gpio did not show that gpio 74 / PC10 is used command but when we use name gpio in lowercase letters pc10 w1-gpio works and show data from DS18B20 but show message in log [ 9.366246] w1-gpio onewire@0: there is not valid maps for state default command cat /sys/kernel/debug/gpio show gpiochip0: GPIOs 0-287, parent: platform/300b000.pinctrl, 300b000.pinctrl: gpio-74 ( |onewire@0 ) out hi and we can see data from DS18B20 cat /sys/bus/w1/devices/28-03165129ecff/w1_slave 53 01 4b 46 7f ff 0c 10 2d : crc=2d YES 53 01 4b 46 7f ff 0c 10 2d t=21187 for me, it is bug or in kernel 6.6.30 or overlay for Ornage Pi Zreo v3
  6. I have checked what hapen when on Ornage Pi Zero v1 with kernel 6.1.63 in armbianEnv.txt use pa14 instead PA14 in log I see [ 9.358693] Driver for 1-wire Dallas network protocol. [ 9.366246] w1-gpio onewire@0: there is not valid maps for state default [ 9.368019] gpio-110 (onewire@0): enforced open drain please flag it properly in DT/ACPI DSDT/board file and w1-gpio not working and no files in /sys/bus/w1/devices/ but we see marked in red the same information that I have on OZPI v3 when I use pc10 instead of PC10 but on OZPI v3 DS18B20 works and on OZPI v1 it doesn't work when I use the lower case name gpio This looks like some kind of bug in kernel 6.6.30 on OZPI v3
  7. Yes, that's right, I can ignore it when I have a working w1-gpio on OZPI v3, but it would be nice to see how to fix it so that it works correctly. But what's strange to me is that I have to use the gpio name in lower case and not in upper case as it was always described in the w1-gpio examples. I tried to use the name with gpiod, i.e. "gpio74", instead of names like PC10, but it didn't work, so it occurred to me to try writing the name in lower case "pc10" instead of capital letters as usual, and I found that it worked, but I think it's not normal since capital letters have been used so far, I will check on OZP v1 whether it will work if I change to lowercase letters Thank you for exchanging ideas and tips on solving the problem
  8. Yes "no maps for state" is connected with but in all examples .dts is used : pinctrl-names = "default";
  9. But I am not use gpio PC10 by another application etc, I define PC10 only for w1-gpio in armbianEnv.tx but when I use PC10 instead pc10 w1-gpio is not working and I can not read data DS18B20. When I use pc10 all working and I read atat from DS18B20 so info in log: pin PC10 already requested by onewire@0; cannot claim for 300b000.pinctrl:74 give me that w1-gpio is not working
  10. But it is interesting most of examples armbianEnv.txt for parameters param_w1_pin=PC10 show name of gpio in use capital letters but when I use name in capital letters is problem and show in demsg info [ 4.997793] sun50i-h616-pinctrl 300b000.pinctrl: pin PC10 already requested by onewire@0; cannot claim for 300b000.pinctrl:74 and 1-Wire not working but when I use name of gpio in lowercase letters pc20 1-Wire works and show temperature from DS18B20 but is info [ 4.994076] w1-gpio onewire@0: there is not valid maps for state default It maybe any bug ?
  11. Wow 🙂 I have success dmesg | grep -i wire* [ 4.991132] Driver for 1-wire Dallas network protocol. [ 4.994076] w1-gpio onewire@0: there is not valid maps for state default [ 4.994183] gpio-74 (onewire@0): enforced open drain please flag it properly in DT/ACPI DSDT/board file [ 5.021347] w1_master_driver w1_bus_master1: Attaching one wire slave 28.03165129ecff crc 24 cat /sys/bus/w1/devices/28-03165129ecff/w1_slave 54 01 4b 46 7f ff 0c 10 fd : crc=fd YES 54 01 4b 46 7f ff 0c 10 fd t=21250 What do I change in /boot/armbianEnv.txt Instead of capital letters PC10, I used in lowercase letters pc10 for the gpio name stupid mistake on my part and maybe I suggested examples param_w1_pin=pc10 param_w1_pin_int_pullup=0 user_overlays=w1-gpio So we can now use sensors like DS18B20 etc with w1-gpio on Orange Pi Zero v3 w with w1-gpio.dts: /dts-v1/; /plugin/; / { compatible = "allwinner,sun50i-h616"; fragment@0 { target = <&pio>; __overlay__ { w1_pins: w1_pins { pins = "PC10"; function = "gpio_in"; }; }; }; fragment@1 { target-path = "/"; __overlay__ { onewire@0 { compatible = "w1-gpio"; pinctrl-names = "default"; pinctrl-0 = <&w1_pins>; gpios = <&pio 2 10 0>; /* PC10 */ status = "okay"; }; }; }; }; I don't know what I need to correct to remove this info: [ 4.994076] w1-gpio onewire@0: there is not valid maps for state default
  12. Form firs message from dmesg is not clear sun50i-h616-pinctrl 300b000.pinctrl: pin PC10 already requested by onewire@0; cannot claim for 300b000.pinctrl:74 I see many similar problems z similar info for UART SPI etc , I suppose that we need to solve this problem or I am wrong
  13. I connect DS18B20 to orange Pi Zero on Armbian 23.02.2 Bullseye with Linux 6.1.63 Via armbian-config in Hardware enabled w1_gpio and add to armbiaEnv.txt param_w1_pin=PA14 param_w1_pin_int_pullup=0 and in overlyas= was w1_gpio cat /sys/bus/w1/devices/28-03165129ecff/w1_slave 54 01 4b 46 7f ff 0c 10 fd : crc=fd YES 54 01 4b 46 7f ff 0c 10 fd t=21250 cat /sys/kernel/debug/gpio gpiochip0: GPIOs 0-223, parent: platform/1c20800.pinctrl, 1c20800.pinctrl: gpio-14 ( |onewire@0 ) out hi gpio-17 ( |orangepi:red:status ) out lo gpio-20 ( |reg_vcc_wifi ) out hi gpio-166 ( |cd ) in lo ACTIVE LOW gpio-204 ( |usb0_id_det ) in hi IRQ dmesg |grep wire* [ 9.398674] Driver for 1-wire Dallas network protocol. [ 9.410366] gpio-14 (onewire@0): enforced open drain please flag it properly in DT/ACPI DSDT/board file [ 9.463654] w1_master_driver w1_bus_master1: Attaching one wire slave 28.03165129ecff crc 24 so all working very well on OZPI v1 with kernel 6.163 on Armbian 23.02.2 So my DS18B20 is work but on OZPI v3 with 6.6.30 kernel and user overlay for w1-gpio not work for me. It maybe we need more add in overlay for w1-gpio.dts?
  14. I checked new sensor DS18B20 but still the same error in dmesg info, so I will try with my RPI or OZPI v1 z kernel 6.1 check use w1-gpio overlay
  15. Thank you for your answer and suggestions. Hmm, the problem is that I have a DS18B20 sensor connected to OZPIv3, which I used in another project on another SBC. PIN DATA DS18B20 is connected to PC10 and through the 4k7 resistor to VCC 3.3V and the third pin DS18B20 to GND I will have to check this sensor again to see if RPI or OZPIv1 works on the 6.1.x kernel or I will take another unit for testing.
  16. I read again info https://docs.armbian.com/User-Guide_Allwinner_overlays/ and compile overlay by command: armbian-add-overlay w1-gpio.dts I see that in /boot/overlay-user/ is file w1-gpio.dtbo in /boot/armbianEnv.txt user_overlays=w1-gpio param_w1_pin=PC10 param_w1_pin_int_pullup=1 after this I reboot OZPI v3 after restart OZPIv3 I check dmesg info where found [ 4.990724] Driver for 1-wire Dallas network protocol. [ 4.997793] sun50i-h616-pinctrl 300b000.pinctrl: pin PC10 already requested by onewire@0; cannot claim for 300b000.pinctrl:74 [ 4.997833] w1-gpio onewire@0: gpio_request (pin) failed [ 4.997841] w1-gpio: probe of onewire@0 failed with error -22 cat /sys/kernel/debug/gpio gpiochip0: GPIOs 0-287, parent: platform/300b000.pinctrl, 300b000.pinctrl: gpio-76 ( |red:status ) out lo gpio-77 ( |green:power ) out hi gpio-80 ( |regulator-usb1-vbus ) out hi gpio-166 ( |cd ) in lo ACTIVE LOW gpio-210 ( |reset ) out hi ACTIVE LOW Can anyone help?
  17. Refer to https://docs.armbian.com/User-Guide_Allwinner_overlays/ The file sun50i-h616-w1-gpio.dtbo should be copied to /boot/overlay-user/ and /boot/armbinaEnv.txt should be to contain for DS18B20 connected to GPIO 74/PC10 user_overlays=w1-gpio param_w1_pin=PC10 param_w1_pin_int_pullup=1
  18. I found information that this is a dtc issue. The error can be suppressed with -W no-unit_address_vs_reg, for example: dtc -W no-unit_address_vs_reg -O dtb -o sun50i-h616-w1-gpio.dtbo sun50i-h616-w1-gpio.dts or warning can be squashed by adding #address-cells and #size-cells
  19. Much better, but still warning: sun50i-h616-w1-gpio.dts:20.35-26.27: Warning (unit_address_vs_reg): /fragment@1/__overlay__/onewire@0: node has a unit name, but no reg or ranges property
  20. I found another example dtoverlay support for 1-wire subsystem on H616 devices https://github.com/orangepi-xunlong/linux-orangepi/pull/21 /dts-v1/; /plugin/; / { compatible = "allwinner,sun50i-h616"; fragment@0 { target = <&pio>; __overlay__ { w1_pins: w1_pins { pins = "PC10"; function = "gpio_in"; }; }; }; fragment@1 { target-path = "/"; __overlay__ { onewire@0 { compatible = "w1-gpio"; pinctrl-names = "default"; pinctrl-0 = <&w1_pins>; gpios = <&pio 2 10 0>; /* PC10 */ status = "okay"; }; }; }; }; I will try used
  21. I tried to make of file with command: dtc -O dtb -o sun50i-h616-w1-gpio.dtbo sun50i-h616-w1-gpio.dts but result is with warring so we can not use example from Orange Pi Zero 2 to create dtbo file for OZPI v3 ? Warning (unit_address_vs_reg): /__local_fixups__/fragment@1/__overlay__/onewire@0: node has a unit name, but no reg or ranges property sun50i-h616-w1-gpio.dts:27.33-69: Warning (gpios_property): /fragment@1/__overlay__/onewire@0:gpios: cell 1 is not a phandle reference sun50i-h616-w1-gpio.dts:27.33-69: Warning (gpios_property): /fragment@1/__overlay__/onewire@0:gpios: Could not get phandle node for (cell 1)
  22. Hi @ag123 Thank you for the replay but in case the DS18B20 uses a 1-wire bus, libgpiod is used to use the deprecated sysfs interface to GPIO, so it does not apply in this case, but I may be wrong
  23. Looking to /boot/dtb-6.6.30-current-sunxi64/allwinner/overlay/ for h616 not exit dtbo sun50i-h616-w1-gpio.dtbo So for this reason not available in armbina-config in HARDWARE setup w1-gpio so we can not at current use 1-Wire sensor to define on which GPIO is connected 1-Wire sensor DS18B20 uses the 1-wire bus so it will be nice to have possibility use 1-Wire sensors with OZPI v3
  24. Hi, I am not sure but in HARDWARE armbian-config when we set [*] w1-gpio (on for example OZPI v1 with ArmBian v23) is only set automatic loading modules during start up system? modprobe wire modprobe w1-gpio modprobe w1-therm I do this manually and I see exist path in system /sys/bus/w1/devices/ but we need know how to set number GPIO to use 1-Wire hardware, on Armbian v23 (Debian v11) it was added in /boot/armbianEnv.txt param_w1_pin=PA14 param_w1_pin_int_pullup=1 but how do this in Armbian v25 (based on Debian v12) so if I would like to connect my thermal sensor to GPIO 74 (PC10) I should be set in armbianEnv.txt ? param_w1_pin=PC10 param_w1_pin_int_pullup=1
  25. For information purposes, that the 1.3-inch SH1106 OLED connected to I2C on OZPI v3 works very well OLED connected to PIN 3 of SDA and PIN 5 of SCK and in armbian-config in HARDWARE set to [*] i2c3-ph Using tools i2cdetect -y shows that the OLED is at address 0x3c All Python code with the adafruit library works fine
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines