wollik Posted November 25 Posted November 25 Hi Forum Members, I need have to activate a 1-wire thermal sensor DS1820 on al old BPI M1. I've had these type of sensors allready runing on a BPI M2Zero under Buster (Armbian Kernel: 5.10.60-sunxi) wih these settings in /boot/armbianEnv.txt: overlays=w1-gpio param_w1_pin=PA6 dmesg | grep -E 'w1|wire' [ 6.806929] Driver for 1-wire Dallas network protocol. [ 6.847601] gpio-6 (onewire@0): enforced open drain please flag it properly in DT/ACPI DSDT/board file [ 6.875871] w1_master_driver w1_bus_master1: Attaching one wire slave 28.0121121d29c5 crc 9a [ 7.020059] w1_master_driver w1_bus_master1: Attaching one wire slave 28.0121115aaa65 crc c1 [ 7.115896] w1_master_driver w1_bus_master1: Attaching one wire slave 28.012111456c5b crc 23 [ 7.212969] w1_master_driver w1_bus_master1: Attaching one wire slave 28.0121121afabf crc 5b [ 7.299832] w1_master_driver w1_bus_master1: Attaching one wire slave 28.01211165dfbf crc a7 [ 8.527889] Bluetooth: HCI UART protocol Three-wire (H5) registered and is also shown via: sudo cat /sys/kernel/debug/gpio as: gpiochip0: GPIOs 0-223, parent: platform/1c20800.pinctrl, 1c20800.pinctrl: gpio-6 ( |onewire@0 ) out hi gpio-7 ( |sysfs ) out lo gpio-8 ( |sysfs ) out lo gpio-9 ( |sysfs ) out lo gpio-10 ( |sysfs ) out lo gpio-21 ( |sysfs ) out lo gpio-166 ( |cd ) in hi gpio-203 ( |host-wakeup ) in lo IRQ gpio-204 ( |shutdown ) out hi gpio-205 ( |device-wakeup ) out lo gpiochip1: GPIOs 352-383, parent: platform/1f02c00.pinctrl, 1f02c00.pinctrl: gpio-353 ( |vdd-cpux ) out hi gpio-355 ( |power ) in hi IRQ ACTIVE LOW gpio-356 ( |sysfs ) out lo gpio-358 ( |usb0_id_det ) in hi IRQ gpio-359 ( |reset ) out hi ACTIVE LOW gpio-362 ( |bananapi-m2-zero:red) out lo Now on the BPI M1 also under Buster (Armbian Kernel: 5.10.16-sunxi) it is not possible to use this pin PA6. I got these errors: dmesg | grep -E 'w1|wire' [ 6.641667] Driver for 1-wire Dallas network protocol. [ 6.666672] sun4i-pinctrl 1c20800.pinctrl: pin PA6 already requested by 1c50000.ethernet; cannot claim for onewire@0 [ 6.666696] sun4i-pinctrl 1c20800.pinctrl: pin-6 (onewire@0) status -22 [ 6.666717] w1-gpio onewire@0: Error applying setting, reverse things back [ 6.666750] w1-gpio: probe of onewire@0 failed with error -22 I've tried also other PA's but allways the same problems. I know that the Buster Kernels are no longer supported, but have the general question about the GPIO Pin naming/mapping to the physical Pins for the 26 and 40 Pin Headers used by Armbian for what SOC's please. Thands in advance wollik 0 Quote
SteeMan Posted November 25 Posted November 25 Moved to community support section and added BPI M1 tag. 0 Quote
wollik Posted November 26 Author Posted November 26 Hi all, I've updated my BPI M1 to Armbian 24.11.1 bookworm and still get the same problems to use the PA6 pin for 1-Wire. dmesg | grep -i "onewire" [ 6.685838] sun4i-pinctrl 1c20800.pinctrl: pin PA6 already requested by 1c50000.ethernet; cannot claim for onewire@0 [ 6.685884] sun4i-pinctrl 1c20800.pinctrl: pin-6 (onewire@0) status -22 [ 6.686020] w1-gpio onewire@0: Error applying setting, reverse things back I've activated the w1 via armbian-config under: System -> SY017 - Manage device tree overlays -> first only sun7i then only sun4i and also both sun7i plus sun4i but always got the same error after the reboots. I'm wondering why dmesg points to sun4i even when I have only selected/activated sun7i in the device tree overlays. Any idea? Regards wollik 0 Quote
eselarm Posted November 26 Posted November 26 I see Allwinner A20 is a mix of sun4i and sun7i as drivers in dmesg. I have only temp sensors on Allwinner H3 that is sun8i, at least I see other pinctrl there. My BPI M1 must run for a week or more for figuring out another problem, but at some point I could connect a 1-wire temp sensor and see what happens. I used direct editing of armbianEnv.txt What is in yours? 0 Quote
Ryzer Posted Saturday at 05:06 PM Posted Saturday at 05:06 PM Hi Wollik, I would suggest avoiding using any Port A pins as these tend to be use for the Ethernet connector hence the error message above. Please refer to the Actually schematic for the BPI MI. You can find a copy here: https://linux-sunxi.org/LeMaker_Banana_Pi. The Allwinner A20 and A10 both share the same pin controller driver, which is why it shows up the log as sun4i. Best of luck Ryzer 0 Quote
Solution wollik Posted Sunday at 04:46 PM Author Solution Posted Sunday at 04:46 PM @eselarm, YES, just edit the /boot/armbianEnv.txt file. See my example for the PIN 7 of an BPI M1 below. @Ryzer, your provided link has no mapping of the GPIO Pins to there PIN Names only there PIN Funktions are listed. But these PIN Names must be specified in as a parameter to use the 1w Protokoll. LeMarker Docu: PIN: Function:--> Needed PIN Name as parameter in /boot/armbianEnv.txt: 7 GPCLK --> PI03 11 IO-0 --> PI19 13 IO-2 --> PI18 15 IO-3 --> PI17 Hi All, I got my DS1820 (temp sensor) now running. My plan was to use the Pin 7 of CON3 (26 Pin connector) and tried with PA6 and others, but always got the dmesg errors "pin xx already requested by 1c50000.ethernet; cannot claim for onewire@0" That was why I asked for a PIN mapping of the CON3 on the BPI M1. After long searching I found a list in the freebsd.org forum with the right pins! Now with these settings in the /boot/armbianEnv.txt I got my DS1820 connected to the physical pin 7 to function!!! overlay_prefix=sun7i-a20 overlays=w1-gpio param_w1_pin=PI03 I'll try to get the PIN Names of all my other BPIxx models and will post it here. Many thanks for your support. wollik 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.