baal86
Posts: 1
Joined: Mon Dec 18, 2017 4:08 pm

Re: STICKY: Optional interfaces (I2C, I2S, SPI) and Device Tree

Mon Dec 18, 2017 4:11 pm

Regarding the

Code: Select all

RTNETLINK answers: Numerical argument out of domain
error:

This is actually a hardware problem. Your oscillator on the CAN baor dis not fast enough. (Let me guess: You've got an 8MHz crystal?) If you replace it with a 16MHz crystal and update your config it works.

scorpion_08
Posts: 2
Joined: Thu Mar 08, 2018 6:43 am

Re: STICKY: Optional interfaces (I2C, I2S, SPI) and Device Tree

Fri Mar 09, 2018 9:30 am

i tried by replacing crystal with 12Mhz. i updated config.txt. but still i get same error..
RTNETLINK answers: Numerical argument out of domain

trieup
Posts: 8
Joined: Wed Mar 14, 2018 5:27 am

Re: STICKY: Optional interfaces (I2C, I2S, SPI) and Device Tree

Wed Mar 14, 2018 6:16 am

I am running CentOS.
I added the line :

dtparam=i2c_arm=on

to the end on the config.txt then reboot. After reboot I ran the test program and still get the error:
Unable to open I2C device: No file or directory.
You have mentioned manual load the I2C-dev. can you give more details. I am running CentOS.

RichardGemmell
Posts: 1
Joined: Thu Dec 20, 2018 6:02 pm

Re: STICKY: Optional interfaces (I2C, I2S, SPI) and Device Tree

Thu Dec 20, 2018 6:08 pm

I'm using a Raspberry Pi 3 B+ and I need to use 4 SPI devices so I followed PhilE's viewtopic.php?t=98318&start=25#p821666 suggestion to create a Device Tree overlay. This didn't work. It broke the existing chip select pins. I eventually got it working with a few tweaks. I thought I'd post it here for anyone who ends up in the same boat.

I happen to be using pins 24 and 25 but I don't believe that's significant.

Code: Select all

/dts-v1/;
/plugin/;

/ {
	compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709";

	fragment@0 {
		target = <&spi0>;
		frag0: __overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
			status = "okay";
			cs-gpios = <&gpio 8 1>, <&gpio 7 1>, <&gpio 24 1>, <&gpio 25 1>;

			spidev@2{
				compatible = "spidev";
				reg = <2>;	/* CE2 */
				#address-cells = <1>;
				#size-cells = <0>;
				spi-tx-bus-width = <2>;
				spi-rx-bus-width = <2>;
				spi-max-frequency = <125000000>;
			};

			spidev@3{
				compatible = "spidev";
				reg = <3>;	/* CE3 */
				#address-cells = <1>;
				#size-cells = <0>;
				spi-tx-bus-width = <2>;
				spi-rx-bus-width = <2>;
				spi-max-frequency = <125000000>;
			};
		};
	};

	fragment@1 {
		target = <&gpio>;
		__overlay__ {
			spi0_cs_pins: spi0_cs_pins {
				brcm,pins = <8 7 24 25>;
				brcm,function = <1>; /* out */
			};
		};
	};

	__overrides__ {
		cs2_pin = <&frag0>,"cs-gpios:12", <&spi0_cs_pins>,"brcm,pins:0";
		cs3_pin = <&frag0>,"cs-gpios:24", <&spi0_cs_pins>,"brcm,pins:4";
	};
};
cheers,
Richard

BobKruse
Posts: 14
Joined: Thu May 21, 2015 6:26 pm

Re: STICKY: Optional interfaces (I2C, I2S, SPI) and Device Tree

Mon Dec 23, 2019 8:38 pm

How do we enable the additional SPI ports 3-6 in the Raspberry PI 4?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3597
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: STICKY: Optional interfaces (I2C, I2S, SPI) and Device Tree

Mon Dec 23, 2019 9:42 pm

Using the overlays spi3-1cs, spi3-2cs, spi4-1cs, etc. Run "dtoverlay -h spi3-1cs" for usage information.


BobKruse
Posts: 14
Joined: Thu May 21, 2015 6:26 pm

Re: STICKY: Optional interfaces (I2C, I2S, SPI) and Device Tree

Thu Jan 09, 2020 10:24 pm

We never got SPI1 and SPI2 to support DMA in the CM3, only SPI0. We believe that SPI0 is built into the Broadcom logic, and that SPI1 & 2 came along with the ARM core. Maybe we're wrong about that.

In the PI 4, do SPI3-SPI6 support DMA?

Thanks,
Bob

RasperryPie
Posts: 6
Joined: Thu Mar 19, 2015 1:46 pm

Re: STICKY: Optional interfaces (I2C, I2S, SPI) and Device Tree

Sat Oct 31, 2020 11:33 am

How do i enable a PDM microphone which is connected to the headers?

User avatar
rpdom
Posts: 17980
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: STICKY: Optional interfaces (I2C, I2S, SPI) and Device Tree

Sat Oct 31, 2020 11:49 am

RasperryPie wrote:
Sat Oct 31, 2020 11:33 am
How do i enable a PDM microphone which is connected to the headers?
Well you start by not replying to every post about connecting microphones to the Pi.

Then, after doing web searches to see if your question has already been answered somewhere, you start one new post with your issue, giving details of which model of Raspberry Pi you have, which Operating System you have installed on it.

Then (hopefully) one of the clever people on here will reply within a few days (given as this is a weekend) with advice.
Unreadable squiggle

Return to “Interfacing (DSI, CSI, I2C, etc.)”