uLisp for M5Stack Cardputer possible? And how keep original firmware?


#1

It is an esp32 with screen and keyboard. I hope it is possible.

For the T-Keyboard (T-DECK) I am still waiting for the grove cable for firmware download, as it seems you need to use the serial port (not the USB-C) to download the firmware.

For both I wonder how to keep the original “firmware” as my T-DECK has LoRa and cardputer also have a lot of features.


Can some of M5stick especially the Cardputer be supported?
#2

For those who don’t know it, the M5Stack Cardputer is a 56-key keyboard and 1.14" TFT screen with a resolution of 240 x 135 pixels that includes a M5StampS3 module, containing an ESP32-S3:

For more information see: M5Stack Cardputer Kit with M5StampS3,

The screen seems a bit small for programming in Lisp; with a 5x7 bitmap font it will provide 16 lines of 40 characters. However, it should be possible to port the ESP32 version of uLisp to it. However, note my reservation about the ESP32-S3 built-in USB interface, as yet unfixed:

I don’t currently recommend ESP32-S2, ESP32-C3, or ESP32-S3 boards that use the built-in USB interface (USB CDC) because of a problem that causes them to hang up if you upload a long Lisp program (at least on MacOS).

As far as keeping the original firmware is concerned, I assume you mean being able to access the firmware functions, such as LoRa on the T-Deck, from uLisp? To do this you would need to implement a uLisp extension file containing uLisp functions that implement the firmware features, which would require C programming.


#3

I have an M5Stack Cardputer in my handle for months (be side my hand made Lisp Badge LE, thanks David:), I also would like to see someone can run uLisp on it with full screen/keyboard support, then I can follow:).

I tried once to rebuild the firmware of Cardputer from it’s opensource repo, the ESP32 tools chain looks like very mature and easy to use, I hope I can compile/flash uLisp with this tools chain instead of Arduino IDE which can only compile a single file.


#4

I got my hands on one of these and ported uLisp to it. It was much easier to do than the t-deck because it has nice arduino libraries. The screen is quite crisp but I’m not sure how big to make the font. Enjoy!


#5

Good job!

Can you please share some photos of the chars/code on the screen? I tried once to build firmware for it with official ESP SDK, and that’s my preferred way compare to Arduino IDE.


#6

My phone camera isn’t good but here you go. I recommend you build it with Arduino at first to make sure you have everything set up then try it the other way.


#7

I just added SD card support if anyone wants to test it out. It was very straightforward


#8

That’s awesome, exactly what I was looking for. Have to try it out ASAP.

  • Did you have the time to run benchmarks? Can you confirm the 9216 Object limit?
  • Any plans to make it available in the m5burner? As described here. Or could you upload the .bin file to the github repo?
  • by SD-Card support, you mean that the with-sd-card primitive is available? How does the error recovery work, if the file is not present/readable? Is it just nil?

But yeah, thank you very much. Looking forward how this project develops. Looks really promising.


#9
  • I didn’t run benchmarks, nor did I pay much attention to the object limit.
  • If @johnsondavies will put it into the official release then I think we can put it into the m5 ecosystem as well
  • yes the with-sd-card primitive. It should fail the same way as it would in any other version of ulisp, I don’t remember how off the top of my head.

It’s quite easy to set up using the Arduino IDE if you follow the instructions in the repo (compared to the t-deck for example), so don’t be afraid to try it and report issues or request features


#10

Good to see this work. I’ve ordered an M5Stack Cardputer so I can test it out, and will then add it to the official release.


#11

I’ve now released firmware for a Cardputer uLisp Machine based on uLisp 4.7; see:

Cardputer uLisp Machine

This is based on the work of @hasn0life, with the following additional features:

  • The Tab key echoes the last line you typed in, so you can edit it.

  • The sound is better, and the scale and beep examples work correctly, although I haven’t managed to get rid of some clicks.

  • Parenthesis highlighting now works correctly with parentheses in strings.

  • To escape from a running program you can press the G0 button to the right of the On/Off switch on the back panel.

  • Scrolling works efficiently.