redbear / IoT_pHAT

WiFi + Bluetooth, designed for the Raspberry Pi Zero
110 stars 32 forks source link

init_uart_clock #4

Closed Cheong2K closed 7 years ago

Cheong2K commented 7 years ago

The default clock for UART0 is 3MHz but we need 48MHz to work for the Bluetooth as Pi3 is. Please also read this: https://github.com/raspberrypi/linux/issues/1601

Cheong2K commented 7 years ago

init_uart_clock will no longer required for the Pi Zero to set the UART clock to 48MHz in the next release of Raspbian distro.

raspberrypi/firmware#643

rpzl commented 7 years ago

One comment on this:

I had the IoT working with the clock set at 48Mhz (checked with systemctl status hciuart.service) and then i performed a rpi-update as per issue #643. After the succesful firmware update the bluetooth does not work with or without the clock speed at 48MHz

Also when it was working the bluetooth icon does not appear on the screen but i was able to search for the Gamepad provided with "bluetoothctl", but was not able to connect with a "blueZ" error

Cheong2K commented 7 years ago

Did you update the EEPROM to v0.3 yet?

rpzl commented 7 years ago

Yeap. Updated to EEPROM to 0.3 and then tried the 48 MHz memory clock -> working rpi-update and 48MHz clock -> NOT Working rpi-update removed 48MHz clock -> NOT Working

All tested last night after i received the IoT.

I will try and take some screenshots and send later when i get home

Cheong2K commented 7 years ago

$ dmesg | grep bcm2708.uart

You will see bcm2708.uart_clock=48000000

Cheong2K commented 7 years ago

$ cat /proc/device-tree/hat/product

You will see IoT pHAT w/eep_v0.3

rpzl commented 7 years ago

will send screenshots later today. Thank you for the fast replies :)

rpzl commented 7 years ago

I first upgraded the EEPROM, then made an rpi-update and then followed with an apt-get upgrade. The apt-get upgrade is what corrected the errors i was having above.

Thank you @Cheong2K

Cheong2K commented 7 years ago

Tested again, after apt-get upgrade, it will change the UART back to 3 MHz.

Cheong2K commented 7 years ago

Fixed in latest version.