-
-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read "0xFF" or "0x00" #9
Comments
Please try on address 0 |
Have You correct report from chip on initialization stage?
like this:
2020-03-30 4:41 GMT+05:00, Hossein Ghaheri <[email protected]>:
… Hi,
Thank you for this library.
I add this to my project.
My MCU is **STM32F103C8T6** and I use **SPI2** for connect to **W25Q128**.
Code:
```
uint8_t rBuff[256]="";
#define PAGE(_x) _x* 0x100;
#define SEC(_x) _x* 0x1000;
#define BLK(_x) _x* 0x10000;
//----------------------------------------------
StartAddress=SEC(7);
W25qxx_EraseSector(StartAddress);
W25qxx_WritePage("0123456789", StartAddress, 0, 10);
sprintf(rBuff,"");
W25qxx_ReadPage(rBuff, StartAddress,0,10);
```
But I have a problem, After call "W25qxx_ReadPage" function , the all values
of "rBuff" elements is "0xFF" or "0x00" (Null).
Thanks!
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#9
|
uint8_t rBuff[16]; |
I tried this
For the first time everything was right, but after Reset MCU , I got "0xff" again.
I Receive this :
|
I've faced the same issue with stm32g070x. @hosseinghaheri any updates? |
Maybe need to decrease speed?
2020-03-30 17:06 GMT+05:00, Hossein Ghaheri <[email protected]>:
… I tried this
>
>
> uint8_t rBuff[16];
> W25qxx_EraseSector(0) // erase page 0~15;
> W25qxx_WritePage("0123456789", 0, 0, 10);
> W25qxx_ReadPage(rBuff, 0,0,10);
For the first time everything was right, but after Reset MCU , I got "0xff"
again.
Results:
```
w25qxx EraseSector 0 Begin...
w25qxx EraseSector done after 25 ms
w25qxx WritePage:0, Offset:0 ,Writes 0 Bytes, begin...
w25qxx WritePage done after 14 ms
w25qxx ReadPage:0, Offset:0 ,Read 0 Bytes, begin...
w25qxx ReadPage done after 0 ms
```
>Have You correct report from chip on initialization stage?
I Receive this :
```
w25qxx Init Begin...
w25qxx ID:0x848480
w25qxx Unknown ID
w25qxx EraseBlock 0 Begin...
w25qxx Init Begin...
w25qxx ID:0xFFFFFF
w25qxx Unknown ID
w25qxx EraseBlock 0 Begin...
w25qxx EraseBlock done after 12 ms
+++w25qxx WriteSector:0, Offset:0 ,Write 0 Bytes, begin...
---w25qxx WriteSector Faild!
+++w25qxx ReadSector:0, Offset:0 ,Read 0 Bytes, begin...
---w25qxx ReadSector Faild!
```
Circuit:
![w25q128](https://user-images.githubusercontent.com/25803956/77910439-5c7b2a00-72a4-11ea-8c95-10af038d0540.png)
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#9 (comment)
|
I already have tried with the lowest speed. I can read ID, and it looks like I can erase the chip. But later I always get 0 from Reading. WP and HOLD are high |
I set Baud Rate on 9 MBits/s , and the problem was solved. |
Thanks for your feedback |
In my case, there was a kind of bad wiring/soldering. I resoldered the scheme and now it works like a charm UPD: it was a power issue -_- VCC was very low - 3.1V instead of 3.3 |
Good day!
I think about and...:
Why You use diodes d1,d2,d3?
I think problem is here. For example when mcu does low W_MOSI pin,
cureent flows over diod(it`s not good because diode take 0.7-0.9V,
but ok) and MCU`s transistor, when MCU does W_MOSI HIGH, diod d2 is
closed, and current flows via R7, and W25Q128`s DI pin input
capaticance charged only via R7. Because amount of the resistor is
very big You have low speed, and unstable results.
2020-03-30 17:06 GMT+05:00, Hossein Ghaheri <[email protected]>:
… I tried this
>
>
> uint8_t rBuff[16];
> W25qxx_EraseSector(0) // erase page 0~15;
> W25qxx_WritePage("0123456789", 0, 0, 10);
> W25qxx_ReadPage(rBuff, 0,0,10);
For the first time everything was right, but after Reset MCU , I got "0xff"
again.
Results:
```
w25qxx EraseSector 0 Begin...
w25qxx EraseSector done after 25 ms
w25qxx WritePage:0, Offset:0 ,Writes 0 Bytes, begin...
w25qxx WritePage done after 14 ms
w25qxx ReadPage:0, Offset:0 ,Read 0 Bytes, begin...
w25qxx ReadPage done after 0 ms
```
>Have You correct report from chip on initialization stage?
I Receive this :
```
w25qxx Init Begin...
w25qxx ID:0x848480
w25qxx Unknown ID
w25qxx EraseBlock 0 Begin...
w25qxx Init Begin...
w25qxx ID:0xFFFFFF
w25qxx Unknown ID
w25qxx EraseBlock 0 Begin...
w25qxx EraseBlock done after 12 ms
+++w25qxx WriteSector:0, Offset:0 ,Write 0 Bytes, begin...
---w25qxx WriteSector Faild!
+++w25qxx ReadSector:0, Offset:0 ,Read 0 Bytes, begin...
---w25qxx ReadSector Faild!
```
Circuit:
![w25q128](https://user-images.githubusercontent.com/25803956/77910439-5c7b2a00-72a4-11ea-8c95-10af038d0540.png)
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#9 (comment)
|
@namanPuri change your flash chip and try again. |
Hi,
Thank you for this library.
I add this to my project.
My MCU is STM32F103C8T6 and I use SPI2 for connect to W25Q128.
Code:
But I have a problem, After call "W25qxx_ReadPage" function , the all values of "rBuff" elements is "0xFF" or "0x00" (Null).
Thanks!
The text was updated successfully, but these errors were encountered: