Unable to use UART, i2c and SPI together.

Unable to use uart ,I2c,SPI together as shown in the error message. I am attaching the dts overlay  file

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// To get started, press Ctrl+Space to bring up the completion menu and view the available nodes.
// You can also use the buttons in the sidebar to perform actions on nodes.
// Actions currently available include:
// * Enabling / disabling the node
// * Adding the bus to a bus
// * Removing the node
// * Connecting ADC channels
// For more help, browse the DeviceTree documentation at https://docs.zephyrproject.org/latest/guides/dts/index.html
// You can also visit the nRF DeviceTree extension documentation at https://nrfconnect.github.io/vscode-nrf-connect/devicetree/nrfdevicetree.html
&uart1 {
status = "okay";
};
&pinctrl {
uart2_default: uart2_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 24)>,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Is there any way to use all UART,SPI,I2C together. Please let me know if you need any further details or explanations regarding this issue.

  • Which SoC are you referring to ? On nRF52 series the I2C & SPI are shared.  On nRF53 all 3 are probably shared. Which means if you use dev 0 of i2c, you cannot use device 0 of SPI.  

  • It's definitely possible to use UART, I2C and SPI, but you have to consider that they might share memory locations.
    So you can't use them at the same time if they share a memory location. Refer to the datasheet of the chip you're using to verify.

  • You can't use all 3 but not on the same device instance.  for example I2C instance 0, SPI instance 1 are possible but not I2C instance & SPI instance 0 at the same time.

    See datasheet

  • You are correct. This is also what I was trying to communicate

    My first reply might seem odd because it was written right after your reply, wasn't aware at the time of writing of your answer.

    •  I am using the NRF9160 and utilizing three UARTs. However, when attempting to enable I2C2, a conflict arises between UART2 and I2C2, as shown in the image. Could you please rectify why this is happening ?
1 2