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 ?
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 188415address.
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.
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.
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.