Forum Discussion

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

Loading data into memory

I'd like to load the SDRAM on my board (a DE2 board) with a specific file on my PC. As far as I can see there's no tool supplied that can accomplish this simply (I could probably mess around with linker scripts or some such thing but I'd prefer a simpler method). I tried using the JTAG uart however it's rather slow I wrote a small C program to run on the Nios II that just reads characters from it and then on my PC piped a file into the NiosII-Terminal program which works but it'll take several minutes to upload 1mb and I'd prefer something faster if possible.

So my question is, given a file on my PC can I add this into the build somehow so it gets loaded into SDRAM (or indeed another memory area) or perform such a task after the build? If not how I can I write to the JTAG UART faster (I get the feeling the NiosII-Terminal program is responsible for the slow transmission)?

5 Replies

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

    maybe ethernet with LwIP-Standalone (TFTP) or ethernet with uClinux is an option for you.

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

    The emphasis here is on simple, so I'd don't want to use ethernet or uClinux.

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

    Why not read the file into your C code as a char array? There's a Perl script (that can be easily modified) shipped with the standalone version of LWIP that can do this for you.

    Also, you could use the FS2 console (nios2-console, n2c) to upload data to memory.

    EDIT: one more thing... if you can tolerate always using Debug mode, then the host filing system is hands-down the easiest method. See the included software template/example for reference.

    Cheers,

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

    --- Quote Start ---

    originally posted by gregac@Feb 6 2007, 12:15 PM

    i'd like to load the sdram on my board (a de2 board) with a specific file on my pc. as far as i can see there's no tool supplied that can accomplish this simply (i could probably mess around with linker scripts or some such thing but i'd prefer a simpler method). i tried using the jtag uart however it's rather slow i wrote a small c program to run on the nios ii that just reads characters from it and then on my pc piped a file into the niosii-terminal program which works but it'll take several minutes to upload 1mb and i'd prefer something faster if possible.

    so my question is, given a file on my pc can i add this into the build somehow so it gets loaded into sdram (or indeed another memory area) or perform such a task after the build? if not how i can i write to the jtag uart faster (i get the feeling the niosii-terminal program is responsible for the slow transmission)?

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=21289)

    --- quote end ---

    --- Quote End ---

    Dear GregAC,

    I am very new to niosII & DE2... I really need ur project which downloads file from PC to SDRAM. Can you please send it to me addy3177@yahoo.com

    Thanks in advance

    regards,

    Aditya