spi ram

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
kdv
Posts: 5
Joined: Tue Apr 07, 2015 8:32 am
Location: sunny Madrid, Spain.

spi ram

Post by kdv » Wed Oct 28, 2020 6:48 pm

FYI: driver for external qspi ram.
https://github.com/koendv/micropython-psram

Perhaps a small explanation.
I needed more ram than available, so I unsoldered an spi flash chip from a board, and soldered an spi ram in its place.
Wrote a small driver; implemented a module for reading and writing bytes() and bytearray() to the spi ram.
memory-mapping the ram also works. stm32 memory-mapping gives read access only, as it was designed for XIP using spi flash.

Notes:
- If the cpu runs at 216 MHz, you probably want to clock the qpsi interface at 72 MHz.
- If you are going to read and write 1kbyte pages, you can clock at 108 MHz.

What doesn't work?
- block devices. drivers/memory/spiflash.c tries to send commands that make sense for flash memory, but that are not implemented in spi ram. So no block device for the moment.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: spi ram

Post by jimmo » Thu Oct 29, 2020 12:06 am

That's very neat! A good simple alternative to dealing with sdram (if your situation suits the constraints). Nice one!

Post Reply