Forum Discussion

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

access epcs as mtd to program FPGA

Hello all,

until now i use *.flash to program fpga

--- Quote Start ---

nios2-flash-programmer --epcs --base=0x03001800 fpga_sof.flash

--- Quote End ---

now i want to use epcs as mtd... according to altera wiki tuto, i have to generate *.img

--- Quote Start ---

# your_fpga.img is msb<->lsb byte reversed from rbf

--- Quote End ---

how to reverse MSB LSB from rbf? :/

Thanks for help

2 Replies

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

    Depends how you want to do it. If you are using a CPU and you're only dealing with 8 bits then you can just make a LUT in memory using an array where 0x01 would become 0x80 and so forth.

    In my project I read a buffer size from the .rbf file on a USB drive. I then reverse the bytes in the buffer and then write the buffer to the EPCS device. I then call the remote update function, which loads the new FPGA image into the FPGA.

    If this is not what you want to do, then you need to be a bit more specific in what exactly you are trying to accomplish.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    more specific !! i just want to change program method

    updating the sof using epcs as mtd

    --- Quote Start ---

    cp your_fpga.img /dev/mtd0 # assume epcs is mtd0# your_fpga.img is msb<->lsb byte reversed from rbf and send from ftp

    --- Quote End ---