Skip to content

Commit

Permalink
build: add CoCo esp32s3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzwald committed Sep 16, 2024
1 parent fd750ff commit 6307453
Show file tree
Hide file tree
Showing 14 changed files with 4,974 additions and 52 deletions.
15 changes: 7 additions & 8 deletions boards/esp32-s3-wroom-1-n16r8.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"partitions": "default_16MB.csv",
"memory_type": "qio_opi"
"ldscript": "esp32s3_out.ld"
},
"core": "esp32",
"extra_flags": [
Expand All @@ -14,16 +12,17 @@
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32s3"
},
"mcu": "esp32s3",
"variant": "esp32s3",
"partitions": "fujinet_partitions_16MB.csv"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "ESP32-S3-WROOM-1 N16R8",
Expand All @@ -36,6 +35,6 @@
"require_upload_port": true,
"speed": 460800
},
"url": "https://www.wemos.cc/en/latest/s3/index.html",
"vendor": "EspressIf"
"url": "https://github.com/FujiNetWIFI/fujinet-firmware",
"vendor": "FujiNet Project"
}
41 changes: 41 additions & 0 deletions boards/esp32-s3-wroom-1-n8r8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld"
},
"core": "esp32",
"extra_flags": [
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_MODE=1",
"-DARDUINO_USB_CDC_ON_BOOT=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"mcu": "esp32s3",
"variant": "esp32s3",
"partitions": "fujinet_partitions_8MB.csv"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "ESP32-S3-WROOM-1 N8R8",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 8388608,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 460800
},
"url": "https://github.com/FujiNetWIFI/fujinet-firmware",
"vendor": "FujiNet Project"
}
18 changes: 18 additions & 0 deletions build-platforms/platformio-fujinet-coco-esp32-s3-wroom-1-n16r8.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[fujinet]
build_platform = BUILD_COCO
build_bus = DRIVEWIRE
build_board = fujinet-coco-esp32-s3-wroom-1-n16r8

[env]
upload_port = /dev/ttyACM0
monitor_port = /dev/ttyACM0
monitor_speed = 115200

[env:fujinet-coco-esp32-s3-wroom-1-n16r8]
platform = espressif32@${fujinet.esp32_platform_version}
platform_packages = ${fujinet.esp32_platform_packages}
board = esp32-s3-wroom-1-n16r8
build_type = debug
build_flags =
${env.build_flags}
-D PINMAP_COCO_ESP32S3
18 changes: 18 additions & 0 deletions build-platforms/platformio-fujinet-coco-esp32-s3-wroom-1-n8r8.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[fujinet]
build_platform = BUILD_COCO
build_bus = DRIVEWIRE
build_board = fujinet-coco-esp32-s3-wroom-1-n8r8

[env]
upload_port = /dev/ttyACM0
monitor_port = /dev/ttyACM0
monitor_speed = 115200

[env:fujinet-coco-esp32-s3-wroom-1-n8r8]
platform = espressif32@${fujinet.esp32_platform_version}
platform_packages = ${fujinet.esp32_platform_packages}
board = esp32-s3-wroom-1-n8r8
build_type = debug
build_flags =
${env.build_flags}
-D PINMAP_COCO_ESP32S3
23 changes: 23 additions & 0 deletions data/webui/config/fujinet-coco-esp32-s3-wroom-1-n16r8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
paths:
# fonts in the root dir because of file name length issues
font_path: /file?
css_path: /file?css
js_path: /file?js
components:
network: true
hardware: true
hosts_list: true
mount_list: true
printer_settings: true
modem_settings: true
hsio_settings: true
timezone: true
udp_stream: true
program_recorder: true
disk_swap: true
boot_settings: true
apetime: true
cpm_settings: true
pclink: true
tweaks:
# webui tweaks, if any
23 changes: 23 additions & 0 deletions data/webui/config/fujinet-coco-esp32-s3-wroom-1-n8r8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
paths:
# fonts in the root dir because of file name length issues
font_path: /file?
css_path: /file?css
js_path: /file?js
components:
network: true
hardware: true
hosts_list: true
mount_list: true
printer_settings: true
modem_settings: true
hsio_settings: true
timezone: true
udp_stream: true
program_recorder: true
disk_swap: true
boot_settings: true
apetime: true
cpm_settings: true
pclink: true
tweaks:
# webui tweaks, if any
2 changes: 1 addition & 1 deletion include/pinmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "pinmap/iec-d32pro.h"
#include "pinmap/coco_devkitc.h"
#include "pinmap/coco_cart.h"
#include "pinmap/coco_s3.h"
#include "pinmap/coco_esp32s3.h"
#include "pinmap/foenix_os9_d32pro.h"
#include "pinmap/iec-nugget.h"
#include "pinmap/fujiloaf-rev0.h"
Expand Down
42 changes: 42 additions & 0 deletions include/pinmap/coco_esp32s3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#ifdef PINMAP_COCO_ESP32S3

/* SD Card */
#define PIN_CARD_DETECT GPIO_NUM_14 // fnSystem.h
#define PIN_CARD_DETECT_FIX GPIO_NUM_9 // fnSystem.h

#define PIN_SD_HOST_CS GPIO_NUM_10 // fnFsSD.cpp
#define PIN_SD_HOST_MISO GPIO_NUM_13
#define PIN_SD_HOST_MOSI GPIO_NUM_11
#define PIN_SD_HOST_SCK GPIO_NUM_12

/* UART */
#define PIN_UART0_RX GPIO_NUM_44 // fnUART.cpp
#define PIN_UART0_TX GPIO_NUM_43
#define PIN_UART1_RX GPIO_NUM_NC
#define PIN_UART1_TX GPIO_NUM_NC
#define PIN_UART2_RX GPIO_NUM_18
#define PIN_UART2_TX GPIO_NUM_17

/* Buttons */
#define PIN_BUTTON_A GPIO_NUM_0
#define PIN_BUTTON_B GPIO_NUM_NC
#define PIN_BUTTON_C GPIO_NUM_NC

/* LEDs */
#define PIN_LED_WIFI GPIO_NUM_NC // led.cpp
#define PIN_LED_BUS GPIO_NUM_NC
#define PIN_LED_BT GPIO_NUM_NC

/* Coco */
#define PIN_CASS_MOTOR GPIO_NUM_NC // Second motor pin is tied to +3V
#define PIN_CASS_DATA_IN GPIO_NUM_NC
#define PIN_CASS_DATA_OUT GPIO_NUM_NC
#define PIN_CD GPIO_NUM_NC // same as atari PROC
#define PIN_EPROM_A14 GPIO_NUM_NC // Used to set the serial baud rate
#define PIN_EPROM_A15 GPIO_NUM_NC // based on the HDB-DOS image selected

/* Audio Output */
#define PIN_DAC1 GPIO_NUM_NC

#endif /* PINMAP_COCO_ESP32S3 */

40 changes: 0 additions & 40 deletions include/pinmap/coco_s3.h

This file was deleted.

5 changes: 5 additions & 0 deletions lib/bus/drivewire/drivewire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,10 @@ void systemBus::setup()
// xTaskCreate(drivewire_intr_task, "drivewire_intr_task", 2048, NULL, 10, NULL);
// xTaskCreatePinnedToCore(drivewire_intr_task, "drivewire_intr_task", 4096, this, 10, NULL, 0);

#ifdef CONFIG_IDF_TARGET_ESP32S3
// Configure UART to RP2040
_drivewireBaud = 115200;
#else
// Setup interrupt for cassette motor pin
gpio_config_t io_conf = {
.pin_bit_mask = (1ULL << PIN_CASS_MOTOR), // bit mask of the pins that you want to set
Expand Down Expand Up @@ -1054,6 +1058,7 @@ void systemBus::setup()
}

#endif /* FORCE_UART_BAUD */
#endif /* CONFIG_IDF_TARGET_ESP32S3 */
#else
// FujiNet-PC specific
fnDwCom.set_serial_port(Config.get_serial_port().c_str()); // UART
Expand Down
2 changes: 2 additions & 0 deletions lib/device/drivewire/cassette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
#include <cstring>

#ifdef ESP_PLATFORM
#ifndef CONFIG_IDF_TARGET_ESP32S3
#include <driver/dac.h>
#endif
#endif

#include "../../include/debug.h"

Expand Down
31 changes: 28 additions & 3 deletions platformio-sample.ini
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ flash_filesystem = FLASH_LITTLEFS

;build_platform = BUILD_COCO
;build_bus = DRIVEWIRE
;build_board = fujinet-coco-devkitc ; Color Computer Drivewire using ESP32-DEVKITC-VE
;build_board = fujinet-coco-lolin-d32-dw ; Color Computer Drivewire using Lolin D32 Pro
;build_board = fujinet-foenix-lolin-d32-dw ; Foenix 256jr and 256k with OS-9
;build_board = fujinet-coco-devkitc ; Color Computer Drivewire using ESP32-DEVKITC-VE
;build_board = fujinet-coco-lolin-d32-dw ; Color Computer Drivewire using Lolin D32 Pro
;build_board = fujinet-coco-esp32-s3-wroom-1-n16r8 ; CoCo Becker Port Drivewire (ESP32S3 WROOM 16MB Flash, 8MB PSRAM)
;build_board = fujinet-coco-esp32-s3-wroom-1-n8r8 ; CoCo Becker Port Drivewire (ESP32S3 WROOM 8MB Flash, 8MB PSRAM)
;build_board = fujinet-foenix-lolin-d32-dw ; Foenix 256jr and 256k with OS-9


[platformio]
Expand All @@ -109,10 +111,13 @@ lib_ldf_mode = deep+
upload_speed = 460800 ;921600
;upload_port = COM1 ; Windows
upload_port = /dev/ttyUSB0 ; Linux/WSL
;upload_port = /dev/ttyACM0 ; Linux esp32s3
;upload_port = /dev/tty.SLAB_USBtoUART ; Mac
monitor_speed = 460800 ;921600
;monitor_speed = 115200 ; esp32s3
;monitor_port = COM1 ; Windows
monitor_port = /dev/ttyUSB0 ; Linux/WSL
;monitor_port = /dev/ttyACM0 ; Linux esp32s3
;monitor_port = /dev/tty.SLAB_USBtoUART ; Mac
monitor_filters = esp32_exception_decoder, time ;,log2file
check_skip_packages = yes ; so that check will work.
Expand Down Expand Up @@ -325,6 +330,26 @@ build_flags =
-D FORCE_UART_BAUD=1000000
-D NO_BUTTONS

; Color Computer Becker Port Drivewire (ESP32S3 WROOM 16MB Flash, 8MB PSRAM)
[env:fujinet-coco-esp32-s3-wroom-1-n16r8]
platform = espressif32@${fujinet.esp32_platform_version}
platform_packages = ${fujinet.esp32_platform_packages}
board = esp32-s3-wroom-1-n16r8
build_type = debug
build_flags =
${env.build_flags}
-D PINMAP_COCO_ESP32S3

; Color Computer Becker Port Drivewire (ESP32S3 WROOM 8MB Flash, 8MB PSRAM)
[env:fujinet-coco-esp32-s3-wroom-1-n8r8]
platform = espressif32@${fujinet.esp32_platform_version}
platform_packages = ${fujinet.esp32_platform_packages}
board = esp32-s3-wroom-1-n8r8
build_type = debug
build_flags =
${env.build_flags}
-D PINMAP_COCO_ESP32S3

; FujiNet RS232 Rev 0 Prototype (ESP32-DEVKITC-VE 8MB Flash, 8MB PSRAM)
[env:fujinet-rs232-rev0]
platform = espressif32@${fujinet.esp32_platform_version}
Expand Down
Loading

0 comments on commit 6307453

Please sign in to comment.