cancel
Showing results for 
Search instead for 
Did you mean: 

QSPI - Read UNIQUE ID from W25Qxx NOR memory

uilter
Senior

Hi ST community!

I'm a liltle confused about how to read the UNIQUE ID from memory NOR W25Qxx. In my case a use the W25Q128 - https://www.winbond.com/hq/product/code-storage-flash-memory/serial-nor-flash/?__locale=en&partNo=W25Q128JV

We already use this memory in another custom boards.
We able to flash, create external loaders and use it with touchgfx.

This custom board has a STM32H753.

I want to understand the correct way to read this instruction UNIQUE ID (4Bh). To get this value, the datasheet says after the INSTRUCTION (4Bh) I need to add 4 bytes of DUMMY clock (32 clocks). After this, I will able to receive the 64 bits from the UNIQUE ID.

uilter_0-1688522617046.png

I'm a little confused about my tests and would like some help from the community to know if some of the two paths I show below are correct or none of them haha


1) My first try was using the code below, but I always get corrupt data.
- I put the max dummy cycles allowed (31). Check it on the HAL lib and reference manual.
- read 8 bytes (64 bits from the UNIQUE ID)

uilter_0-1688526470865.png

Looking the logic analyzer, I figure out the data is shifted to left. The last byte was not readed.

uilter_1-1688526540478.png

2) The second try was the code bellow:
- I sum the 8 bytes from UNIQUE ID with the Dummy bytes. 
- the first 4 bytes are zero and the UNIQUE ID start at index 4 in pData array.

uilter_2-1688526686011.png

Looking the logic analyzer, the data is fine.

uilter_3-1688526720463.png

Please, anyone can advise me the correct way to read this UNIQUE ID from W25Q128 NOR memory?

Many thanks!

14 REPLIES 14
uilter
Senior

Hi @Tesla DeLorean thanks to join us.

In your experience, the way I'm reading the UNIQUE ID register is correct? Read 12 bytes, discard the first 4 bytes and consider the rest of the array.

Thanks.

FBL
ST Employee

Well, your second try was correct. In the dummy-cycle phase, the microcontroller can allocate a maximum 31 cycles, however the memory needs 32 cycles to process the read ID.

FBelaid_0-1688720099199.png

Here is another option you can consider.

s_Command.DummyCycles = 31; //31 bits of dummy cycles

s_Command.NbData      = 8+1; // 8 bytes of data + 1byte as dummy

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Staging in a buffer, and copying out would be the way I'd go.

For other "unique" values you could use the Security Registers, and protect via OTP setting in the status registers. Other parts have OTP, the Micron parts have unique data / serialization deeper into the JEDEC ID (0x9F)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

@FBL thanks to confirm the quantity of dummy cycles.

I'll use my second try. Thanks for your support here.

@Tesla DeLorean thanks for your contribution and tips for others solutions.