2017-05-22 05:44 AM
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?
2017-05-22 07:38 AM
There is not consistent naming, as I recall the pins refer to Bank0 and Bank1
Look for HAL examples under the Cube install for the EVAL and DISCO boards, should be examples of the 0xC0000000 and 0xD0000000 configurations/use cases