Hi,
I have connected the Flash memory to a STM32G071 Nucleo board.
For example I try to read the manufacturer and device Id, but the chip don´t send an answer. I tried 3 chips but all with the same result.
!Hold and !WP are connected to VCC.
!CS is controlled by the controller.
Clock frequency is 0,5MHz.
Any suggestion why i don´t get an answer from the chip?
In this type of situation, I would first try to confirm that your host/MCU and associated code / driver for SPI is really functioning in terms of writing and reading a known tested SPI device. After this is confirmed, make sure that the SPI frequency (start with a lower frequency) is set within the limits, set SPI Mode (try Mode = 0 to start with). Study carefully, how this SPI transaction works =>See attached timing diagram and refer datasheet for more details.
Basically, the clock from your host MCU (you are sending commands from)should continue until the SPI Flash has completed sending back the ID to MCU.Also, just for testing on the scope, try to send 90h(8 bits) + 24 bits of zeros + 16 bits for ID (CLK count required = 48)in a loop.So, you need a total of 48 clock cycles.For every loop, toggle the CS. In a nut shell the following bit sequence should be used =>The SPI Read Mfr ID instruction is initiated by driving the CS pin low and shifting the instruction code 90h ( confirm this command code for your device from datasheet ) followed by a 24-bit address (A23-A0) of 000000h. If the 24-bit address is initially set to 000001h, the Device ID will be read first. Note that there will be nothing (high impedance) on the SO line until the transmission of the instruction code 90h and 24-bit address (A23-A0) of 000000h are finished. That is 8+24 = 32 bits of silence. After that, the ID will appear on the SO line.
Best regards,Renesas Electronics Online Support
Thanks for the answer. Problem is solved. There was a problem with the wire for SI
Yes that is also present in both spi flash.
Is there any flash driver especially for new flash AT25SF041B.
because in that SDK which i downloaded for that mcu had old spi flash related codes. So i asked this.
I am also able to see toggle in CS and data lines of the spi flash when analyzed using CRO
I´m write the code myself that time I´m working with the Flash. But I also use different Flash devices without problems.
In your case you have tested code, I would think there must be something in the initial values that's are different.
Where to find the initial values in the sdk or any other configuration required for the flash.
And if possible can you please send me your code, I ll go though it, may be i ll get some idea.
And also I have STM32L496 Nucleo-144 board. I ll try in that too by connecting spi flash from my board.
I check the code. I don´t do any special Init.
I can´t post you the code here.
1. I`m reading the status of the Flash
2. Checking for Deep Sleep
3. Wake up Flash
4. read status again
5. set Write enable
6. Transmite Opcode, Address and Data
7. Disable write enable
That's all.
Do you check the SPI Buffer before disable the Chip select?
I am using Smart snippet IDE tool.
I am doing all spi erase and write using scripts provided in the SDK of that DA14683 MCU.
we are not able to trace the flash access in the SDK,(spi calls,erase,write etc).
If possible mail your code to" [email protected] " , instead of post here .
Thanks
i didnt get any thing related to deep sleep in the data sheet. why did you check deep sleep?
AT25SF041B SPI FLASH
It´s call deep power down in the datasheet. But you need to activate it by a command. So the status flag is a local one my code.
To reduce the power consume I can put the flash to deep power down. But before writing I´m doing the check for deep power down. Its easier for the OS programmer if the HAL layer handle the wake up.
Deep down power is same as in both SPI Flash ,old and new. But old spi flash is working and new one is not working.
Break at address "0x0" with no debug information available, or outside of program code.
Thread #1 57005 (Suspended : Signal : SIGTRAP:Trace/breakpoint trap) 0x0
Do you have any idea about this debug error?