SDRAM module

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
OutoftheBOTS_
Posts: 772
Joined: Mon Nov 20, 2017 10:18 am

SDRAM module

Post by OutoftheBOTS_ » Wed Mar 27, 2019 9:12 pm

Does anyone know if this really cheap 32meg SDRAM module can be made to work on a STM32 MCU https://www.aliexpress.com/item/256Mbit ... 83b54ebd0b

User avatar
pythoncoder
Posts: 4171
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: SDRAM module

Post by pythoncoder » Fri Mar 29, 2019 10:35 am

If you're talking about increasing heap memory the answer is no. The necessary hardware interface is unavailable.

[EDIT]Apologies for the noise. I was unaware of the FSMC.
Peter Hinch

User avatar
marfis
Posts: 196
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: SDRAM module

Post by marfis » Fri Mar 29, 2019 1:37 pm

Not too sure but STM32’s FMC peripheral does have support for SDRAM

it is apparently supported / enabled in some of the boards, e.g here
https://github.com/micropython/micropyt ... oard.h#L97

but I havent tried it. The comment indicates it can be used for heap.

OutoftheBOTS_
Posts: 772
Joined: Mon Nov 20, 2017 10:18 am

Re: SDRAM module

Post by OutoftheBOTS_ » Sat Mar 30, 2019 8:17 am

I have used the FMSC peripheral to write to the RAM of a TFT in 16bit parallel in C. See this code https://github.com/OutOfTheBots/ili9341_16bit_touch was part of the development for this video https://www.youtube.com/watch?v=H51OzQl3BC8&t=8s

Do you know for sure if the FSMC will support SDRAM or only SRAM and PSRAM??

User avatar
marfis
Posts: 196
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: SDRAM module

Post by marfis » Sat Mar 30, 2019 8:20 pm

According to the reference manual for the F7:
https://www.st.com/content/ccc/resource ... 124865.pdf

page 307,
The FMC functional block makes the interface with: synchronous and asynchronous static memories, SDRAM memories, and NAND Flash memory
and
Interface with synchronous DRAM (SDRAM/Mobile LPSDR SDRAM) memories
The micropython repository supports the STM32F7 discovery kit: https://www.st.com/en/evaluation-tools/ ... overy.html it includes 128 MBits of SDRAM. FMC is enabled in mpconfigboard.h, so it should run out of the box.

OutoftheBOTS_
Posts: 772
Joined: Mon Nov 20, 2017 10:18 am

Re: SDRAM module

Post by OutoftheBOTS_ » Sat Mar 30, 2019 9:40 pm

Thanks a lot this answers my question.

Not that I need 32meg of SDRAM it would be an interesting learning curve for me to buy 1 of these cheap modules and made it work :)

User avatar
marfis
Posts: 196
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: SDRAM module

Post by marfis » Sun Mar 31, 2019 1:10 pm

made it work
i‘d also be interested if this is going to work, let me know how it has turned out.

exider
Posts: 6
Joined: Sat Jul 29, 2017 2:02 am

Re: SDRAM module

Post by exider » Tue Nov 05, 2019 2:30 pm

OutoftheBOTS_ wrote:
Sat Mar 30, 2019 8:17 am
I have used the FMSC peripheral to write to the RAM of a TFT in 16bit parallel in C. See this code https://github.com/OutOfTheBots/ili9341_16bit_touch was part of the development for this video https://www.youtube.com/watch?v=H51OzQl3BC8&t=8s

Do you know for sure if the FSMC will support SDRAM or only SRAM and PSRAM??
Hi OutoftheBOTS,
Did you wrap that c code in python? Asking as I have one of those Acelex tft displays that the pins correspond to those 16bit fsmc pins of the board and would be great if I can make use of it in micropython.

If so, would you mind sharing the code?

OutoftheBOTS_
Posts: 772
Joined: Mon Nov 20, 2017 10:18 am

Re: SDRAM module

Post by OutoftheBOTS_ » Tue Nov 05, 2019 9:45 pm

No I haven't :(

My business has been super busy lately and I have been working more than 12hrs a day and 7 days a week for last couple of months. On my short list is to build a robot for a comp coming up next year.

What is on my list to do is to write a pure python implementation using viper mode of the 16 bit TFT interface using the FMSC peripheral but not sure when I will get time to do this.

User avatar
jcw
Posts: 22
Joined: Sat Dec 21, 2019 12:08 pm
Location: CET/CEST

Re: SDRAM module

Post by jcw » Sat May 23, 2020 3:22 pm

(Reviving an older thread ...)

On STM32, the FMC supports SRAM and SDRAM, the FSMC only supports SRAM (hence the "S"). The older F40x series have the more limited FMC, F42x and up have FMC. E.g. the STM32F429DISC build includes support for SDRAM, and puts the heap there.

I've been looking into the https://github.com/mcauser/BLACK_F407ZG board, which has the pads to solder a static RAM chip on the back, but haven't found an example of how to enable it in µPy yet.

In short: hardware-wise SRAM and SDRAM are definitely possible.

Post Reply