cp-mega88 icon indicating copy to clipboard operation
cp-mega88 copied to clipboard

Feature request: support for ESP32 platform

Open wyan opened this issue 5 years ago • 3 comments

I was wondering if this would build for the ESP32 platform. Since it already has support for several other platforms, I'd hope it's not too difficult to add support.

wyan avatar Jun 19 '19 21:06 wyan

I'm going to give this a go. My plan is as follows:

  • I'll start by adding the esp32 target in Makefile and creating a makefiles/Makefile.esp32 taking makefiles/Makefile.atmega88 as the starting point

  • Then using *_avr* files to create the necessary platform specific *_esp32* files

  • Cross fingers :)

If you have any tips / caveats, they'll be most welcome :)

wyan avatar Jun 20 '19 10:06 wyan

Hi, I just notice your filed request now. I think it should not be so difficult as esp32 is much richer than AVR.

CAVEAT: I haven't used esp32 until today, and I'm just saying this based on my first impression on the device. So, it may be wrong.

What you will need:

  • con_esp32 : for serial terminal. I guess esp32 can have a virtual serial port over the USB connection with the host?
  • cpu_8080 : you can reuse the C version of 8080 CPU emulation code, and it would work fast enough, or it may be too fast :)
  • eeprom_esp32 : for persistent small storage to store configurations. If esp32 does not have such a thing, just using uint8_t[512] works though it can not be persistent
  • io_base : you can reuse it unless you want to connect it to other devices over the IOEXT protocol that is defined for this project (ioext/ioext_test.ino explains what's this)
  • led_esp32 : for indicating machine state. can use led_base for the initial implementation
  • platform_esp32 : define the entry function such as main() that calls machine_boot(), and define platform_reset() that is called on reset. or platform_posix may work as is.
  • sdcartd_esp32 : this should be the most difficult part unless esp32 has an internal storage that can contains disk image. if you need to implement this, sdcard_avr will be a good example to access SD card over GPIO. If esp32's SDK provides something to access SD card, you would be able to use it, and it will be easy if possible.
  • sram_base: you can reuse it unless the device does not have enough main memory, less than 64KB.

toyoshim avatar Jul 06 '19 17:07 toyoshim

Thanks for your tips, I haven't yet done much work on it and I'm still figuring out the ESP32 environment, as their dev tools assume a bit of a peculiar setup.

wyan avatar Aug 07 '19 10:08 wyan