Forum Discussion

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

Can I open a file for reading thru the JTAG link?

Hi all,

For a test I want to download the content of a file onto RAM.

Is it possible?

If yes, what file path should I use?

Regards,

Kwok

10 Replies

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

    I'm not entirely sure, but I think you can just use nios2-download... there's a user guide on Altera's website about the various commandline tools.

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

    --- Quote Start ---

    originally posted by ken@Dec 17 2004, 10:40 AM

    i'm not entirely sure, but i think you can just use nios2-download... there's a user guide on altera's website about the various commandline tools.

    --- Quote End ---

    Thanks for your reply.

    Actually I am looking for a way to read a file during execution of my application.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by kwokwong+dec 17 2004, 10:51 am--><div class='quotetop'>quote (kwokwong @ dec 17 2004, 10:51 am)</div>

    --- quote start ---

    <!--quotebegin-ken@Dec 17 2004, 10:40 AM

    i&#39;m not entirely sure, but i think you can just use nios2-download... there&#39;s a user guide on altera&#39;s website about the various commandline tools.

    --- Quote End ---

    Thanks for your reply.

    Actually I am looking for a way to read a file during execution of my application. [/b]

    --- Quote End ---

    Is it impossible?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    So while your embedded application is running you want to be able to download some data into a RAM?

    If that&#39;s the case I think you are limited to using the "In System Memory Configuration Tool". I have never used it personally but if you can format your data into something that can be downloaded like a .mif then that may work. But I&#39;m guessing you want to be able to control the JTAG UART and download using your own application (I think Jesse in another thread said that&#39;s not offered currently, and I think making something that could do the memory programming could be very difficult).
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I don&#39;t know enough about your exact requirement, but anyway an answer :

    Maybe easier to put the contents of the file in a static char array and link it with the executable. You can find a lot of tools to generate a source file with the binary content of a file, or writr yourself (it is not so difficult).

    This will be downloaded then toghether with the other source code of yout program through the JTAG link.

    If the address location of the data is importand, you can use an attribute to lock it down the address you want.

    Of course wth this, you can only write RAM that the processor can reach. If you need to write to free standing memory (for example on chip ram in some peripheral that is not connected to the processor), you can try to make it dual ported, and connect the second port to the processor bus.

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

    --- Quote Start ---

    originally posted by svhb@Dec 27 2004, 02:16 PM

    i don&#39;t know enough about your exact requirement, but anyway an answer :

    maybe easier to put the contents of the file in a static char array and link it with the executable. you can find a lot of tools to generate a source file with the binary content of a file, or writr yourself (it is not so difficult).

    this will be downloaded then toghether with the other source code of yout program through the jtag link.

    if the address location of the data is importand, you can use an attribute to lock it down the address you want.

    of course wth this, you can only write ram that the processor can reach. if you need to write to free standing memory (for example on chip ram in some peripheral that is not connected to the processor), you can try to make it dual ported, and connect the second port to the processor bus.

    stefaan

    --- Quote End ---

    For a test I&#39;ve to download a new FPGA-image and/or application onto the EPCS serial flash on my own (thus not using the Flash Prog. tool).

    As you mention, I world have the download include in the source files. Unfortunely the content of the EPCS flash is not large enough to hold the

    current application and the new download.

    I think that the only option is to input the download thru an external input port (jtag uart or whatever).

    But then I have to do more workt make it working...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Maybe simplest solution is using a standard uart. Ok it is slow, but maybe ok just for some tests.

    Are you using the compress option on the config file generation (cyclone?)?

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

    We are using cyclone device, but I don&#39;t know if we use the compress config generation (I&#39;m not a HW engineer).

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

    --- Quote Start ---

    originally posted by svhb@Dec 29 2004, 02:51 PM

    maybe simplest solution is using a standard uart. ok it is slow, but maybe ok just for some tests.

    are you using the compress option on the config file generation (cyclone?)?

    stefaan

    --- Quote End ---

    At the moment I would agree that this is the easiest method for doing this. If you put the bitrate up to something like 115200 then it&#39;s not so bad (might want to put error correction into the stream though).
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    We are using cyclone device, but I don&#39;t know if we use the compress config generation (I&#39;m not a HW engineer).[/b]

    --- Quote End ---

    It is an option during configuration file generation. You can select in the Quartus design environment. The file is approx 1/3 of the original (but I think it depends highly on the content of the logic).

    Normally this file comes as a IntelHex, but you can select raw binary also. I don&#39;t know if the IntelHex format has a checksum in the file format, this could also be handy.

    Stefaan