Adding QSPI ram to a Teensy 4.1 and uLisp Memory usage questions


#1

Just curious if anyone has soldered some more RAM onto a Teensy 4.1 and used uLisp? You can add up to 2 8MB QSPI chips and the new ram can be accessed with EXTMEM and a variant of malloc. Could the Workspace and/or MyCode arrays be placed in external RAM?. How many objects/cells would 8 or 16Mb support??

I see that for a Teensy, Workspace is defined as DMAMEM and placed in the second half of RAM while MyCode is FASTRUN, placed at the beginning of the Teensy’s ‘tightly coupled’ first half MB of RAM.

I imagine MyCode is used to store user defined functions and Workspace is available for code execution; do I have that right?


#2

Hi,

I’m not sure about the Teensy, but I did something similar with the ESP32-WROOM which has 4MB external Ram (called PSRAM). IIRC, each cons cell needs 8 Bytes of RAM, so I had about 256.000 cells on the ESP32.
There were some miner problems with the gc and with uLisp’s myalloc and myfree functions (some speedups where necessary), but in general it worked fine.
You’ll find my code at https://github.com/kaef and you may have a look at the thread ‘ESP32-WROOVER-KIT as a lisp machine’ (http://forum.ulisp.com/t/esp32-wrover-kit-as-a-lisp-machine/339.

HTH, best regards,
Kaef