Skip to main content
MBaig.1
Associate II
Aug 25, 2021 2:13 PM UTC
Question

stm32 EEPROM Read

Hello Every one i am using the STM32WB35CC SoC for custom BOARD, I am facing an issue that when i tries to write EEPROM I get correct response checked using Logic Analyzer but when i tried to read eeprom I GET HIGH impedance with every address. The Eeprom i am using is CAT25320 .... waiting for solution

This topic has been closed for replies.

22 replies

ONadr.1
Senior III
Aug 27, 2021 10:16 AM UTC

Place here the analyzer waweform picture for write and read operation. Perharps read op. has roblem too. Without the waveform is not possible give any help.

MBaig.1
MBaig.1Author
Associate II
Aug 27, 2021 10:38 AM UTC

Sorry my bad i tried to copy paste images

WREN:

0693W00000DlQBuQAN.pngWRITE:

0693W00000DlQCEQA3.pngWRDI:

0693W00000DlQ6gQAF.pngREAD:

0693W00000DlQD7QAN.png

ONadr.1
Senior III
Aug 27, 2021 11:32 AM UTC

As you can see on first picture, value of status register is 0x0E. So, bits BP0 and BP1 are set and whole adress space of EEPROM is write protected. WEL bits alow write only to unprotected pages. Please, look into datasheet, how to clear this bits. I don't have enough time for that today.

MBaig.1
MBaig.1Author
Associate II
Aug 27, 2021 11:55 AM UTC

First of all thank you for quick response but my results are same with even WRSR 0x02

i have attached the results below:

WREN with WRSR to remove protection

0693W00000DlQjhQAF.pngWRITE:

0693W00000DlQk1QAF.pngThen i wait until busy flag set low:

0693W00000DlQkGQAV.pngAfter Disabling write i read for data0693W00000DlQkVQAV.png

ONadr.1
Senior III
Aug 27, 2021 12:28 PM UTC

Try to set CLKPolarity to SPI_POLARITY_LOW and CLKPhase to PSI_PHASE_1EDGE

MBaig.1
MBaig.1Author
Associate II
Aug 27, 2021 12:34 PM UTC

Similar Results

ONadr.1
Senior III
Aug 27, 2021 12:58 PM UTC

I dont understand, why you have in read operation some pulses on MOSI. It is strange. Do you use HAL function for reading?

MBaig.1
MBaig.1Author
Associate II
Aug 27, 2021 1:16 PM UTC

Yes i do use HAL function for reading over SPI

ONadr.1
Senior III
Aug 27, 2021 6:50 PM UTC

How the EEPROM is connected? Short wires? Breadboard? Is there cca 100nF capacitor near the EEPROM. Is the EEPROM power suply OK?

You write from adress 0x01. Try to read from adr. 0x01 too. We dont know what was writen to adr 0x00. Perharps first byte is OK.

It seems as some interference could interfere SPI operations.

MBaig.1
MBaig.1Author
Associate II
Aug 30, 2021 8:32 AM UTC

The EEPROM is connected on PCB a custom board, also there is 1uF capacitor attached with (WP,VCC & HOLD) pins. Yes the power supply for EEPROM is OK I checked the voltage level .

I have create a loop in which i am writing to address with increment by 1 but not getting response for Read what is required.

I didn't get how are you saying first byte is ok as it sends me 0x20 which the byte I wrote is 0x34 as first byte.

EEPROM is connected closer to the SPI pins however SPI lines are also shared with Shift register but that shouldn't be any problem as only MOSI line and clock is shared