# Use I2C on Voxl2 with Px4

Source: https://forum.modalai.com/topic/2649/use-i2c-on-voxl2-with-px4
Category: VOXL 2 and VOXL 2 Mini (https://forum.modalai.com/category/26/voxl-2-and-voxl-2-mini)
Tags: voxl-2
Posted: 2023-09-12 23:50:39 UTC by bcj
Replies: 4 · Views: 1031

## bcj · 2023-09-12 23:50:39 UTC

I'm trying to use one of the I2C connections on J19 of the VOXL2 to control an external device. I cannot seem to get the Px4 code to build for I2C devices. I can build and deploy code to my voxl2 on the bench. I'm using https://gitlab.com/voxl-public/voxl-sdk/services/voxl-px4. I tried using `make modalai-voxl2 boardconfig` to enable drivers of example applications and that didn't have any effect. I was trying to just get some I2C driver to start to make sure I could configure thins, so I set `example src/drivers/barometer/invensense/icp101xx/Kconfig` to have a default of 'y'. Then I get a build error, it can't find the I2C class. I suspect I'm missing something simple somewhere to configure it for I2C, but I"m not sure what.

Any suggestions appreciated!

## Reply by tiralonghipol · 2023-12-17 07:43:41 UTC

@bcj did eventually figured out?? I stumbled upon the same problem!

## Reply by Eric Katzfey (ModalAI staff) · 2023-12-17 16:01:39 UTC

@bcj The I2C connections on J19 are routed to the DSP, not the applications processor. So you need to look at the PX4 DSP build files, not the applications processor build files. For example, here is where the icp101xx driver is brought in: https://github.com/modalai/px4-firmware/blob/8334ca832958db1a4f50f702b0975fb584cf4653/boards/modalai/voxl2-slpi/default.px4board#L11

## Reply by tiralonghipol · 2023-12-18 14:40:53 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 

can you please confirm that in order to communicate with a sensor on the DSP, even if the driver already exists in px4, one need to patch the driver as you guys did for voxl2-slpi/src/drivers ?

for example, read an MPU6050 over i2c on J19

## Reply by Eric Katzfey (ModalAI staff) · 2023-12-18 16:20:07 UTC (in reply to tiralonghipol)

@tiralonghipol UART drivers need patching. If it is an i2c or spi driver then usually not.
