Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20706 Discussions

how to protect factory image data in epcs flash from rewriting or erasing?

Altera_Forum
Honored Contributor II
1,553 Views

Hello. 

 

I'm using NIOS II with remote system update(rsu_cyclone4 from alterawiki) and EPCS flash controller cores on Cyclone IV E(DE2-115). 

 

And there are 2 images in flash(EPCS64): 

Factory image(hardware + software) on address 0x0 

Application image(hardware + software) on address 0x00200000. 

 

All works great. System is booting with factory image and I can configure it with application image. 

But i need to write one more image to EPCS or rewrite first application image.  

 

I'm doing it with NIOS II and EPCS flash controller (using alt_epcs_flash_write_block). 

 

So, the question is how to protect factory image data in epcs flash from rewriting or erasing?
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
231 Views

There is no protection function in the EPCS itself so you can't define a protected area. You need to do this in your software, i.e. before it erases or rewrites a block, it should check that it is in the application region and not the factory one.

0 Kudos
Altera_Forum
Honored Contributor II
231 Views

The EPCS memory chips are standard SPI memory and do have the ability to protect part of the image. However the protected part will be at the top so is useless for protecting the factory image read by AS. 

If you use PS you could arrange to read from a high address and then protect that area.
0 Kudos
Altera_Forum
Honored Contributor II
231 Views

Thank you for your help. 

 

I found information about APFC_BOOT_ADDR instruction in Cyclone IV E. 

 

Seems that the best way is to do this in NIOS software.
0 Kudos
Reply