2
\$\begingroup\$

For a project, I need to have some external memory. I went for 1MB of SRAM.

I am using an STM32 and I discovered the FSMC. I had a hard time understanding the purpose of this.

What I read about it led me to the fact that by using it, it gives you a direct memory location. So you can write to memory without having to pilot the specific pins (like CE, OE, WE...). It also allows you to write/read to SRAM without having to use GPIO write registers, so you are way faster. (of course, there are a lot more advantages). If I'm right I guess it is a very good idea to use it.

Am I right to think like that? Did I get it completely wrong?

\$\endgroup\$
9
  • 1
    \$\begingroup\$ What did you read? Did you read the dedicated document? \$\endgroup\$
    – Eugene Sh.
    Jul 17, 2018 at 16:04
  • \$\begingroup\$ Faster ? Nope.. \$\endgroup\$
    – Long Pham
    Jul 17, 2018 at 17:01
  • \$\begingroup\$ Whether the FSMC supplies any advantage depends on the STM32 you are using. For example it would be on no use on any of the value line product (M2 based) but it would provide value on the high performance line with the AHB bus. You provide no details of your configuration so it's impossible to help you. \$\endgroup\$ Jul 17, 2018 at 17:32
  • \$\begingroup\$ @JackCreasey "M2 based"? I'm not sure what you're referring to here; there is no such thing as the Cortex-M2. All STM32 microcontrollers have an AHB, but not all support FSMC. \$\endgroup\$
    – user39382
    Jul 17, 2018 at 20:52
  • \$\begingroup\$ @duskwuff Sorry ..typo ...meant M3 based. \$\endgroup\$ Jul 17, 2018 at 21:57

1 Answer 1

3
\$\begingroup\$

Am I right to think like that ? Did I got it completely wrong ?

FSMC can be used for storing data in a volatile configuration. Some (not all) STM32's have FSMC mapped to an address space (at 0x60000000). Using a serial SRAM is best for storing data that you don't need fast access to. If you use it for values that are common in execution it could slow your program down considerably.

You still have to configure the pins for use with FSMC and wrap your head around the interface, and test it.

\$\endgroup\$
2
  • \$\begingroup\$ Hi @laptop2d Sure, I just want to use to store data from a camera so I can process it later, and for some images for a TFT display. I understood that the FSMC provides a memory location so it behaves like writing to the internal MCU RAM on the programming side. If I get it correctly, letting the FSMC control all the pins automatically in the hardware is way faster for the MCU than trying to pilot every command pins manually right ? Btw i'm using an STM32L496ZG MCU and this SRAM : cypress.com/file/43811/download \$\endgroup\$
    – Fever
    Jul 19, 2018 at 10:06
  • \$\begingroup\$ You could use it like a rom and count on it being slow, but it would be in the address space and volatile. That means if you were to use it for a TFT display and you needed to fetch the image often, you would have a delay every time you fetched the image. FMSC might be a little faster, but still much slower than RAM as the data is sent serially. meta.stackexchange.com/questions/126180/… \$\endgroup\$
    – Voltage Spike
    Jul 19, 2018 at 21:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.