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

Using memory other than EPCS/EPCQ

ASeif
Beginner
667 Views

Hi,

I was wondering if anyone know that W25Q127JV memory is compatible with EPCQ128?

I use NIOS II and Serial Flash Controller II. This controller can read memory but it fails to perform a write protection or erase that memory.

 

When I try to do a protection it returns fail code [-46].

When I try to erase a block NOIS II hangs there and it seems that it change memory content, so it causes factory image to be lost.

 

Would you please let me know where is the problem?

 

 

 

 

More info:

Quartus V18.0

NIOS II

Serial Flash Programmer II

--[Memory is chosen as EPCQ128]

--[Actual Memory is W25Q128JV]

/**********************************************************************************************************/ //Code part for locking first 1Mb of Memory ret_code = alt_lock_flash(fd, 0b01011); // 0b0001-0011 : Locking 0 to 0xFFFFF (1Mb) //-------------------------------------------------------------------------------------------------- //Result: ret_code => -46 /**********************************************************************************************************/     /**********************************************************************************************************/ //Code part for erasing sector 16 of Memory ret_code = alt_erase_flash_block(fd, 0x100000, 0x10000); //-------------------------------------------------------------------------------------------------- /*Result: System stops {memory content has been changed therefore it is expected to stops working because it is running in-place */ /**********************************************************************************************************/     /**********************************************************************************************************/ //Code part that works fine ret_code = alt_get_flash_info(fd, &regions, &number_of_regions); printf("Offset:%d\r\nRegion Size:%d\r\nBlocks Count:%d\r\nBlock Size:%d\r\n", regions->offset, regions->region_size, regions->number_of_blocks, regions->block_size); //-------------------------------------------------------------------------------------------------- /*Result: Offset:0 Region Size:16777216 Blocks Count:256 Block Size:65536 */ /**********************************************************************************************************/

 

0 Kudos
4 Replies
HBhat2
New Contributor II
436 Views

Hi,

 

Some years ago I was trying some similar operation using some equivalent serial flash than EPCQ. At that point, I observed similar issue of NIOS getting hanged or operation failure. I remember that, when NIOS performs the operation (write/read/erase), it initially checks for the Silicon ID in the Serial flash. This silicon ID differs between EPCQ/EPCS to that of other serial flashes. As the Silicon ID differs for other serial flash device, the NIOS halts/hangs with that operation.

 

With Regards,

HPB

0 Kudos
Ahmed_H_Intel1
Employee
436 Views

Hi,

Did you try to create a memory test project. This project helps to make sure that the memory is responding fine with NIOS II.

Here are some useful design examples:

https://fpgacloud.intel.com/devstore/platform/16.1.0/Standard/board-update-portal-utilizing-epcq-flash-memory-reference-design/

https://fpgacloud.intel.com/devstore/platform/17.1.0/Standard/boot-from-epcq-serial-flash-example/

Regards.

0 Kudos
ASeif
Beginner
436 Views

HI,

I do double check everything but it doesn't work. I add FIFO memory to the reception part and now it is much much better.

 

Another question is that "Do you know how can I cancel scanf(..) function?"

To explain this question I can say:

Intrinsically SCANF() function waits for ever till it receive a character. I need to wait for user input until certain amount of time; Hence, I run a timer and after timeout I want to cancel the scanf.

after timeout other thing working good but UART locks and does not work (I think it is due to ongoing scanf).

Any suggestion is welcome...

0 Kudos
Ahmed_H_Intel1
Employee
436 Views

Hi,

You can create a loop to receive a character by character and then exit the loop once to get the required length. Am I get your question?

 

0 Kudos
Reply