Hello everyone,
I have downloaded the example file "sw_usb_audio-develop" from GitHub, and I want to port it to my XK-EVK-XU316 board.
I am using the XTC tool with VS Code. Is there any documentation that can guide me on how to do this?
I have no idea so far.
I was followed the guide that control the LED flash, but it seems not work with the "sw_usb_audio-develop".
https://www.xmos.com/documentation/XM-0 ... he-example
How to port the "sw_usb_audio-develop" to XK-EVK-XU316
-
- Member
- Posts: 12
- Joined: Wed Jul 23, 2025 2:59 pm
-
Verified
- Member++
- Posts: 31
- Joined: Thu Jan 10, 2019 6:07 pm
You can download sw_usb_audio with full documentation, source and pre-compiled binaries for the XK-EVK-XU316 @
https://www.xmos.com/develop/usb-multichannel-audio/
https://www.xmos.com/develop/usb-multichannel-audio/
-
Verified
- XCore Legend
- Posts: 1262
- Joined: Thu Dec 10, 2009 9:20 pm
- Location: Bristol, UK
I second Marks reply.
By the naming scheme you've used it seems you've used "download zip" from github.com. This only gives you that repos code. You can follow this approach, and the build system will grab everything else for you, but it wouldn't be my recommended approach TBH (zip info doesn't come with any git info)
If you are going to continue down this path I would at least put the sw_usb_audio-develop folder in a sandbox folder - when you run cmake its going to download things to the same level as sw_usb_audio-develop, which you might not want..
To add to Mark's response full code zips can also be download for the artefacts of each release. E.g. https://github.com/xmos/sw_usb_audio/re ... tag/v9.1.0
By the naming scheme you've used it seems you've used "download zip" from github.com. This only gives you that repos code. You can follow this approach, and the build system will grab everything else for you, but it wouldn't be my recommended approach TBH (zip info doesn't come with any git info)
If you are going to continue down this path I would at least put the sw_usb_audio-develop folder in a sandbox folder - when you run cmake its going to download things to the same level as sw_usb_audio-develop, which you might not want..
To add to Mark's response full code zips can also be download for the artefacts of each release. E.g. https://github.com/xmos/sw_usb_audio/re ... tag/v9.1.0
Technical Director @ XMOS. Opinions expressed are my own
-
- Member
- Posts: 12
- Joined: Wed Jul 23, 2025 2:59 pm
Thank you. I have downloaded sw_usb_audio.zip and successfully built the project "app_usb_aud_xk_evk_xu316" for the EVK-XU316—it works.
Now, I want to add the HID function, as well as a custom bidirectional communication channel between the host (PC) and the EVK, based on "app_usb_aud_xk_evk_xu316".
I am still trying to understand the structure of this type of project.
I am looking for the main file, but it seems it is not located in the "app_usb_aud_xk_evk_xu316" folder.
Now, I want to add the HID function, as well as a custom bidirectional communication channel between the host (PC) and the EVK, based on "app_usb_aud_xk_evk_xu316".
I am still trying to understand the structure of this type of project.
I am looking for the main file, but it seems it is not located in the "app_usb_aud_xk_evk_xu316" folder.
-
Verified
- XCore Legend
- Posts: 1262
- Joined: Thu Dec 10, 2009 9:20 pm
- Location: Bristol, UK
See the section "codeless programming model" of the lib_xua documentation
Grab PDF or HTML docs from here: https://www.xmos.com/file/lib_xua/
The location of main() is lib_xua/src/core/main.xc
Grab PDF or HTML docs from here: https://www.xmos.com/file/lib_xua/
The location of main() is lib_xua/src/core/main.xc
Technical Director @ XMOS. Opinions expressed are my own
-
- Member
- Posts: 12
- Joined: Wed Jul 23, 2025 2:59 pm
Thanks for your support, Ross.
I have found the main file in lib_xua.
I am curious how the compiler knows where the main file is located.
More importantly, the printf function does not work in main.xc, which is inside lib_xua.
The printf function worked in the example project "ExampleXCommonCMake" but not with lib_xua, so maybe my knowledge is not sufficient. Could you please assist me?
I have found the main file in lib_xua.
I am curious how the compiler knows where the main file is located.
More importantly, the printf function does not work in main.xc, which is inside lib_xua.
The printf function worked in the example project "ExampleXCommonCMake" but not with lib_xua, so maybe my knowledge is not sufficient. Could you please assist me?
-
Verified
- XCore Legend
- Posts: 1262
- Joined: Thu Dec 10, 2009 9:20 pm
- Location: Bristol, UK
The build system throws all the source files at the compiler, it doesn't matter which one has main() so long as it finds that symbol somewhere.
You cannot put any real code in an xc main() with a par with on tile[]:
Its highly restrictive, think of it more of a mapping of where to run tasks. If you call printf() from any one of the tasks It should work.
e.g.
You cannot put any real code in an xc main() with a par with on tile[]:
Its highly restrictive, think of it more of a mapping of where to run tasks. If you call printf() from any one of the tasks It should work.
e.g.
Code: Select all
void foo()
{
printf("bar\n"):
}
void main()
{
par
{
on tile[0]: foo();
}
}
Technical Director @ XMOS. Opinions expressed are my own