Skip to main content
EOzde.1
Associate III
September 6, 2021
Solved

Does STM32H745ZI(LQFP144) FMC support external SDRAM or SRAM? (not PSRAM).

  • September 6, 2021
  • 12 replies
  • 3642 views

Hi,

In CUBEMX with LQFP144, there is no configuration for both SRAM and SDRAM? But with other packets (LQFP176, LQFP208) there is a configuration like SDRAM1, SDRAM2, SRAM. Is it not possible with the LQFP144 or if I configure the parameters directly from the code, would it works? Because I believe all packets have the same properties except the pin numbers. 

Thank you.

This topic has been closed for replies.
Best answer by Harvey White

In the configuration tool, using either the cubeMX-IDE or the older tool, do a control left click on the pin in question. That should cause the alternate pins for the function to blink. As an example, SPI5-MISO on the F767 has a pin to the left side of the chip, and also one to the bottom.

For any function and any chip:

the configuration generator reads the assigned functions from the chip model. You can only select legal functions for any pin. The "produce code" generates user pin named definitions in main.h. Look for stm32xxxxxxx_hal_msp.c in the core/source directory. Replace the xxxxxx by something appropriate to your processor. Check the inits, and you will find where the configuration tool defines the pin functions for the processor.

You do NOT need to mess with this. If you're using the MX configuration tools, defining the alternate functions at that level and in that application will work for you.

If you are designing your own board, you have the most flexibility. If you use a Nucleo board, then you have less, but the alternate functions will likely be different for each project. If you use a Discovery board, be aware that the default setups (say for FMC on the 459i Disco board) are not used without modification, there's an alternate pin used.

So: only your user named pins are in main.h.

Use the configuration tool (even when using BSP drivers) to assign alternate pins.

Mixing BSP drivers on DISCO boards with cubeMX drivers is another issue entirely.

12 replies

Walid ZRELLI
Visitor II
September 6, 2021

Hello @EOzde.1​ ,

Yes, they could be configured by STM32CubeMX or you can configure the parameters directly from the code.

Otherwise, Can you provide the STM32CubeMX version used?

BeST Regards,

Walid

EOzde.1
EOzde.1Author
Associate III
September 6, 2021

Hi,

Thank you for your answer. I really appreciate that.

I am actually using CubeIDE. I don't know how much difference it makes? Its version is 1.6.1. My CubeMX version is 6.2.1. So you are saying that there is no configuration for LQFP144 in cubeMX but if I configure the parameters directly from the code, not with cubeMX It would work?

Thank you. Best Regards.

Walid ZRELLI
Visitor II
September 6, 2021

Hello @EOzde.1​ ,

you can configure your FMC on STM32H745ZI (LQFP144) using the STM32CubeMX but make sure you have selected the necessary core.

As well, if you configure the parameters directly from the code, It should work.

BeST Regards,

Walid

TDK
September 6, 2021

The FMC_A0 pin isn't broken out on the LQFP144, which I believe is required for SDRAM/SRAM.

https://community.st.com/s/question/0D53W000012UyVLSA0/stm32h745zilqfp144-fmc-and-sdram-support

"If you feel a post has answered your question, please click ""Accept as Solution""."
EOzde.1
EOzde.1Author
Associate III
September 7, 2021

Yes, I see that but isn't it just a GPIO with an alternate function feature. If I configure lets say PBO as FMC_A0 (AF) and use one of the examples that st provided for SDRAM. I believe it should work. Do you think it makes sense :) Thanks for your answer.

Best Regards.

TDK
September 7, 2021
FMC_A0 isn’t on the PB0 pin.
"If you feel a post has answered your question, please click ""Accept as Solution""."
QSHAO.1
ST Employee
September 7, 2021

with my cubeMX, the FMC seems not available for STM32H745ZI.

QSHAO.1
ST Employee
September 7, 2021

sorry, I mean the FMC seems be able to support PSRAM and NOR flash based on CubeMX

QSHAO.1
ST Employee
September 7, 2021

And SDRAM is not supported by FMC on STM32H745ZI as several signals (like BA0) are not available on this package of QFP144.

EOzde.1
EOzde.1Author
Associate III
September 7, 2021

Thanks for the answer;

Okay, so CubeMX does not support FMC with SDRAM and SRAM. Only PSRAM and NOR flash can be configured for FMC in CubeMX. I think that my question should be can I configure FMC for SDRAM directly from the code or without FMC can I still use SDRAM with the QFP144?

Best Regards.

TDK
September 7, 2021
The hardware doesn't support SDRAM on LQFP144. This is not a CubeMX limitation, or something that you can work around by writing your own code.
"If you feel a post has answered your question, please click ""Accept as Solution""."
Harvey White
Senior III
September 11, 2021

Depending on the chip, you get an FMC or (I think) FSMC. FSMC has no dynamic RAM support, FMC supports all memories.

Some of the Dynamic memory pins can be remapped. In the 459Disco board, I believe that A0 must be remapped from the default. To the extent you can do that, you can run various types of memory.

I have a design that uses SDRAM and SRAM on a F767, The FMC accepts this. (Lines from the chip to the dynamic memory are too long and I think the SDRAM reading and writing is unreliable. The SRAM (display chip) works, but the timing had to be adjusted a bit.

EOzde.1
EOzde.1Author
Associate III
September 11, 2021

Thank you for your opinion,

I have checked every pin that I need to use FMC SDRAM. Only 3 pin is missing in the configuration. If I can find the alternative ones for those pins It would work. But I couldn't find where the pins are registered for that purpose in the code. For example when I configure SPI3 in the CubeMX. There is a configuration in msp function for related pins. But in the msp init function MISO and MOSI pins are both configured as alternate functions. How does the chip know which one is MISO or MOSI. This is what I am looking for in the code. Maybe it is only a hardware thing. If this is the case. There is no option to change the necessary pins with their alternatives.

Best Regards.

TDK
September 11, 2021
It's a hardware thing. You cannot arbitrarily assign alternative pins. The available pins for each signal are in the datasheet.
"If you feel a post has answered your question, please click ""Accept as Solution""."
Alex - APMemory
Associate II
January 14, 2022

In case you can't solve your issue with SDRAM or SRAM on FMC, you may want to consider QSPI PSRAM for low pin count memory (16Mb, 64Mb, 128Mb). I so, you need to know there are a limitation as this is a NOR Memory controller and Memory Mapped Write is not available.

Alex

Harvey White
Senior III
January 14, 2022

There is another alternative, that I just discovered. There's a dynamic memory, QSPI, automatic refreshing. At Mouser (for the US) the chip is APS6404L-3SQR-SN. It runs about 1.74 each, quantity 1. I plan to get some and I do have some boards where it would fit immediately. it's a 64Mbit memory organized as 8 megs * 8. Not the ideal mapping, but possible and certainly ought to give you more memory.

The QSPI memory (or a mode on OCTOSPI) is supposed to be memory mapped, which is half the battle. It Not sure if it has a dual mode, it may not. It's worth a try, especially since I already have space on a board for one.

The difference here is that I haven't found any of the other technologies to be reasonably priced. This seems to be quite reasonable.

I think that the FMC allows (or can allow) QSPI memory to be written.

Different incarnations of the ST chip have different FMC controllers.

Alex - APMemory
Associate II
January 14, 2022

fyi, you can also get 16Mb density (APS1604M-...3V/1.8V, SOP8/USON8) and soon 128Mb (APS12804O-...only 1.8V WLCSP). Dual-quad mode is usualy available.

Main point to have in mind is that NOR QSPI controller doesn't support Memory Mapped Write.

For MCU version supporting OCTOSPI, then you have a much wider choice upon needs such as:

  • OPI from 64Mb to 512Mb in BGA24 or WLCSP (APS6408L, APS12808…, APS25608N…, APS51208N…)
  • QSPI DDR 128Mb WLCSP (APS12804O-DQ-WA)
  • QSPI SDR 16Mb to 128Mb, SOP8/USON8/WLCSP (APS1604M-…, APS6404L-…, APS12804O-…)

Alex