TuryRx / Banana-pi-m2-zero-GPIO

gpio pin configuration and use project on Bananapi m2 zero board
38 stars 8 forks source link

Problem with SD image from download section. #14

Open electroscat opened 1 year ago

electroscat commented 1 year ago

Good time! The topic of this question does not apply to the author's GPIO work. However, I have not yet found a solution to this problem, so I want to know if the author of the project had a similar problem, and how it was solved.

In the image that the author provides for download with a preinstalled patch, bluetooth does not work.

Here are some details, the problem is most likely at the level of the driver, the bluetooth module:

Faced the same problem, bluetooth does not work.

pi@bananapim2zero:~$ dmesg | grep Blue
[    7.503852] Bluetooth: Core ver 2.22
[    7.504188] Bluetooth: HCI device and connection manager initialized
[    7.504217] Bluetooth: HCI socket layer initialized
[    7.504228] Bluetooth: L2CAP socket layer initialized
[    7.504264] Bluetooth: SCO socket layer initialized
[    7.657155] Bluetooth: HCI UART driver ver 2.3
[    7.657201] Bluetooth: HCI UART protocol H4 registered
[    7.657208] Bluetooth: HCI UART protocol BCSP registered
[    7.657369] Bluetooth: HCI UART protocol LL registered
[    7.657388] Bluetooth: HCI UART protocol ATH3K registered
[    7.657587] Bluetooth: HCI UART protocol Three-wire (H5) registered
[    7.658160] Bluetooth: HCI UART protocol Broadcom registered
[    9.911415] Bluetooth: hci0: command 0xfc18 tx timeout
[   17.911305] Bluetooth: hci0: BCM: failed to write update baudrate (-110)
[   17.911366] Bluetooth: hci0: Failed to set baudrate
[   19.983846] Bluetooth: hci0: command 0x0c03 tx timeout
[   21.908344] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   21.908386] Bluetooth: BNEP filters: protocol multicast
[   21.908412] Bluetooth: BNEP socket layer initialized
[   28.151347] Bluetooth: hci0: BCM: Reset failed (-110)
[   30.167373] Bluetooth: hci0: command 0xfc18 tx timeout
[   38.391358] Bluetooth: hci0: BCM: failed to write update baudrate (-110)
[   38.391399] Bluetooth: hci0: Failed to set baudrate
[   40.407355] Bluetooth: hci0: command 0x0c03 tx timeout
[   48.631404] Bluetooth: hci0: BCM: Reset failed (-110)
pi@bananapim2zero:~$
pi@bananapim2zero:~$ service bluetooth status
● bluetooth.service - Bluetooth service
     Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-03-04 21:36:25 IST; 1min 57s ago
       Docs: man:bluetoothd(8)
   Main PID: 1226 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 900)
     Memory: 2.0M
     CGroup: /system.slice/bluetooth.service
             └─1226 /usr/lib/bluetooth/bluetoothd

Mar 04 21:36:21 bananapim2zero systemd[1]: Starting Bluetooth service...
Mar 04 21:36:24 bananapim2zero bluetoothd[1226]: Bluetooth daemon 5.53
Mar 04 21:36:25 bananapim2zero systemd[1]: Started Bluetooth service.
Mar 04 21:36:25 bananapim2zero bluetoothd[1226]: Starting SDP server
Mar 04 21:36:25 bananapim2zero bluetoothd[1226]: Bluetooth management interface 1.21 initialized
pi@bananapim2zero:~$ service hciuart status
● hciuart.service - Configure Bluetooth Modems connected by UART
     Loaded: loaded (/lib/systemd/system/hciuart.service; enabled; vendor preset: enabled)
     Active: inactive (dead)
  Condition: start condition failed at Sat 2023-03-04 21:38:05 IST; 23s ago
             └─ ConditionFileNotEmpty=/proc/device-tree/soc/gpio@7e200000/bt_pins/brcm,pins was not met

Mar 04 21:37:38 bananapim2zero systemd[1]: Dependency failed for Configure Bluetooth Modems connected by
Mar 04 21:37:38 bananapim2zero systemd[1]: hciuart.service: Job hciuart.service/start failed with result
Mar 04 21:38:05 bananapim2zero systemd[1]: Condition check resulted in Configure Bluetooth Modems connect

the bluetooth service is working, but the hciuart service is dead, and after restarting it is also dead.

System:

pi@bananapim2zero:~$ uname -ra                                                                          
Linux bananapim2zero 5.15.93-sunxi #23.02.2 SMP Fri Feb 17 23:49:46 UTC 2023 armv7l armv7l armv7l GNU/Linux
pi@bananapim2zero:~$ rfkill list
0: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no
1: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no

Devices are missing.

Please advise what can be done? I need to connect a wireless keyboard to my device, I can't do it...

Device Bananapi m2 zero

Thanks in advance for any response!

Detailed system information:

pi@bananapim2zero:~$ inxi -Fxxxrz
System:    Kernel: 5.15.93-sunxi armv7l bits: 32 compiler: N/A Console: tty 0 dm: N/A
           Distro: Ubuntu 20.04.5 LTS (Focal Fossa)
Machine:   Type: ARM Device System: Banana Pi BPI-M2-Zero details: Allwinner sun8i Family rev: N/A
           serial: <filter>
CPU:       Topology: Quad Core model: ARMv7 v7l variant: cortex-a7 bits: 32 type: MCP arch: v7l
           rev: 5
           features: Use -f option to see features bogomips: 260
           Speed: 1368 MHz max: 1368 MHz Core speeds (MHz): 1: 1368 2: 1368 3: 1368 4: 1368
Graphics:  Device-1: sun8i-h3-mali driver: lima v: kernel bus ID: N/A chip ID: allwinner:1c40000
           Device-2: sun8i-h3-dw-hdmi driver: sun8i_dw_hdmi v: N/A bus ID: N/A
           chip ID: allwinner:1ee0000
           Device-3: sun8i-h3-display-engine driver: sun4i_drm v: N/A bus ID: N/A
           chip ID: allwinner:display-engine
           Display: server: No display server data found. Headless machine? tty: 105x51
           Message: Unable to show advanced data. Required tool glxinfo missing.
Audio:     Device-1: sun8i-h3-dw-hdmi driver: sun8i_dw_hdmi bus ID: N/A chip ID: allwinner:1ee0000
           Device-2: sun9i-a80-hdmi-audio driver: sun9i_hdmi_audio v: kernel bus ID: N/A
           chip ID: allwinner:sound_hdmi
           Device-3: Generalplus type: USB driver: hid-generic,snd-usb-audio,usbhid bus ID: 1-1.4:5
           chip ID: 1b3f:2008
           Sound Server: ALSA v: k5.15.93-sunxi
Network:   Device-1: mmc-pwrseq-simple driver: pwrseq_simple v: kernel port: N/A bus ID: N/A
           chip ID: mmc-pwrseq-simple:wifi_pwrseq
           Device-2: sun8i-h3-emac driver: N/A port: N/A bus ID: N/A chip ID: allwinner:soc
           IF: enx00e04c534458 state: up speed: 100 Mbps duplex: full mac: <filter>
           Device-3: ICS Advent DM9601 Fast Ethernet Adapter type: USB driver: dm9601 bus ID: 1-1.2:4
           chip ID: 0fe6:9700
           IF: enx00e04c534458 state: up speed: 100 Mbps duplex: full mac: <filter>
           IF-ID-1: wlan0 state: down mac: <filter>
Drives:    Local Storage: total: 11.15 GiB used: 3.20 GiB (28.7%)
           ID-1: /dev/mmcblk0 model: SS08G size: 7.40 GiB serial: <filter> scheme: MBR
           ID-2: /dev/sda type: USB model: General USB Flash Disk size: 3.75 GiB serial: <filter>
           rev: 1100 scheme: MBR
Partition: ID-1: / size: 6.83 GiB used: 3.19 GiB (46.6%) fs: ext4 dev: /dev/mmcblk0p1
           ID-2: /var/log size: 48.4 MiB used: 12.8 MiB (26.4%) fs: ext4 dev: /dev/zram1
Sensors:   System Temperatures: cpu: 59.0 C mobo: N/A
           Fan Speeds (RPM): N/A
Repos:     Active apt repos in: /etc/apt/sources.list
           1: deb http://ports.ubuntu.com/ focal main restricted universe multiverse
           2: deb http://ports.ubuntu.com/ focal-security main restricted universe multiverse
           3: deb http://ports.ubuntu.com/ focal-updates main restricted universe multiverse
           4: deb http://ports.ubuntu.com/ focal-backports main restricted universe multiverse
           5: deb http://ports.ubuntu.com/ubuntu-ports/ focal universe multiverse restricted
           Active apt repos in: /etc/apt/sources.list.d/armbian.list
           1: deb http://apt.armbian.com focal main focal-utils focal-desktop
           Active apt repos in: /etc/apt/sources.list.d/ekundo_ppa_list_file.list
           1: deb [signed-by=/etc/apt/trusted.gpg.d/ekundo_ppa.gpg] https://ekundo.github.io/mc/ppa ./
Info:      Processes: 127 Uptime: 42m Memory: 491.7 MiB used: 110.3 MiB (22.4%) Init: systemd v: 245
           runlevel: 5 Compilers: gcc: 9.4.0 alt: 9 Shell: bash v: 5.0.17 running in: tty 0 (SSH)
           inxi: 3.0.38
pi@bananapim2zero:~$

Help solve the problem, this assembly is very good, everything you need except bluetooth works on it. Please help, at least throw a link to some forum to solve the problem.

TuryRx commented 1 year ago

Hi friend, good morning

Yes, in fact, I had already been told a bit about this topic but I didn't have much time to dedicate to it, but in the review I was preliminary assuming that you are using this image

https://www.mediafire.com/file/rt3ww2bvezotqsg/Banana_Pi_M2Z_GPIO_28_03_22.rar/file

check that it is the subject of an update since it reconfigures the driver here there are two solutions the first is to generate a more updated sun8i-h2-plus-bananapi-m2-zero.dtb so that you can replace it in the image of your sd, with this would only have to replace the file give an update an upgrade and a full-upgrade

The second is to replace the bluetooth module configuration but in practical cases this only worked for me once.

And for later issues I made this image very green, weighing in on other functionalities and in this case, modifying certain issues or making an update can damage something or modify a dependency, but I am currently correcting this and I hope that as soon as I finish the new compilations can generate a new image already preconfigured

electroscat commented 1 year ago

I understood what the problem is. Bluetooth uses UART, and when all (3) UARTs are selected at once in the equipment settings, bluetooth cannot work. If you leave at least 1 UART unselected, the driver starts without errors and everything works as it should.

https://user-images.githubusercontent.com/62630527/176098535-1e0e271e-efa2-4d2a-9b33-d79351db8bed.PNG Here it is necessary to clarify that if you select all three UARTs, then the bluetooth will not work, the driver will fail with an error.

TuryRx commented 1 year ago

ok friend, I had not seen it that way since the first thing that came to my mind with that problem is that it was a matter of controllers or dependencies, that is why I had the option of the dtb file but now that you tell me I think that I could correct this from the overlay layer to be able to continue using the uart port or the other case would only be handling a uart but I think that should be seen according to the needs :smile: