2015-10-12 01:02 PM
Hi,
The Micron M25P128 flash seems to be writing and reading OK. As clive1 suggested, the SPI flash functionality is written in the Std Peripheral examples, so I am using that. When I execute the call to: sFLASH_EraseSector, this function calls: sFLASH_WaitForWriteEnd which waits for the read status register's WIP bit to go low. Well, it never happens. It just sits there.....and spins. How long should a call to sFLASH_EraseSector take? The function sFLASH_WaitForWriteEnd is pasted below. Thanks, Gary ***************************************************************** void sFLASH_WaitForWriteEnd(void) { uint8_t flashstatus = 0; /*!< Select the FLASH: Chip Select low */ sFLASH_CS_LOW(); /*!< Send ''Read Status Register'' instruction */ sFLASH_SendByte(sFLASH_CMD_RDSR); /*!< Loop as long as the memory is busy with a write cycle */ do { /*!< Send a dummy byte to generate the clock needed by the FLASH and put the value of the status register in FLASH_Status variable */ flashstatus = sFLASH_SendByte(sFLASH_DUMMY_BYTE); } while ((flashstatus & sFLASH_WIP_FLAG) == SET); /* Write in progress */ /*!< Deselect the FLASH: Chip Select high */ sFLASH_CS_HIGH(); }2015-10-12 06:35 PM
Can we keep stuff that's ostensibly about the same problem arc in one thread. Thanks.
[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F4%20ST%20Example%20SPI%20Not%20Functioning%20-%20Sector%20Erase¤tviews=3]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FSTM32F4%20ST%20Example%20SPI%20Not%20Functioning%20-%20Sector%20Erase¤tviews=3