Technical Guide to C for xcore - new YouTube tutorial

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
CousinItt
Respected Member
Posts: 365
Joined: Wed May 31, 2017 6:55 pm

Technical Guide to C for xcore - new YouTube tutorial

Post by CousinItt »



User avatar
fabriceo
XCore Addict
Posts: 186
Joined: Mon Jan 08, 2018 4:14 pm

Post by fabriceo »

thx cousinItt !
from my perspective migrating some task/select functionality from XC to C is not easy and this tuto is welcome.
still we will be missing interfaces !
But another complexity is also to understand and adopt the whole new API and libraries of the official SDK ...
playing with usb audio was peanuts compare to this :)
MaximLiadov
XCore Addict
Posts: 130
Joined: Mon Apr 16, 2018 9:14 am

Post by MaximLiadov »

What are the practical benefits, if any, of switching to pure C? Compilation time? No internal compiler bugs? Better debugging environment? Do you have an out-of-the-box pure C IDE with a handy xConnect console? That would be greatly appreciated.

For now, the XC sources look clearer and easier to develop. In any case, to effectively use any programming language for XMOS, it is absolutely necessary to understand the XMOS MCU hardware architecture and to study all official open sources. That's the main obstacle and time waster, not synthacsys. IMHO.
User avatar
Ross
XCore Expert
Posts: 968
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

I think the issue with understanding is that the hardware was designed to run the language (see early presentation: http://people.cs.bris.ac.uk/~dave/xarch2010.pdf) and so its very integral to the whole xmos story. lib_xcore is somewhat trying to provide a C compatible API like XC. So if you already know XC, likely you'll still find XC easier to read and author. Starting from scratch? I'm not sure I can comment as a long term xmos user. I agree with Maxim's view on this (though I would disagree with the use of "time waster" of course ;) ) xcore is a fundamentally different architecture and that is what needs understanding at an engineering level, however, at a management level its easier to be sold a chip that "is programmed in C" rather than some proprietary language.

On Fabrecio's interface point, this is a topic of research. Im not sure interfaces will live on in their current form, however, the main functionally they facilitate is something that needs to be provided.
User avatar
Ross
XCore Expert
Posts: 968
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

BTW I'm not sure this is a new video, some old video seems to have made their way to the xmos YouTube channel of the last day or so, im not quite sure what's happened here (not my department ;))
User avatar
CousinItt
Respected Member
Posts: 365
Joined: Wed May 31, 2017 6:55 pm

Post by CousinItt »

True enough Ross - I hadn't realised but the YouTube channel has the same video from Sept 21. Apologies if I misled anyone.

I agree with fabriceo: interfaces are still a blind spot in the new C-style development path. Many of the existing libraries use interfaces and it's still not clear (to me anyway) how they are supposed to be used or whether they will be replaced.

I use interfaces with notifications heavily and not knowing how to replace them is a major hurdle for me.
User avatar
fabriceo
XCore Addict
Posts: 186
Joined: Mon Jan 08, 2018 4:14 pm

Post by fabriceo »

By the way when it comes to interface, on the old xcore repository there is a .h file with some helpers to use interface in C related to interfaces notification in C .
https://github.com/xcore/sc_xc_ffi/blob ... terfaces.h
probably experimental and not well documented but inspiring
User avatar
CousinItt
Respected Member
Posts: 365
Joined: Wed May 31, 2017 6:55 pm

Post by CousinItt »

Thanks fabriceo, I'll take a look