Bare metal I2C communication with XVF3800 Topic is solved

New to XMOS and XCore? Get started here.
valkm
New User
Posts: 2
Joined: Mon May 12, 2025 5:00 pm

Bare metal I2C communication with XVF3800

Post by valkm »

Hello everybody,

I am trying to communicate via I2C from an MCU (master) to the XMOS XVF3800 (slave) on the dev board XK-VOICE-SQ66; to obtain information such as the firmware version, direction of arrival, etc. The XMOS XVF3800 is programmed with the firmware application_xvf3800_intdev-lr16-lin-i2c.xe provided by XMOS.

I succeed in detecting the XVF3800 with its I2C address (0x2C), but get garbage values when trying to read the version (I should get "321"). I've tried sending a write/read I2C frame with the address, followed by the "application servicer id" (0x30), and the command identifier (which I tried to guess), to no avail...

Would anyone know the answers to the following questions?

1. Is it possible to communicate with XVF3800 via I2C from a bare metal I2C master?
2. Is the protocol explained somewhere?
3. The command ids seem to be automatically generated at compile-time. How can I know the values used in the binaries distributed by XMOS, such as the VERSION command?

Best Regards,
Valentin
View Solution
User avatar
infiniteimprobability
Verified
XCore Legend
Posts: 1163
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

1. Is it possible to communicate with XVF3800 via I2C from a bare metal I2C master?
Yes for sure - it's just an I2C protocol underneath so it can be supported by any I2C master
2. Is the protocol explained somewhere?
Not as such in public documents, but it's in the code. If you take a look in control_host_support.h in the host app source code (available as a download) you can see the function control_build_i2c_data(). This builds a byte buffer from the control transaction. You can see i'ts resid, cmd, len followed by the payload if it's a write.
If you look in command.cpp (command_get or command_set) then you can see it sends that then it gets a return value (defined in device_control_shared.h), and depending on that the response, it retries until a timeout.
3. The command ids seem to be automatically generated at compile-time. How can I know the values used in the binaries distributed by XMOS, such as the VERSION command?
One sure way will be build the host app or firmware and this will autogen the headers. Details how to do this can be found here here

Details of how the i2c commands get put together on a raspberry pi can be see here

Hope that helps!
Engineer at XMOS
valkm
New User
Posts: 2
Joined: Mon May 12, 2025 5:00 pm

Post by valkm »

Thank you for the guidance. My problem is solved :)

edit: For those needing an overview of the control protocol, here is the xmos doc : https://www.xmos.com/documentation/XM-0 ... tocol.html