AnsweredAssumed Answered

stm32f4 spi issue

Question asked by mburu.maxwell on Jan 21, 2015
Latest reply on Jan 22, 2015 by waclawek.jan
I recently bought the STM32F429I-DISCO and less than one month down the line am beginning to get disappointed.
I connected AT45DB041D to it via SPI5 and the last bit of almost every byte was misbehaving. Either it is set on not set. Reading the ID of the chip gave me 0x1F (atmel) and 0x25(8Mbit) yet the chip is 4Mbit. I tried out with LPC4337 which I was using for another project and it turned out to be okay giving 0x1F and 0x25. This last bit corruption occurred everywhere except when reading the status register.
On googling I found these links:
link1
link2
[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32%20SPI%20Spoiled%20Bits&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx?Paged%3DTRUE%26p_StickyPost%3D%26p_DiscussionLastUpdated%3D20141010%252021%253a14%253a50%26p_ID%3D46804%26View%3D%257bF47A9ED8%252dE726%252d42BE%252dACED%252d732F13B66581%257d%26FolderCTID%3D0x012001%26PageFirstRow%3D41&currentviews=64]link3

I tried out and yes using SPI2 or even SPI3 wrks perfectly. However, SPI1, SPI4 and SPI5 all resulted in corrupted data. Here is the part I called in my code:
uint8_t buff[4];
int main(void) {
    /* MCU Configuration----------------------------------------------------------*/
 
    /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
    HAL_Init();
 
    /* Configure the system clock */
    SystemClock_Config();
 
    /* Initialize all configured peripherals */
    MX_GPIO_Init();
    MX_SPI5_Init();
 
 
    buff[0] = 0x9F;
    AT45_ENABLE();
    HAL_SPI_Transmit(&hspi5, buff, 1, 1000);
    HAL_SPI_Receive( &hspi5, buff, 4, 1000);
    AT45_DISBALE();
     
    while (1) {
         
    }
}

The code was generated using STM32CubeMX.

Anyone please help me solve this issue?

Outcomes