AnsweredAssumed Answered

STM32F429IGT SDRAM Read/Write

Question asked by Ivan Klochkov on May 22, 2017

Hi all,


I've got a board with IS45S16400J SDRAM connected to MCU, FMC bank 2. I'm entering data via UART and write it to SDRAM, then I'm reading it and sending back data.

Received data looks kinda strange, the first 8 bytes are the one I was sending but there is happen to be another 32 bytes with random numbers. Then I'm keep receiving those 40 bytes but this time the first 8 are zeroes. Here's loop function (both Rx and Tx buffers are 8 bytes):

  while (1)
HAL_UART_Receive_IT(&huart1, RxBuff, sizeof(RxBuff));
        if(huart1.RxXferCount == 0) {
HAL_SDRAM_Write_8b(&hsdram1, &addr, RxBuff, sizeof(RxBuff));
HAL_SDRAM_Read_8b(&hsdram1, &addr, TxBuff, sizeof(TxBuff));    
HAL_UART_Transmit_IT(&huart1, TxBuff, sizeof(TxBuff));               

The other thing is that I don't actually know what address in HAL_SDRAM_Write/Read should be. Is that offset from bank address or bank address (0xD0000000) with offset? By the way, reference manual says that FMC bank 2 is used by NAND Flash. Does it mean my SDRAM connected incorrectly and I can't use it?