Forum Discussion

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

remote upgrade EPCS config data

I am trying to download configuration data using rs232 and program it to EPCS. The data is downloaded and checksummed correctly, programmed to EPCS (starting at address 0) and read back correctly. But the system will not configure.

Have tried with "raw programming data file" (.rpd)

and also "raw binary file" (.rbf)

Also tried reversing bit-order of .rbf as decribed here:

http://forum.niosforum.com/forum/index.php?showtopic=7953

I can program EPCS using .jic file and the system configures correctly after power loss.

Anyone ideas what I' am doing wrong? :confused:

Update:

Reading back the flash contents after programming with .jic, I saw that the content matched the .rpd file except that all bytes had reversed bit-order. Reversing bit order for each byte in the .rpd and then programming into flash results in a working system.

4 Replies

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

    I have tried something similar before. I also tried rpd and rbf files with no success. In the end, the only way I have ever got it to work was using the command line utililty sof2flash. It is included with NIOS II EDS. This utility converts a sof file to an S-record file.

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

    How did you write rbf file into EPCS? I have EPCS16 on my board and I can read and write into the EPCS16 using SPI. Now using this SPI, I want to write rbf file into EPCS. But there are plenty of bytes in rbf file. So it seems very difficult to apply bit-reversal to each byte manually. Is there any easy way to write these bytes into EPCS? Is there a way to read the contents of rbf file using SPI or UART?

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

    I always read back the EPCS that I programmed with the .jic and the I also read it back when I have programmed it through .rbf/.rpd and compare that way you can tell what the problem is. At least you will find out if you have an endian problem or similar.

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

    I got it. An embedded guy provided me an application which can convert the rbf contents into a hex file(Which contains nothing but an array. The elements of this array are the bytes in the rbf). I can include this hex file in Nios and now I can easily read it, apply byte reversal and write into the EPCS. The whole massive EPCS was written into just 10 seconds.