enabling cdc-acm uart and I2C at the same time on zephyr OS

58 views Asked by At

I am trying to enable cdc-acm uart / usb virtual COM port and i2c on raspberry pico on zephyr OS using overlay code below :

/ {
   chosen {
   zephyr,console = &usb_cdc;
   };
};
&zephyr_udc0 {
   usb_cdc: usb_cdc_0 {
   compatible = "zephyr,cdc-acm-uart";
   };
};
&i2c0 {
   status = "okay";
   bme680: bme680@77 {
      compatible = "bosch,bme680";
      label = "BME680";
      reg = <0x77>;
   };
};

below is the .conf file :

# Enable USB stack
CONFIG_USB_DEVICE_STACK=y

# Enable USB Initialize at boot
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y

# USB device descriptors
CONFIG_USB_DEVICE_VID=0x2e8a
CONFIG_USB_DEVICE_PID=0x000a
CONFIG_USB_DEVICE_PRODUCT="Pico"
CONFIG_USB_DEVICE_MANUFACTURER="Raspberry Pi"

# Set to "n" for bus-powered devices (powered from the USB host) like the Raspberry Pi Pico.
# Set to "y" for self-powered devices (powered from an external power supply) like PicoDRO hardware.
CONFIG_USB_SELF_POWERED=n

CONFIG_I2C=y
CONFIG_SENSOR=y

I tried to use both uart (usb cdc-acm mode) and I2C at the same time with zephyr OS. However, I could only make the uart work but not when I initialize I2C...

the uart did not work when i tried to include &i2c0 part...,but without it, the uart worked fine...I was expecting to print the output of the sensor (bme680) connected to the raspberry Pi pico using I2C to the terminal through UART...Do you know what the problem is with this code? Or is there perhaps something that I don't know about, for example if I2C actually has the same line as virtual COM port of raspberry pi pico ? I am still new to zephyr OS and I have been working on this problem for weeks without success... any response is really appreciated, thx.

0

There are 0 answers