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


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?



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 and you may have a look at the thread ‘ESP32-WROOVER-KIT as a lisp machine’ (

HTH, best regards,