Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Can't transmit zero in the simple socket server example

Hi,

I need to write some data to the DDR2 SDRAM on the Cyclone III FPGA Development Kit from my computer. I figured the easiest way was to modify the simple socket server example, but I can't figure out how to transmit a 0. The simple socket server example transmits ASCII characters, but I need to send binary values and when I try to transmit a 0 somehting seems to go wrong in the recv() method. Since I'm a total Newbie when it comes to the Nios processor, and even more so when it comes to the MicroC/OS-II, I haven't been able to figure out what.

Thanks for any help.

Regards

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The socket API works with binary data, so transmitting a 0 is definitely possible. Your problem could be in the way you read the contents of the buffer after the recv call. It could also be in the sending part. Are you sure you are sending this 0?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I found that the problem was that I still used the strchr() function, which stopped searching for a newline when it found a zero at the first location in the buffer. Thanks for the reply.