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:
[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=]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. */
    /* Configure the system clock */
    /* Initialize all configured peripherals */
    buff[0] = 0x9F;
    HAL_SPI_Transmit(&hspi5, buff, 1, 1000);
    HAL_SPI_Receive( &hspi5, buff, 4, 1000);
    while (1) {

The code was generated using STM32CubeMX.

Anyone please help me solve this issue?