Forum Discussion

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

JTAG functions for writing and reading data from nios towards host pc

Hi

I'd like to communicate with a nios system using a JTAG uart module, but I don't know which functions I have to use in nios C-program...I read something about printf () for sending data to system console but for receiving data???

In addition, does anyone know how storing data on pc host once they are received???

Regards

10 Replies

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

    The JTAG uart uses the standard C functions from stdio.h to communicate, so any online resource about standard C I/O functions should help you see how this is done. Functions like printf(), scanf(), getc() are supported.

    For you other question, it depends on the type and amount of data. If you don't have a lot and if it is text, then you can just copy/paste the terminal contents to a file on your PC.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    My Idea would be to send a command from terminal to make my custom application work and so...my application would begin to send back to pc data packets continuously....

    do you have any idea??
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Kidneta,

    there are two answers to this:

    1) One is to use a direct link to jtagatlantic. Unfortunately AFAIK this very interesting module is NOT OFFICIALLY documented by Altera. You can however use this functionality in a restricted way. Please refer to the discussion on this subject (http://www.alteraforum.com/forum/showthread.php?t=2199&page=2). This allows to write our PC-host application e.g. in C code.

    2) The second is to use the new Altera QSYS tool instead of SOPC. This tool allows you for making a user application and GUI interface using tcl scripts.

    Please correct me if I am wrong/incomplete...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    What do you mean by data packets? The JTAG Uart is mostly a text interface. You could probably use it to transfer binary data, but it wasn't designed for this.

    If you have a network interface you can also use it to transfer data.

    Another way could be to run your software with a debugger and use the host filesystem software component, so that your Nios application can directly read/write files on the PC.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ah yes sorry, I forgot you talked about that! But System Console is also available with SOPC builder, you don't need QSys. (don't trust the Altera marketing documents that present System Console as a new feature provided by QSys ;) )