cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible, after properly inizializing the FMC, write directly to an external memory without resorting to FMC functionalities?

NMaun
Associate

Dear all,

to explain better, what I have is an external memory connected to my stm32f4 MCU, in order to communicate with it I have to pass through the FMC. The external memory is an FPGA.

What I would like to do, if it is possible, is to first inizialize the FMC with the proper configuration than write to memory (actually sending data to FPGA) without using the FMC HAL, practically calling a STORE assembly instruction at the proper address with the data I want to send.

The FMC is not used for anything else than that external memory.

Hopefully I was clear enough in explaining my problem/goal.

Thank you for your help.

Best regrards

2 REPLIES 2
Ozone
Lead

Of course. That is the purpose of the FMC peripheral.

I didn't mess much with FMc yet, but the "old" SPL-based packages (F4 discovery firmware and F4 DSP_SPL libs) contain FMC examples as well.

FMC attached storage has certain limitations, though.

berendi
Principal

Yes. Look into the read/write functions provided by HAL, there are just fancy wrappers that cast a pointer to volatile and dereference it. You can safely use str, strh or strb depending on the bus width, or have pointers of type

volatile uint8_t *byteaccess = (volatile uint8_t *)0x60000000;
volatile uint16_t *halfwordaccess = (volatile uint8_t *)0x60000000;
volatile uint32_t *wordaccess = (volatile uint8_t *)0x60000000;

and dereference them or use as an array.