Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LEDs and Buzzer on reTerminal cannot be used after flashing new RPi OS #42

Open
lakshanthad opened this issue Apr 28, 2022 · 12 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@lakshanthad
Copy link
Contributor

lakshanthad commented Apr 28, 2022

Describe the bug
After flashing the reTerminal with a different RPi OS other than the factory OS, LEDs and Buzzer do not work anymore.

To Reproduce
Steps to reproduce the behavior:

  1. Flash reTerminal with a fresh RPi OS (32-bit Buster/ 64-bit Buster/ 32-bit Bullseye/ 64-bit Bullseye)
  2. Install reTerminal overlays
  3. "i2cdetect -y 1" shows that the "I/O Expansion chip drivers" are loaded at 0x20
pi@raspberrypi:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- UU -- -- -- -- -- --
20: UU -- -- -- -- -- -- -- -- UU -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- UU -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
  1. However, when "/sys/class/leds/" directory is accessed, "usr_led0, usr_led1, usr_led2 and usr_buzzer" are not available
pi@raspberrypi:~ $ sudo -i
root@raspberrypi:~# ls /sys/class/leds/
default-on  mmc0  mmc0::

Expected behavior
This problem is not present when using the reTerminal images provided by Seeed

Temporary Workaround
This issue can be temporarily fixed by uncommenting the following line inside "/boot/config.txt" and rebooting the device

#dtoverlay=reTerminal-bridge

@bigbearishappy Please help to fix this issue

Thank you

Best Regards,
Lakshantha

@lakshanthad lakshanthad added the bug Something isn't working label Apr 28, 2022
@bigbearishappy
Copy link
Member

As we can see from the dts source code of reterminal bridge.
And the base kernel driver of pcf8575 is here.

The kernel driver of leds is base on the driver of pcf8575.
When we don't have the hardware of pcf8575. The kernel driver of leds can not finish it's probe code.
And all the leds will not work fine.And the code will return in here

@bigbearishappy
Copy link
Member

What is the output of lsmod when there is no "usr_led0, usr_led1, usr_led2 and usr_buzzer" under /sys/class/leds/?

@lakshanthad
Copy link
Contributor Author

lakshanthad commented May 19, 2022

Hello @bigbearishappy,

The following is the output you requested:

pi@raspberrypi:~ $ lsmod
Module                  Size  Used by
rfcomm                 49152  4
cmac                   16384  3
algif_hash             16384  1
aes_arm_bs             24576  2
crypto_simd            16384  1 aes_arm_bs
cryptd                 24576  2 crypto_simd
algif_skcipher         16384  1
af_alg                 28672  6 algif_hash,algif_skcipher
bnep                   20480  2
hci_uart               40960  1
btbcm                  16384  1 hci_uart
bluetooth             405504  31 hci_uart,bnep,btbcm,rfcomm
ecdh_generic           16384  2 bluetooth
ecc                    40960  1 ecdh_generic
snd_soc_hdmi_codec     20480  2
rtc_pcf8563            16384  0
mipi_dsi               32768  0
gpio_pca953x           28672  0
als_ltr30x             20480  0
industrialio_triggered_buffer    16384  1 als_ltr30x
kfifo_buf              16384  1 industrialio_triggered_buffer
bq24179_charger        20480  0
pinctrl_mcp23s08_i2c    16384  8
industrialio           81920  3 als_ltr30x,industrialio_triggered_buffer,kfifo_buf
pinctrl_mcp23s08       16384  1 pinctrl_mcp23s08_i2c
gpio_pcf857x           16384  0
lis331dlh_i2c          28672  0
snd_soc_wm8960         36864  0
regmap_i2c             16384  5 pinctrl_mcp23s08_i2c,gpio_pca953x,als_ltr30x,bq24179_charger,snd_soc_wm8960
mcp251xfd              40960  0
can_dev                32768  1 mcp251xfd
spidev                 20480  0
8021q                  32768  0
garp                   16384  1 8021q
stp                    16384  1 garp
llc                    16384  2 garp,stp
brcmfmac              335872  0
brcmutil               20480  1 brcmfmac
cfg80211              765952  1 brcmfmac
rfkill                 32768  6 bluetooth,cfg80211
joydev                 20480  0
raspberrypi_hwmon      16384  0
v3d                    77824  8
gpu_sched              45056  1 v3d
snd_soc_simple_card    20480  0
snd_soc_simple_card_utils    24576  1 snd_soc_simple_card
i2c_brcmstb            16384  0
bcm2835_isp            32768  0
spi_bcm2835            20480  0
bcm2835_v4l2           45056  0
videobuf2_vmalloc      16384  1 bcm2835_v4l2
i2c_bcm2835            16384  0
bcm2835_codec          45056  0
snd_soc_bcm2835_i2s    16384  0
bcm2835_mmal_vchiq     32768  3 bcm2835_isp,bcm2835_codec,bcm2835_v4l2
v4l2_mem2mem           36864  1 bcm2835_codec
videobuf2_dma_contig    20480  2 bcm2835_isp,bcm2835_codec
videobuf2_memops       16384  2 videobuf2_dma_contig,videobuf2_vmalloc
videobuf2_v4l2         32768  4 bcm2835_isp,bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem
videobuf2_common       65536  8 bcm2835_isp,bcm2835_codec,videobuf2_dma_contig,videobuf2_vmalloc,videobuf2_memops,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
snd_bcm2835            24576  0
videodev              245760  6 bcm2835_isp,bcm2835_codec,videobuf2_common,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
vc_sm_cma              32768  2 bcm2835_isp,bcm2835_mmal_vchiq
vc4                   278528  11
mc                     49152  6 bcm2835_isp,bcm2835_codec,videobuf2_common,videodev,v4l2_mem2mem,videobuf2_v4l2
cec                    49152  1 vc4
drm_kms_helper        274432  3 vc4
snd_soc_core          233472  6 vc4,snd_soc_hdmi_codec,snd_soc_simple_card_utils,snd_soc_bcm2835_i2s,snd_soc_wm8960,snd_soc_simple_card
snd_compress           20480  1 snd_soc_core
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_pcm               114688  7 snd_compress,snd_pcm_dmaengine,snd_soc_hdmi_codec,snd_soc_bcm2835_i2s,snd_bcm2835,snd_soc_core,snd_soc_wm8960
rpivid_mem             16384  0
snd_timer              32768  1 snd_pcm
snd                    81920  7 snd_compress,snd_soc_hdmi_codec,snd_timer,snd_bcm2835,snd_soc_core,snd_soc_wm8960,snd_pcm
syscopyarea            16384  1 drm_kms_helper
gpio_keys              20480  0
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
fb_sys_fops            16384  1 drm_kms_helper
uio_pdrv_genirq        16384  0
nvmem_rmem             16384  0
uio                    20480  1 uio_pdrv_genirq
i2c_dev                20480  0
drm                   536576  15 mipi_dsi,v3d,vc4,gpu_sched,drm_kms_helper
fuse                  131072  3
drm_panel_orientation_quirks    16384  1 drm
backlight              20480  3 mipi_dsi,drm_kms_helper,drm
ip_tables              28672  0
x_tables               32768  1 ip_tables
ipv6                  520192  46

Thank you

@bigbearishappy
Copy link
Member

@lakshanthad
The driver gpio_pcf857x should not be probed when there is no hardware of pcf8575.
I check the code and find a error in it.
Please help me to verify if the change works.
Thank you!

@lakshanthad
Copy link
Contributor Author

Hello @bigbearishappy,

I have tried with the latest code, but the issue is still there.

This is when "reTerminal-bridge" is enabled.

root@raspberrypi:/sys/class/leds# ls
default-on  mmc0  mmc0::
pi@raspberrypi:~ $ lsmod
Module                  Size  Used by
rfcomm                 49152  4
cmac                   16384  3
algif_hash             16384  1
aes_arm_bs             24576  2
crypto_simd            16384  1 aes_arm_bs
cryptd                 24576  2 crypto_simd
algif_skcipher         16384  1
af_alg                 28672  6 algif_hash,algif_skcipher
bnep                   20480  2
hci_uart               40960  1
btbcm                  16384  1 hci_uart
bluetooth             405504  31 hci_uart,bnep,btbcm,rfcomm
ecdh_generic           16384  2 bluetooth
ecc                    40960  1 ecdh_generic
joydev                 20480  0
snd_soc_hdmi_codec     20480  2
lis331dlh_i2c          28672  0
snd_soc_wm8960         36864  0
mipi_dsi               32768  0
bq24179_charger        20480  0
gpio_pcf857x           16384  0
gpio_pca953x           28672  0
als_ltr30x             20480  0
industrialio_triggered_buffer    16384  1 als_ltr30x
kfifo_buf              16384  1 industrialio_triggered_buffer
industrialio           81920  3 als_ltr30x,industrialio_triggered_buffer,kfifo_buf
pinctrl_mcp23s08_i2c    16384  8
pinctrl_mcp23s08       16384  1 pinctrl_mcp23s08_i2c
regmap_i2c             16384  5 pinctrl_mcp23s08_i2c,gpio_pca953x,als_ltr30x,bq24179_charger,snd_soc_wm8960
rtc_pcf8563            16384  0
8021q                  32768  0
garp                   16384  1 8021q
stp                    16384  1 garp
mcp251xfd              40960  0
llc                    16384  2 garp,stp
spidev                 20480  0
can_dev                32768  1 mcp251xfd
brcmfmac              335872  0
brcmutil               20480  1 brcmfmac
cfg80211              765952  1 brcmfmac
rfkill                 32768  6 bluetooth,cfg80211
snd_soc_simple_card    20480  0
v3d                    77824  8
gpu_sched              45056  1 v3d
snd_soc_simple_card_utils    24576  1 snd_soc_simple_card
raspberrypi_hwmon      16384  0
bcm2835_isp            32768  0
bcm2835_v4l2           45056  0
bcm2835_codec          45056  0
videobuf2_vmalloc      16384  1 bcm2835_v4l2
bcm2835_mmal_vchiq     32768  3 bcm2835_isp,bcm2835_codec,bcm2835_v4l2
v4l2_mem2mem           36864  1 bcm2835_codec
videobuf2_dma_contig    20480  2 bcm2835_isp,bcm2835_codec
videobuf2_memops       16384  2 videobuf2_dma_contig,videobuf2_vmalloc
i2c_brcmstb            16384  0
videobuf2_v4l2         32768  4 bcm2835_isp,bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem
vc_sm_cma              32768  2 bcm2835_isp,bcm2835_mmal_vchiq
videobuf2_common       65536  8 bcm2835_isp,bcm2835_codec,videobuf2_dma_contig,videobuf2_vmalloc,videobuf2_memops,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
snd_soc_bcm2835_i2s    16384  0
videodev              245760  6 bcm2835_isp,bcm2835_codec,videobuf2_common,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
i2c_bcm2835            16384  0
spi_bcm2835            20480  0
mc                     49152  6 bcm2835_isp,bcm2835_codec,videobuf2_common,videodev,v4l2_mem2mem,videobuf2_v4l2
snd_bcm2835            24576  0
vc4                   278528  11
cec                    49152  1 vc4
drm_kms_helper        274432  3 vc4
snd_soc_core          233472  6 vc4,snd_soc_hdmi_codec,snd_soc_simple_card_utils,snd_soc_bcm2835_i2s,snd_soc_wm8960,snd_soc_simple_card
snd_compress           20480  1 snd_soc_core
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_pcm               114688  7 snd_compress,snd_pcm_dmaengine,snd_soc_hdmi_codec,snd_soc_bcm2835_i2s,snd_bcm2835,snd_soc_core,snd_soc_wm8960
snd_timer              32768  1 snd_pcm
snd                    81920  7 snd_compress,snd_soc_hdmi_codec,snd_timer,snd_bcm2835,snd_soc_core,snd_soc_wm8960,snd_pcm
syscopyarea            16384  1 drm_kms_helper
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
rpivid_mem             16384  0
fb_sys_fops            16384  1 drm_kms_helper
gpio_keys              20480  0
nvmem_rmem             16384  0
uio_pdrv_genirq        16384  0
uio                    20480  1 uio_pdrv_genirq
i2c_dev                20480  0
drm                   536576  15 mipi_dsi,v3d,vc4,gpu_sched,drm_kms_helper
drm_panel_orientation_quirks    16384  1 drm
backlight              20480  3 mipi_dsi,drm_kms_helper,drm
fuse                  131072  3
ip_tables              28672  0
x_tables               32768  1 ip_tables
ipv6                  520192  46

@lakshanthad
Copy link
Contributor Author

lakshanthad commented May 19, 2022

On a side note, my reTerminal has the "mcp23008" expansion chip and I have enabled it with "dtoverlay=reTerminal,addr=0x20,mcp23008" inside /boot/config.txt

bigbearishappy added a commit that referenced this issue May 26, 2022
Because there is a issue with bridge which affect
the basic function of retermina.
#42
TODO:
this commit need to be reverted after the issue fixed.
@dhoetger
Copy link

dhoetger commented Jun 3, 2022

Since the reTerminal Bridge / E10-1 is now shipping, could the reTerminal Bridge wiki be updated to reflect that the workaround has rendered the driver install process temporarily non-functional?

@lakshanthad
Copy link
Contributor Author

Hello @bigbearishappy,

Please revert this commit:
5acdeab

I have added to FAQ until a fix is found:
https://wiki.seeedstudio.com/reTerminal-FAQ/#q12-leds-and-buzzer-do-not-work-after-installing-reterminal-drivers

Let's keep the issue open until it is fixed.

Thank you

@matsujirushi
Copy link
Contributor

Customers are confused because after installing the driver the LEDs stop working.

Q1. Any chance of this bug being fixed?
Q2. I think it would be better to comment out dtoverlay=reTerminal-bridge as the default, but what do you think?

@maubuz
Copy link

maubuz commented Jan 25, 2023

I support @matsujirushi's proposal. IMHO, having dtoverlay=reTerminal-bridge as the default is confusing because:

  • The OS image provided by Seeed is shipped with basic functionality broken (leds, buzzer, etc).
  • Not everyone who has a reTerminal has a E10-1 Bridge, so why prioritize the E10-1 integration?

@matsujirushi
Copy link
Contributor

Did you change the default?
8a067d6

@asmagill
Copy link

I do use the reTerminal Bridge / E10-1 -- what's the status of the fix?

I've currently marked the raspberry pi kernel and support libraries as hold, so I can update the rest of the packages, but I'd really prefer to be running a more recent kernel at some point...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants