This is a bug in the bootloader code. Thanks for raising the issue.
Background: the bootloader code sets the EPCS device chipselect to active state in order to transfer data more quickly. The bug is that upon completion of the transfer, it leaves the chipselect active. The result is that the next EPCS command will not be interpreted correctly. The first EPCS command issued by the EPCS device driver is the Read Electronic Signature command; when that command delivers a bad result, the driver decides that no EPCS device is attached.
Here's a quick hack to get you running again. I'll submit this bug, with my suggested real fix, to the Nios2 group and let them decide how to handle it.
Quick hack: issue a "dummy" command to the EPCS, which will have the side effect of reseting the device chipselect to inactive state. Implementation: in the file Nios II Device Drivers/altera_avalon_epcs_flash_controller/HAL/src/altera_avalon_epcs_flash_controller.c, find the lines:
/* Send the RES command sequence */
flash->silicon_id =
epcs_read_electronic_signature(flash->register_base);
Modify that to this:
/* Send any dummy command to reset device chipselect */
flash->silicon_id =
epcs_read_electronic_signature(flash->register_base);
/* Send the RES command sequence */
flash->silicon_id =
epcs_read_electronic_signature(flash->register_base);
Rebuild your system library and your application with this change, and you should be able to open your EPCS flash dev from a bootloaded application.