Debug XMOS in real time (e.g. USB Audio)

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
tilde
Member++
Posts: 22
Joined: Fri Nov 07, 2014 9:03 am

Debug XMOS in real time (e.g. USB Audio)

Postby tilde » Thu Apr 18, 2019 1:44 pm

Hello,
I fight many times with XMOS debugging in real time. Now I found the solution for Real Time debugging over xCONNECT. Which is very good, but it needs extra chanend.
In our design we dont have place for extra chanend, so I cant debug the whole system together.

Are there any other way for debugging in real time? (below I write about 3 methods, which I know about)

For me can be the best method, with breakpoints(method 2), but it not works when optimalization is switched on. And when I switch off optimalizaton, than USB audio class project is uncompilable. For example, the error msg is: ../src/usb_buffer/usb_buffer.xc: Error: Undefined reference to 'XUD_SetReady_In' (possible inline definition without external definition)

1. Debug with printf (or printstr, printint from <print.h>)in real time.
Problem: xCONNECT link must be available.
What we need for it: extra memory for text logs, extra chanend and an xCONNECT link
Link: https://www.xmos.com/developer/download ... 93A%29.pdf

2. Using xTimeComposer debugger over JTAG, use breakpoints. (partially usable)
It is excellent for handling memory access exceptions, and core communication mismatches.
Problem: When optimalization is enabled, than stepping in code is unusable, variable reading is unusable, too.
Naturally breakpoints usage stops the usb communication, too. The result is Usb communication error.

3. Using memory for debug message logging (partially usable)
Complicated method, but no extra chanends needed.
Problem: I can only use as much as logs as I have place in buffer.
What we need for it: many many memory for text logs, and for buffering logs.
Link: https://www.xmos.com/developer/download ... rc1%29.pdf
With kind regards
Tilde
MaximLiadov
Member++
Posts: 27
Joined: Mon Apr 16, 2018 9:14 am

Postby MaximLiadov » Fri Apr 19, 2019 12:43 am

You are right. Debugging is just a mess! I also cannot see variables when tracing my code. Let me know how it could be fixed. If I turn off optimisation completely, project cannot be compiled. Too many erorrs. Printing variables to console doesn't work well for the same reason. I think XMOS guys should do something with that.
tilde
Member++
Posts: 22
Joined: Fri Nov 07, 2014 9:03 am

Postby tilde » Thu May 16, 2019 8:48 am

In debug mode (method 2.), with optimisation enabled I cant see variables, too. :(
Printing variables by methods 1. and 3. works without any problem.
With kind regards
Tilde

Who is online

Users browsing this forum: No registered users and 0 guests