Forum Discussion

EEren's avatar
EEren
Icon for Occasional Contributor rankOccasional Contributor
6 years ago

How to prepare a rpd file

I have a bootloader in CFM0 sector. I feed a rpd file through serial, after uploading the file to the FPGA flash it reports success. But when I switch to CFM1 it fails and goes back to CFM0.

I suspect my rpd file not good

I check Big endian - so I shouldn't swap bytes in the code.

But do I need to check this option - Use secondary image ISP data as default setting when available ?

9 Replies

  • JohnT_Altera's avatar
    JohnT_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi,

    May I know if you are using dual boot in your Quartus design? Do you program dual image the 1st time you program the flash before you update the CFM1?

  • EEren's avatar
    EEren
    Icon for Occasional Contributor rankOccasional Contributor

    I have two projects. Boot project and Main project. Both configured as dual boot. So in the Boot project I choose the first SOF Page of the Boot project and the second SOF page of the Main project.

    I burn generated POF and it works - I can switch between CFM0 (Boot) and CFM1 (Main) with BOOT_SEL pin.

    Now I prepare the rpd file - in the Main project I choose both SOF Pages of the Main project and get - ''output_file_main_cfm0_auto.rpd'' and ''output_file_main_cfm1_auto.rpd''.

    Now I feed the ''output_file_main_cfm0_auto.rpd'' to the Boot located in CFM0 - it burns but the Main project no good - it switches to CFM0 when I choose CFM1 with BOOT_SEL pin.

    As I see in the Flash Update module

    SECTOR3_START_ADDR => 16384,

    SECTOR3_END_ADDR => 114687,

    SECTOR4_START_ADDR => 114688,

    SECTOR4_END_ADDR => 188415,

    So I start at 16384 address and end at 188415 address.

    I burned an rpd file and did dump back - only first 100 addresses

    Looks like the same content. So I think my rpd file not good.

  • GLees's avatar
    GLees
    Icon for Contributor rankContributor

    I see two potential problems;

    1) Endian swapping. After configuring four bytes to write a 32 bit word into CFM1, you need to do a 32-bit "endian swap". Just checking the "Big Endian" box when you make the rpd doesn't cut it.

    2) You should be feeding "output_file_main_cfm1_auto.rpd" to the Boot loader located in CFM0. After all, you want it to end up in CFM1, right?

    I lost a lot of hair trying to make all of this work, but finally got there.

  • EEren's avatar
    EEren
    Icon for Occasional Contributor rankOccasional Contributor

    Thanks a lot! Indeed I should feed - output_file_boot_cfm1_auto.rpd - this is the actual main project image.

  • JohnT_Altera's avatar
    JohnT_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi,

    You will need to always check on the "On Chip Flash" IP to make sure that the sector you are programming is the correct CFM location.

  • EEren's avatar
    EEren
    Icon for Occasional Contributor rankOccasional Contributor

    Another question. A cfm1.rpd file has 672 kilo byte size. But the actual program much smaller. How can I know the actual program size? I don't want to stuff the CFM1 page with dummy FF's.

  • JohnT_Altera's avatar
    JohnT_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi,

    There is no way to determine the full compress file as it will depending on your Quartus design and how much it can be compress.

    • EEren's avatar
      EEren
      Icon for Occasional Contributor rankOccasional Contributor

      But why Quartus can not tell the actual size after the rpd file creation - it's all known parameters to the environment.