Top pHat problems

I have the 16653 and am using kernel 5.10.63-v7+

I am having issues with the Buttons, Audio and Display.

I am using a 3b+ with the standard 5v 2.5a supply.

The Audio issue:

The audio works until I start the display (add dtoverlay=rpi-display,speed=32000000,rotate=270 in my boot/config.txt). At that point the audio service stops and the audio device is not seen. aplay -l no longer shows the wm8960soundcard, but sudo dkms status does!

The buttons:

I do not have a device at 0x71. I get:

Error connecting to Device: 71, [Errno 121] Remote I/O error.

The Top pHAT button device isn’t connected to the system.

from i2c tools

i2cdetect -l: i2c-1 and i2c-2

i2cdetect -y -r -1: device at 0x1a

i2cdetect -y -r -2: no devices.

I assume a problem with the ATTINY84 address not programmed? Buttons do not work regardless if the display is used or not.

The Display.

White background (very bright). black characters (I actually like this, easy to read)

The LED’s work with no problems.

Thanks for any help.

The WM8960 uses i2S instead of i2C; be sure to run through this OS config section here https://learn.sparkfun.com/tutorials/sp … -guide/all to ensure the settings are ready for the pHAT which is probably the hold-up

There are quite a few steps to get everything jiving together…be sure to do the WM8960 Driver install portion as well

As a last resort, you could test it with this alternate driver https://github.com/larsimmisch/pyalsaaudio

Could you please post a config.txt from the /boot directory for a card that is fully functional. Also could you post the results of a sudo i2cdetect -y -r 1

I am expecting the results of the i2cdetect to show the default device (UU) at 0x1a and a device at 0x71. The buttons python script tries to use the device at 0x71.

Below is my config.txt - with this one my audio works but my display DOES NOT work. If I comment out the wm8960 overlay than my display works but my audio DOES NOT WORK.

Also note: if I uncomment i2s=on my display DOES NOT WORK.

For more options and information see

http://rpf.io/configtxt

Some settings may impact device functionality. See link above for details

uncomment if you get no picture on HDMI for a default “safe” mode

#hdmi_safe=1

uncomment the following to adjust overscan. Use positive numbers if console

goes off screen, and negative if there is too much border

#overscan_left=16

#overscan_right=16

#overscan_top=16

#overscan_bottom=16

uncomment to force a console size. By default it will be display’s size minus

overscan.

#framebuffer_width=1280

#framebuffer_height=720

uncomment if hdmi display is not detected and composite is being output

#hdmi_force_hotplug=1

uncomment to force a specific HDMI mode (this will force VGA)

#hdmi_group=1

#hdmi_mode=1

uncomment to force a HDMI mode rather than DVI. This can make audio work in

DMT (computer monitor) modes

#hdmi_drive=2

uncomment to increase signal to HDMI, if you have interference, blanking, or

no display

#config_hdmi_boost=4

uncomment for composite PAL

#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.

#arm_freq=800

Uncomment some or all of these to enable the optional hardware interfaces

dtparam=i2c_arm=on

#dtparam=i2s=on

dtparam=spi=on

#dtoverlay=i2s-mmap

Uncomment this to enable infrared communication.

#dtoverlay=gpio-ir,gpio_pin=17

#dtoverlay=gpio-ir-tx,gpio_pin=18

Additional overlays and parameters are documented /boot/overlays/README

Enable audio (loads snd_bcm2835)

dtparam=audio=on

Automatically load overlays for detected cameras

#camera_auto_detect=1

Automatically load overlays for detected DSI displays

#display_auto_detect=1

Enable DRM VC4 V3D driver

dtoverlay=vc4-kms-v3d

max_framebuffers=2

Disable compensation for displays with overscan

disable_overscan=1

[cm4]

Enable host mode on the 2711 built-in XHCI USB controller.

This line should be removed if the legacy DWC2 controller is required

(e.g. for USB device mode) or if USB support is not required.

otg_mode=1

[all]

[pi4]

Run as fast as firmware / board allows

#arm_boost=1

[all]

dtoverlay=rpi-display,speed=32000000,rotate=90

dtoverlay=wm8960-soundcard

Thanks!

PROBLEM SOLVED. AUDIO AND DISPLAY WORKING!

Tested on buster and bullseye

I did a dmesg and saw that I had a conflict on pin 18 with i2s so I removed it!

Do this.

cd to wherever you have your sfe-topphat-overlay.dts

sudo nano sfe-topphat-overlay.dts

look for lines:

brcm,pins = <18 23 24 25>;

brcm,function=<1 1 1 0>; /* out out out in */

brcm,pull = <0 0 0 2>; /* - - - up */

CHANGE TO THIS

brcm,pins = <23 24 25>;

brcm,function=<1 1 0>; /* out out out in */

brcm,pull = <0 0 2>; /* - - - up */

Then ctrl O (write)

ctrl X (save)

I removed my old .dtbo

rm rpi-display.dtbo

then:

dtc -@ -I dts -O dtb -o rpi-display.dtbo sfe-topphat-overlay.dts

to be safe I cd to /boot/overlays and sudo rm rpi-display.dtbo

now cd back to where your new rpi-display.dtbo is.

then:

sudo cp rpi-display.dtbo /boot/overlays

you should be good to go.

Needed to alter sfe-topphat-overlay.dts further - completely remove gpio 18 and 25). Here it is:

/*

  • Device Tree overlay for the SparkFun Electronics Top Phat

  • Adapted from the dts file from watterott: https://github.com/watterott/RPi-Display

  • dtc -@ -I dts -O dtb -o rpi-display.dtbo sfe-topphat-overlay.dts

  • To Deploy:

    • Compile as noted above
    • Copy the dtbo overlay file into /boot/overlays
    • Add this to /boot/config.txt
  • dtoverlay=rpi-display,speed=32000000,rotate=270

*/

/dts-v1/;

/plugin/;

/ {

compatible = “brcm,bcm2835”;

fragment@0 {

target = <&spi0>;

overlay {

status = “okay”;

};

};

fragment@1 {

target = <&spidev0>;

overlay {

status = “disabled”;

};

};

fragment@2 {

target = <&spidev1>;

overlay {

status = “disabled”;

};

};

fragment@3 {

target = <&gpio>;

overlay {

rpi_display_pins: rpi_display_pins {

brcm,pins = <23 24>;

brcm,function = <1 1>; /* out out out in */

brcm,pull = <0 0>; /* - - - up */

};

};

};

fragment@4 {

target = <&spi0>;

overlay {

/* needed to avoid dtc warning */

#address-cells = <1>;

#size-cells = <0>;

rpidisplay: rpi-display@0{

compatible = “ilitek,ili9341”;

reg = <0>;

pinctrl-names = “default”;

pinctrl-0 = <&rpi_display_pins>;

spi-max-frequency = <32000000>;

rotate = <270>;

bgr;

fps = <30>;

buswidth = <8>;

reset-gpios = <&gpio 23 1>;

dc-gpios = <&gpio 24 0>;

debug = <0>;

};

};

};

overrides {

speed = <&rpidisplay>,“spi-max-frequency:0”;

rotate = <&rpidisplay>,“rotate:0”;

fps = <&rpidisplay>,“fps:0”;

debug = <&rpidisplay>,“debug:0”;

};

};

Hello! I’m running a DEV-16653 on a Pi 2 B (Raspian 5.10 kernel) and running into the same issue re: display - black text on very bright background.

Thanks for posting this overlay! If I’m reading this correctly, this overlay will get display and sound both working together. But based on my experience, it doesn’t solve the bright background / dark text situation.

@da1 - Did your overall efforts manage to change the console brightness/color ?

@TS-Russel - Should I start a new thread/post for this specific issue?

Thanks for the fun.

I have encountered the same (or at least very similar) problem. I am using a Top Phat DEV-16653 and a RPi 4. The OS version is 5.10. The display has a very bright background with black text. When I use programs like “fbi” to display images, the colors are inverted.

When examining kernel messages via “dmesg” I noticed the following error but I don’t know if it is relevant:

v3d fec00000.v3d: MMU error from client L2T (0) at 0x6c61000, pte invalid

Did anyone find a solution to this problem?