Dumping a Large Chunk of Memory

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
bpelt
Junior Member
Posts: 6
Joined: Tue Oct 18, 2016 2:33 pm

Dumping a Large Chunk of Memory

Post by bpelt »

Is there a way to do this in xTIMEcomposer through the debugger?

It would be extremely useful to me to dump 10,000+ integers to be able to graph some data. Alternately, a graphing function built into xTIME would be even better. Currently, the only way I have found is to copy them out of the expressions view 100 elements at a time (clunky to refresh and not very usable).

Thanks in Advance,
Bryant


peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

Have you tried using xSCOPE printing? If you use debug_printf() from lib_logging then you should be able to print a huge amount of data very quickly to the console. You'll need to create a config.xscope file in your project source folder containing:

Code: Select all

<xSCOPEconfig enabled="true" ioMode="basic">
</xSCOPEconfig>
This will enable printing over xSCOPE (rather than JTAG). Within your application you can add:

Code: Select all

#include "debug_print.h"
...

void print_data(int data[n], const size_t n)
{
	xscope_mode_lossless();  // Need to be using tools 14.3 for this
	for (size_t i = 0; i < n; i++) {
		debug_printf("%d\n", data[i]);
	}
}
...
Noting that you'll need tools 14.3 to ensure that no data is lost. Without that, xSCOPE is a lossy protocol that does a best-effort to send data whilst guaranteeing that the user application timing is not changed.

In your Makefile you'll need to ensure the lib_logging is in your USED_MODULES line too:

Code: Select all

USED_MODULES += lib_logging
Hope that helps. If you still want it to go faster then you use xscope_int() calls to send the data, or even xscope_bytes() to send blocks and write a host application to receive the data from the target. However, these are more complicated and shouldn't be necessary unless you are dealing with lots more data. This application note explains how to do that.
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm
Contact:

Post by Bianco »

Another option might be to use the file operations to open a file on the host using JTAG?
https://www.xmos.com/published/how-writ ... -execution

You can only use it if at the moment of transfer you don't have real-time requirements though.
Post Reply