Problem in Enabling I2C and I2S

Hi everyone!

I have a Radxa Zero 3E, and I want to connect several chips to it, including a Bosch BME688 development kit and an INMP441 Microphone. I am quite sure about the connection of the pins, but still when I run the command " arecord -l ", I cannot see any outputs related to the microphone. Also, when I run “sudo i2cdetect -y X” , where X is either 0,2,3,6(I run the command ls /dev/i2c-* to find these numbers), I don’t see any meaningful results. Do I have to do something to enable I2S or I2C?

I would be grateful for your guides!

Can you tell me what pins you are using with the Bosch BME688 and INMP441 Microphone on the zero-3e?

1 Like

Thanks for the reply!
For Bosch BME688, I connected it to an Adafruit HUZZAH32 Feather board, and then I made this connections between Adafruit board and Radxa Zero 3E:

3V —> Pin 1
GND —> Pin 6
SCL —> Pin 5
SDA —> Pin 3

For INMP441, the connections are like this:

VDD —> Pin 1
GND —> Pin 6
SCK —> PIN 12
WS —> PIN 35
SD —> PIN 38
L/R —> Pin 39

@Mitchell any update?

Hi @Mahyarshall,
For arm linux it’s usually necessary to add a device tree overlay to describe the added devices, so that’s why you can’t use sudo i2cdetect -y X to see useful results.But you can still program using the i2c generic api provided by linux.

Hi @Mahyarshall,

  1. For Bosch BME688, PIN3 and PIN5 are I2C3_SDA_M0 / I2C3_SCL_M0 respectively, if you want to use it to connect to Bosch BME688 device, you need to enable overlay, please refer to the steps in the following document:
    https://docs.radxa.com/zero/zero3/os-config/rsetup#overlays

  2. For INMP441: zero-3e does not enable I2S3, if you are sure you want to use I2S3, I will provide you with a patch. Also I think your PIN pin is not selected correctly, PIN39 is grounded.

Hi @Mitchell and @ChenJaly,

The problem that I have for Bosch BME688, is that when I enable overlays from “Manage overlays”, and then I reboot, still nothing is changed in “Manage overlays”, and still I can see “Enable I2C4-M0”. Also when I wanted to connect a Raspberry Pi Camera, I couldn’t change the overlays here, so I did “sudo mv /boot/dtbo/radxa-zero3-rpi-camera-v2.dtbo.disabled /boot/dtbo/radxa-zero3-rpi-camera-v2.dtbo” and then changed the “extlinux.conf” and then the camera was enabled and I could see its output. I don’t know if I’m doing something wrong, or something is wrong with my board or the OS. My current OS is “debian_bullseye_xfce_b3” and my board is 1GB, but I also have 2GB and 4GB boards, if needed.

Also about INMP441, I would be grateful if you send me the patch and guide me about it, because I want to connect a microphone to my board. About the pin, I connected the L/R to PIN39 because I wanted to test recording only a “mono” just for test the functionality.

I would be grateful for your help and advices. I have some Zero3E boards and I want to connect different peripherals to them, so if you can guide, it would be invaluable for me.

Thanks!

@Mahyarshall

You can try to use the b6 version of the image, just enable the overlay related to i2c3 and v2 cameras in rsetup.
https://github.com/radxa-build/radxa-zero3/releases/download/b6/radxa-zero3_debian_bullseye_xfce_b6.img.xz

Regarding INMP441, I will send you the patch later.

Hi @Mahyarshall,

I’ve compiled an overlay that supports INMP441 devices (radxa-zero3-enable-i2s3-m0.zip (656 Bytes) ), and you’ll need to add it to your system by following the steps below.

  1. Use an image of the official Debian b6 version.

  2. Copy the radxa-zero3-enable-i2s3-m0.dtbo file to the board.

  3. Then use the following command to copy radxa-zero3-enable-i2s3-m0.dtbo to the /boot/dtbo directory

    sudo cp radxa-zero3-enable-i2s3-m0.dtbo /boot/dtbo
    
  4. Open the overlay option via rsetup

    • When you open rsetup to enter the overlays option, you will find that Enable Zero 3E I2S3-M0 has been selected, then you need to uncheck it, then press the enter key, and then enter the overlays option to re-select it, so that it will take effect.
  5. If the enabled function is successful, the relevant sound card information will appear when using the aplay and arecord commands.

Thanks @Mitchell,

with the provided overlay I could see the device in the “arecord -l”, but my recording was blank which is probably due to a problem with the microphone.
The main problem that I have, is that the b6 image that you sent earlier, always crashes. Since Friday, I have changed the OS more than 5 times. It loads the login page and then freezes. I have tested with 1 GB and 4 GB boards and they both have this problem. Is there a way to fix this? When I use b3 image, it is perfectly fine and working, but I couldn’t use your overlay, with b6 I could use it but after one or two reboot, or shutting down, it will crash. Can you help me with this? If there is a way to have the patch for b3 image, it is still perfect!

Thanks for your time!

I can’t reproduce your problem. The b6 version image runs fine locally. Can you provide more details about the crash?

Yes for sure.

I installed the OS using the Balena Etcher, on a 64 GB SD card. When I use a b3 image, everything is fine and I have used a b3 image for more than one month without any problem. But when I want to use a b6 image, like the one that you provided, it crashes after some hours or days. The crashing is done in two ways. The first way is that the green led remain constantly on, and nothing is loaded on the screen, and the second way(I have attached the image) which is more common and frequently happening is that the login page is loaded, but after some seconds, it freezes and I can’t move the mouse cursor or write anything with keyboard.

I have reinstalled the image many times, and there is no common rule to predict when this happens. I have tested with different scenarios, with 64 GB SD card or 32 GB SD card, with 1 GB board or 4 GB board, with updating the packages with sudo apt upgrade or without it, with connecting it to Internet or without it, in all the scenarios, it will start crashing at some point.

In this last case, it was working perfectly fine on Friday, I could enable I2S with your overlay, then I enabled the camera, it was working, and then I left the office to continue on Monday. Now it is crashing.

OK, I will continue to try to reproduce the problem you provided.
It seems to me that you can try to add the radxa-zero3-enable-i2s3-m0.dtbo file in the same way on the b3 image.

Hi again @Mitchell,

I think I have found the problem. I think the problem of crashing the OS is due to the overlay that you sent for me. Because both on Friday with b6, and today with b3, after enabling and doing the procedure that you told me, it crashed. So I think the problem is related to the overlays, since I had a non-crashing b3 for over a month, and now it is crashed.

Have you turned on the I2C3-M0 overlay at the same time?

Yes, with active I2C3-M0 overlay the OS is crashing. Yesterday, I reinstalled OS on a Zero3E board and I didn’t activate I2C3-M0 overlay and still it is working properly.

Sorry, I forgot to tell you this, the patches for I2C3 and inmp441 audio cannot be enabled at the same time. You can try to connect Bosch BME688 through i2c4-M0. The corresponding pin of i2c4-m0 is as shown below:

Thanks! I will note this when I want to connect the both peripherals at the same time. I have also some other questions and doubts that I have faced in recent days.

  1. Does Zero 3E board support high quality cameras such as RPI High Quality camera?

  2. Is it possible to do multiplexing on Zero 3E(or any other Radxa board)?

  3. When I tried to install OS on EMMC, I followed the instructions but I got a “Prepare IDB Fail” error. Does Zero 3E have on-board EMMC? If yes, where can I find suitable loader and Image for EMMC OS installation? I tried some files but I will always get stopped at the above-mentioned error.

Thanks!

Hi Mahyarshall

  1. You can check out the cameras supported by the ZERO-3E in this document
    https://docs.radxa.com/en/zero/zero3/accessories/camera

  2. Can be multiplexed on Zero 3E

  3. ZERO-3E is without eMMC

@Mitchell, Thanks for the answer. Since multiplexing needs a physical interface, can we use Arducam multiplexer, or do you suggest another csi multiplexer (I don’t know if there is an official one from Radxa or not).