Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split m5atom_s3r into m5atom_s3r_cam and m5atom_s3r_m12. #1456

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions build/devices/esp32/targets/m5atom_s3r_m12/host/provider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Copyright (c) 2021-2024 Moddable Tech, Inc.
*
* This file is part of the Moddable SDK Runtime.
*
* The Moddable SDK Runtime is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Moddable SDK Runtime is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with the Moddable SDK Runtime. If not, see <http://www.gnu.org/licenses/>.
*
*/

import Analog from "embedded:io/analog";
import Digital from "embedded:io/digital";
import DigitalBank from "embedded:io/digitalbank";
import I2C from "embedded:io/i2c";
import PulseCount from "embedded:io/pulsecount";
import PWM from "embedded:io/pwm";
import Serial from "embedded:io/serial";
import SMBus from "embedded:io/smbus";
import SPI from "embedded:io/spi";
import PulseWidth from "embedded:io/pulsewidth";

const device = {
I2C: {
default: {
io: I2C,
data: 45,
clock: 0,
},
internal: {
io: I2C,
data: 45,
clock: 0,
}
},
Serial: {
default: {
io: Serial,
port: 1,
receive: 44,
transmit: 43
}
},
SPI: {
default: {
io: SPI,
clock: 36,
in: 37,
out: 35,
port: 2
}
},
io: {Analog, Digital, DigitalBank, I2C, PulseCount, PulseWidth, PWM, Serial, SMBus, SPI},
pin: {
//@@ button
button: 0
}
};

export default device;
63 changes: 63 additions & 0 deletions build/devices/esp32/targets/m5atom_s3r_m12/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"build": {
"SDKCONFIGPATH": "./sdkconfig",
"PARTITIONS_FILE_FOR_TARGET": "./sdkconfig/partitions.csv",
"ESP32_SUBCLASS": "esp32s3",
"USE_USB": "2"
},
"include": [
"$(MODDABLE)/modules/io/manifest.json",
"$(MODULES)/drivers/button/manifest.json"
],
"modules": {
"setup/target": "./setup-target"
},
"preload": [
"setup/target"
],
"config": {
"Screen": "",
"button_pin": 41,
"power_pin": 18,
"ir_pin": 47
},
"creation": {
"static": 0,
"chunk": {
"initial": 78848,
"incremental": 0
},
"heap": {
"initial": 4928,
"incremental": 0
},
"stack": 512
},
"defines": {
"i2c": {
"sda_pin": 45,
"scl_pin": 0
},
"camera": {
"powerdown": -1,
"reset": -1,
"xclk": 21,
"xclk_freq_hz": 20000000,
"pclk": 40,
"href": 14,
"vsync": 10,
"scl": 9,
"sda": 12,
"i2c_port": 1,
"d0": 3,
"d1": 42,
"d2": 46,
"d3": 48,
"d4": 4,
"d5": 17,
"d6": 11,
"d7": 13
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright (c) 2016-2023 Moddable Tech, Inc.
#
# This file is part of the Moddable SDK Tools.
#
# The Moddable SDK Tools is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The Moddable SDK Tools is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the Moddable SDK Tools. If not, see <http://www.gnu.org/licenses/>.
#

# Name, Type, SubType, Offset, Size, Flags
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild,,,,
nvs, data, nvs, 0x9000, 0x006000,
phy_init, data, phy, 0xf000, 0x001000,
factory, app, factory, 0x10000, 0x7F0000,
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Serial flasher config
#
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n
CONFIG_ESPTOOLPY_FLASHSIZE="8MB"

# for ESP32-S3 module N8R8
CONFIG_SPIRAM=y
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_MODE_QUAD=n
CONFIG_SPIRAM_SPEED_80M=n
CONFIG_SPIRAM_SPEED_40M=y
CONFIG_SPIRAM_BOOT_INIT=y
CONFIG_SPIRAM_IGNORE_NOTFOUND=n
CONFIG_SPIRAM_TYPE_AUTO=y
# CONFIG_SPIRAM_USE_CAPS_ALLOC=y

# for ESP32-S3 module P2N8
# CONFIG_SPIRAM_MODE_OCT=n
# CONFIG_SPIRAM_MODE_QUAD=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Automatically generated file; DO NOT EDIT.
# Espressif IoT Development Framework Configuration
#

# CONFIG_ESP_DEBUG_STUBS_ENABLE=n
CONFIG_ESP_TASK_WDT_EN=n
CONFIG_ESP_TASK_WDT_INIT=y
CONFIG_ESP_TASK_WDT_PANIC=y
CONFIG_ESP_TASK_WDT_TIMEOUT_S=5
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=n
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=n

# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT=y
# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=n
# CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=n
# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB=n

CONFIG_ESP_CONSOLE_UART_DEFAULT=y
CONFIG_ESP_CONSOLE_UART_CUSTOM=n
CONFIG_ESP_CONSOLE_NONE=n
CONFIG_ESP_CONSOLE_UART_NUM=0
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
##### TEST INSTRUMENTATION
#
# ESP32-specific
#
CONFIG_ESP_COREDUMP_ENABLE_TO_UART=y

#
# ESP32-specific
#
CONFIG_ESP_CONSOLE_UART_DEFAULT=y
CONFIG_ESP_CONSOLE_UART_CUSTOM=n
CONFIG_ESP_CONSOLE_NONE=n
CONFIG_ESP_CONSOLE_UART_NUM=0


#
# Log output
#
CONFIG_LOG_DEFAULT_LEVEL_NONE=n
CONFIG_LOG_DEFAULT_LEVEL_ERROR=n
CONFIG_LOG_DEFAULT_LEVEL_WARN=y
CONFIG_LOG_DEFAULT_LEVEL_INFO=n
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=n
CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=n
CONFIG_LOG_DEFAULT_LEVEL=2

CONFIG_ESP_DEBUG_STUBS_ENABLE=y
CONFIG_ESP_SYSTEM_PANIC_GDBSTUB=y

CONFIG_ESP_TASK_WDT_EN=y
28 changes: 28 additions & 0 deletions build/devices/esp32/targets/m5atom_s3r_m12/setup-target.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import config from "mc/config";
import Timer from "timer";
import Button from "button";
import Digital from "pins/digital";

class Flash {
constructor(options) {
return new Button({
...options,
pin: 41,
invert: true
});
}
}

globalThis.Host = Object.freeze({
Button: {
Default: Flash,
Flash
}
}, true);

export default function (done) {
Digital.write(config.power_pin, 0);
Timer.delay(500);

done?.();
}
Binary file added documentation/assets/devices/m5atom_s3r_cam.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/assets/m5atom_s3r_cam.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion documentation/devices/esp32.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ The Moddable SDK supports devices built on ESP32-S3. The following table lists e
| Name | Platform identifier | Key features | Links |
| :---: | :--- | :--- | :--- |
| <img src="../assets/devices/lilygo_t_camera_plus_s3.jpg" width=140></a><BR>Lilygo T Camera Plus S3 | `esp32/lilygo_t_camera_plus_s3` | OV2640 Camera<br>1.3" IPS display<br>240 x 240 Touchscreen<br>Microphone<br>Speaker<br> | <li>[Product info](https://www.lilygo.cc/products/t-camera-plus-s3)</li> |
| <img src="../assets/devices/m5atom_s3r.jpg" width=140></a><BR>M5 Atom S3R M12 | `esp32/m5atom_s3r` | OV3660 Camera<br>Microphone<br>BMI270 IMU<Br>8MB PSRAM| <li>[Product info](https://shop.m5stack.com/products/atoms3r-camera-kit-m12-version-ov3660)</li> |
| <img src="../assets/devices/m5atom_s3r_cam.png" width=140></a><BR>M5 Atom S3R Camera | `esp32/m5atom_s3r_cam` | GC0308 Camera<br>BMI270 IMU<Br>8MB PSRAM| <li>[Product info](https://shop.m5stack.com/products/atoms3r-camera-kit)</li> |
| <img src="../assets/devices/m5atom_s3r_m12.jpg" width=140></a><BR>M5 ATOMS3R Camera Kit M12 Version | `esp32/m5atom_s3r_m12` | OV3660 Camera<br>BMI270 IMU<Br>8MB PSRAM| <li>[Product info](https://shop.m5stack.com/products/atoms3r-camera-kit-m12-version-ov3660)</li> |
| <img src="../assets/devices/m5stack_cores3.jpg" width=140></a><BR>M5Stack Core S3 | `esp32/m5stack_cores3` | GC0308 Camera<br>Microphone<br>Speaker<br>ili9341 QVGA Touchscreen<BR>320 x 240<BR>BMI270 IMU<Br>BM8563 RTC<BR>8MB PSRAM | <li>[Product info](https://shop.m5stack.com/products/m5stack-cores3-esp32s3-lotdevelopment-kit)</li> |
| <img src="../assets/devices/xiao_esp32s3_sense.jpg" width=140></a><BR>Seed Studio<br>XIAO ESP32S3 Sense | `esp32/xiao_esp32s3_sense` | OV2640 Camera<br>Microphone<br>8MB PSRAM | <li>[Getting Started](https://wiki.seeedstudio.com/xiao_esp32s3_getting_started/)</li><li>[Display Wiring Guide](../displays/images/xiao-qtpy-ili9341-wiring.png)</li> |

Expand Down