I am using a Micron MT25QL256 flash (replacing EPC256) and can't write protect sectors. I issue the command with the appropriate bits set but nothing is updated in the status register. I have externally mastered the SPI bus and issue the write enable (06h) and write status (01h) commands that then protect the flash. The generic quad SPI interface will then show the protected status. I suspect there is a missing write enable command in the IP.
Seems like there is some problem with the IP or the connection between FPGA and the flash memory. Can i check with you whether you have set MSEL pins for ASx4 configuration scheme?
For more information about the IP, you may refer to link below:
It seems like it is due to Quartus design problem, just would like to check if you have connected the IP with the component as shown at link below?
Have you tried other command and see if it can be executed properly?
I have got the same issue. I can not write any data on MT25QL256. I am using the functions defined in the header file "altera_generic_quad_spi_controller2.h".
int alt_qspi_controller2_read(alt_flash_dev *flash_info, int offset, void *dest_addr, int length);
int alt_qspi_controller2_get_info(alt_flash_fd *fd, flash_region **info, int *number_of_regions);
int alt_qspi_controller2_erase_block(alt_flash_dev *flash_info, int block_offset);
int alt_qspi_controller2_write_block(alt_flash_dev *flash_info, int block_offset, int data_offset, const void *data, int length);
int alt_qspi_controller2_write(alt_flash_dev *flash_info, int offset, const void *src_addr, int length);
int alt_qspi_controller2_lock(alt_flash_dev *flash_info, alt_u32 sectors_to_lock);
P.S. The Flash gets programmed using the Quartus Programmer and I can read the data from Flash in NIOS which gets written using Programmer.