AnsweredAssumed Answered

FMC SRAM 32-Bit width

Question asked by Daniel Studer on Nov 14, 2017
Latest reply on Apr 15, 2018 by waclawek.jan

Hello

 

I'm using the FMC bus on a STM32F767 to read and write to an external device in SRAM mode with 32-Bit width.

Is it not possible to address the external memory in byte-address mode instead of 32-bit address mode?

 

I measured the address signals (A3-A0) and these signals are always shiftet right by two bits from the address I use in Code. Following examples:

External Memory at Address 0x60000000 (FMC Bank 1, NOR/PSRAM 1)

reading address 0x60000000 - Address Bus measured at external memory (A3-A0): 0x00

reading address 0x60000001 - Address Bus measured (A3-A0): 0x00

reading address 0x60000002 - Address Bus measured (A3-A0): 0x00

reading address 0x60000003 - Address Bus measured (A3-A0): 0x00

reading address 0x60000004 - Address Bus measured (A3-A0): 0x01

reading address 0x60000005 - Address Bus measured (A3-A0): 0x01

reading address 0x60000006 - Address Bus measured (A3-A0): 0x01

reading address 0x60000007 - Address Bus measured (A3-A0): 0x01

reading address 0x60000008 - Address Bus measured (A3-A0): 0x02

 

As I understand, I have to read 4 bytes at address 0x00, and the next 4 bytes at address 0x01. But most memories are byte-addressed I thought, so byte 0 at address 0x00, byte 1 at address 0x01 and so on.

 

During read the BLE0-3 are always set to LOW. These signals are only used when writing.

 

Another question is, how to read as example 6 bytes at adress 0x00?

By using HAL_SRAM_Read_32b() it is only possible to read multiplication of 4 bytes. Do I have to use HAL_SRAM_Read_32b() for the first 4 bytes and then HAL_SRAM_Read_16b() for the remaining 2 bytes?

Or is it better to read 8 bytes with HAL_SRAM_Read_32b() and then discard the 2 bytes which I not use manually?

 

Thank you for any help.

 

Dani

Outcomes