2013-07-21 04:50 AM - edited 2023-11-20 09:41 AM
Hello, i am making adsp-21488 spi flash programmer, and i run into some trublmes.
I use STM32F415 and using SPI1 (PA5/6/7) *** PB0 for communication with SPI. I can read Flash ID with no problem, and it's same as declared in pdf, so my spi is ok. but i can't do any read or write (maybe just write, since i read void data) I use different SPI flash as in example, but all commands, and timings are the same SST25VF016B in board, but example is for M25P64 Any idea why it's not write data correctly ? (It fails write, but pass in erase test) (if i run spi exaplme code, i get only first letter, all others are FF ) SPI init looks like this:SPI_InitTypeDef SPI_InitStructure;
sFLASH_LowLevel_Init();
sFLASH_CS_HIGH();
SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;
SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;
SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge;
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_4;
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
SPI_InitStructure.SPI_CRCPolynomial = 7;
SPI_Init(sFLASH_SPI, &SPI_InitStructure);
SPI_Cmd(sFLASH_SPI, ENABLE);
2015-05-26 04:28 AM
2015-05-28 05:24 AM
2015-06-01 09:57 PM
SPI M25P64 FLASH...WORKING CODE(MINE IS STM32F103 -EVAL BOARD.....CODE READS DEVICE ID ANDI WROTE ONE BYTE TO FLASH AND READ THE SAME..........JUST THAT ERASE FUNCTION I HV TO CHECK....BCOZ WE HV TO ERASE THAT BYTE WE WROTE AT 0X700000 LOCATION ELSE IT GIVES SAME BYTE READING...) REMOVE ERASE FUNCTION......PROBLEM I FACED IS ...... JUSTT GIVE DELAY AFTER SPI INITIALIZATION........AND CHECK SLAVE SELECT PIN ..IT SHOULD BE OUTPUT..AND OTHERS IN AF MODE.
2015-06-28 10:53 PM
GUYS ..SORRY ABOVE CODE CAN READ DEVICE ID CORRECTLY.....STILL READ WRITE IS NOT WORKING............ FOR READING DEVICE ID JUST CHECK IF UR SPI IS GETTING TIME TO INITIALIZE.....ADD DEALY OR TAKE APPROPRIATE PRE SCALAR.......I WILL WORK OUT READING AND WRITTING SOON..