AT25SF041B generate no SPI signal


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

  • Hai,

    I have an coustomised board with DA14683 MCU and W25Q40EW SPI FLASH. In that board flash is working and my application program is also working.

    Now I have a new board with same design containing DA14683 MCU and with NEW flash AT25SF041B. But here SPI is not flashing. I am using smartsnippet IDE.

    So SPI is flash is chnaged , so what are all the things i need change in my IDE or Code based on new spi flash. 

    I gone through both spi flash data sheets , pin description and opcodes commands maximum all are same. Is there any flash driver i need to add based on New SPI flash.

     And also How MCU copy the program to the SPI FLASH?

    Does the MCU contain any default code to Copy code to the SPI Flash? Where can we get that code?

    When I flash in new board ie MCU with AT25SF041B SPI Flash, only MCU part name is coming in TERA TERM serial monitor, I put some printf statements too to print helloworld. But only MCU PART number is coming in serial monitor. Why that is? [ MCU with old flash is working]

    Please help me for this.  


  • To may experience most of the flash memories are compatible about the commands and pin out. Did you check the flash protection also? It´s sounds like there is a write protection initial enable on the AT25SF041B that the other chip don´t have. 

  • I am using the write protection pin as a data pin(SPI_FLASH_D2) in quad spi mode and write protection is present in both old and new SPI flash

  • I don´t mean the hardware pin. I mean the "Non-Volatile Protection". Or Block Protection. did you check this also?

  • 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.