DSPRelated.com
Forums

Host cannot read data from RTDX write

Started by Andreas Weishaupt March 22, 2010
Hi all,
I've tried to implement a simple host-target communication using RTDX
based on some examples/tutorials: From the host, I send an integer
value to the target. The target reads it and sends it back to the
host. The host should then display the value that has been sent back.
I've checked my trace LOG and apparently, the target receives the
messages that are sent to it and therefore it also sends them back.
But I cannot receive and siplay them on the host. Can anybody help me
solve my problem?
Here's the target code which handles the RTDX communication
(rtdxCommunication is a task that is enabled in DSP/BIOS conf):

Void rtdxCommunication (Void) {
Int32 retcode;

LOG_printf(&trace, "init communication");

RTDX_enableOutput(&ochan);
RTDX_enableInput(&ichan);

/* handshake, init code: 654321 */
LOG_printf(&trace, "handshaking...");

do {
RTDX_read(&ichan, &control, sizeof(control));
} while (control != 654321);

LOG_printf(&trace, "start communication");

/* continuously receive and write data */
while (TRUE) {
// receive from host
do {
retcode = RTDX_read(&ichan, &control, sizeof(control));
} while (retcode <= 0);
LOG_printf(&trace, "received data from host = %d", control);

// make negative and write back to host
control = (-control);
RTDX_write(&ochan, &control, sizeof(control));
}
}

Thank you very much for your help

_____________________________________