Skip to main content
Visitor II
August 13, 2025
Question

To read write data into Flash W25Q16JV with STM32L452CE using SPI2 with CS pin PB12

  • August 13, 2025
  • 1 reply
  • 247 views

I am trying to read ID and to write and read the data from the flash W25Q16JV with SPI2 of stm32L452CE connection, I am not even getting the ID from flash but SPI tx rx is getting HAL_OK. This wiring is working other code and providing unique ID from flash, but it is not working with my code. Please find the issue and update the corrected solution. In this I am using Mode 0 for flash. I have tried not SPI tx project and also FreeRTOS SPI task, but both are not giving ID or values. I will attach the project file with this, kindly check both and update the correct solution.

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    August 21, 2025

    Hello @ela and welcome to the community;

     

    Make sure that the NSS and SCK signals are toggling correctly. For that, please use an oscilloscope or logic analyzer to check the SPI signals (MOSI, MISO, SCK, and NSS).

    Verify the wiring and ensure that all connections are secure and correct.

    May these articles can help you to communicate with simple SPI-Flash memory

    How to add your SPI flash into the STM32CubeProgrammer’s external loader Part 1

    How to add your spi flash into the STM32CubeProgrammer's External Loader Part 2

    Thank you.

    Kaouthar