This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Interfacing STM32 with External 512kx16 SRAM, 8bit data only accessible per one address of RAM

Hi,I have STM32F4 interfaced with the external SRAM sized 512kx16 array. Now what I believe is (Pls correct me if i am wrong), Pointing to Every incremental Address should give me 16bit data. because SRAM is interfaced with 16bit wide data bus (non multiplexed)

For Example: 0x64000000 is the base address of my external SRAM. And I want to write hello, to this RAM, then It should happen like...
on 0x64000000 location, data should be written, 'H' 'E' &
on 0x64000001 location, data should be written, 'L' 'L' &
on 0x64000002 location, data should be written, 'O' 0xff .
And the same is should be getting in read back.

But What actually occurs is
on 0x64000000 location, data should be written, 'H' 'E' &
on 0x64000001 location, data should be written, 'E' 'L' &
on 0x64000002 location, data should be written, 'L' 'L' &
on 0x64000003 location, data should be written, 'L' 'O' &
on 0x64000004 location, data should be written, 'O' 0xff . So If I want to get the write data, I will have to read back 16 bit data from location 0x64000000, 0x64000002, and 0x64000004.

Can Anyone Has the experience of interfacing 512kx16bit array SRAM ? and facing the similar issues ??

Parents
  • Yes, you can only access 8-bits of data per address.

    No, incrementing the address by one does not move you to the next 16-bit item, it moves you to the next byte.

    Given what you describe here, it looks like the FMC is setup properly and the processor is talking to the SRAM properly.

    The whole reason for the FMC is to make the memory as transparent as possible to your program.

    To write "HELLO" to the SRAM do the following:

    strcpy( (char *) 0x64000000,"HELLO");
    

Reply
  • Yes, you can only access 8-bits of data per address.

    No, incrementing the address by one does not move you to the next 16-bit item, it moves you to the next byte.

    Given what you describe here, it looks like the FMC is setup properly and the processor is talking to the SRAM properly.

    The whole reason for the FMC is to make the memory as transparent as possible to your program.

    To write "HELLO" to the SRAM do the following:

    strcpy( (char *) 0x64000000,"HELLO");
    

Children