boards: m5stack_atoms3_lite: add support for M5Stack AtomS3 Lite
Add support for M5Stack AtomS3 Lite development board. The AtomS3 Lite is a smaller version of the AtomS3 that features only a StatusLED and no LCD display. Signed-off-by: Martin Kiepfer <mrmarteng@teleschirm.org>
This commit is contained in:
parent
a21076bbf3
commit
38ed830f91
12 changed files with 465 additions and 0 deletions
12
boards/xtensa/m5stack_atoms3_lite/Kconfig.board
Normal file
12
boards/xtensa/m5stack_atoms3_lite/Kconfig.board
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# M5Stack AtomS3 Lite board configuration
|
||||
# Copyright (c) 2023 Martin Kiepfer <mrmarteng@teleschirm.org>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# M5Stack AtomS3 Lite
|
||||
config BOARD_M5STACK_ATOMS3_LITE
|
||||
bool "M5Stack AtomS3 Lite Development Board"
|
||||
depends on SOC_SERIES_ESP32S3
|
||||
|
||||
choice SOC_PART_NUMBER
|
||||
default SOC_ESP32S3_FN8
|
||||
endchoice
|
||||
26
boards/xtensa/m5stack_atoms3_lite/Kconfig.defconfig
Normal file
26
boards/xtensa/m5stack_atoms3_lite/Kconfig.defconfig
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# M5Stack AtomS3 Lite board configuration
|
||||
# Copyright (c) 2023 Martin Kiepfer <mrmarteng@teleschirm.org>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if BOARD_M5STACK_ATOMS3_LITE
|
||||
|
||||
config BOARD
|
||||
default "m5stack_atoms3_lite"
|
||||
depends on BOARD_M5STACK_ATOMS3_LITE
|
||||
|
||||
config ENTROPY_GENERATOR
|
||||
default y
|
||||
|
||||
config HEAP_MEM_POOL_ADD_SIZE_BOARD
|
||||
int
|
||||
default 98304 if WIFI
|
||||
default 65536 if BT
|
||||
default 4096
|
||||
|
||||
config KERNEL_MEM_POOL
|
||||
default y
|
||||
|
||||
choice BT_HCI_BUS_TYPE
|
||||
default BT_ESP32 if BT
|
||||
endchoice
|
||||
endif # BOARD_M5STACK_ATOMS3_LITE
|
||||
10
boards/xtensa/m5stack_atoms3_lite/Kconfig.sysbuild
Normal file
10
boards/xtensa/m5stack_atoms3_lite/Kconfig.sysbuild
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
choice BOOTLOADER
|
||||
default BOOTLOADER_MCUBOOT
|
||||
endchoice
|
||||
|
||||
choice BOOT_SIGNATURE_TYPE
|
||||
default BOOT_SIGNATURE_TYPE_NONE
|
||||
endchoice
|
||||
9
boards/xtensa/m5stack_atoms3_lite/board.cmake
Normal file
9
boards/xtensa/m5stack_atoms3_lite/board.cmake
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*")
|
||||
set(OPENOCD OPENOCD-NOTFOUND)
|
||||
endif()
|
||||
find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH)
|
||||
|
||||
include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
134
boards/xtensa/m5stack_atoms3_lite/doc/index.rst
Normal file
134
boards/xtensa/m5stack_atoms3_lite/doc/index.rst
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
.. _m5stack_atoms3_lite:
|
||||
|
||||
M5Stack AtomS3 Lite
|
||||
###################
|
||||
|
||||
Overview
|
||||
********
|
||||
|
||||
M5Stack AtomS3 Lite is an ESP32-based development board from M5Stack.
|
||||
|
||||
It features the following integrated components:
|
||||
|
||||
- ESP32-S3FN8 chip (240MHz dual core, Wi-Fi/BLE 5.0)
|
||||
- 512KB of SRAM
|
||||
- 384KB of ROM
|
||||
- 8MB of Flash
|
||||
- RGB Status-LED
|
||||
|
||||
|
||||
.. figure:: img/m5stack_atoms3_lite.webp
|
||||
:align: center
|
||||
:alt: M5Stack AtomS3 Lite
|
||||
|
||||
M5Stack AtomS3 Lite
|
||||
|
||||
|
||||
Supported Features
|
||||
==================
|
||||
|
||||
The Zephyr m5stack_atoms3_lite board configuration supports the following hardware features:
|
||||
|
||||
+-----------+------------+-------------------------------------+
|
||||
| Interface | Controller | Driver/Component |
|
||||
+===========+============+=====================================+
|
||||
| NVIC | on-chip | nested vector interrupt controller |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| UART | on-chip | serial port-polling; |
|
||||
| | | serial port-interrupt |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| PINMUX | on-chip | pinmux |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| GPIO | on-chip | gpio |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| I2C | on-chip | i2c |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| SPI | on-chip | spi |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| CLOCK | on-chip | reset and clock control |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| COUNTER | on-chip | rtc |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| WATCHDOG | on-chip | independent watchdog |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| PWM | on-chip | pwm |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| ADC | on-chip | adc |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| DAC | on-chip | dac |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| die-temp | on-chip | die temperature sensor |
|
||||
+-----------+------------+-------------------------------------+
|
||||
|
||||
|
||||
Start Application Development
|
||||
*****************************
|
||||
|
||||
Before powering up your M5Stack AtomS3 Lite, please make sure that the board is in good
|
||||
condition with no obvious signs of damage.
|
||||
|
||||
System requirements
|
||||
===================
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command
|
||||
below to retrieve those files.
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
west blobs fetch hal_espressif
|
||||
|
||||
.. note::
|
||||
|
||||
It is recommended running the command above after :file:`west update`.
|
||||
|
||||
Building & Flashing
|
||||
-------------------
|
||||
|
||||
Build and flash applications as usual (see :ref:`build_an_application` and
|
||||
:ref:`application_run` for more details).
|
||||
|
||||
.. zephyr-app-commands::
|
||||
:zephyr-app: samples/hello_world
|
||||
:board: m5stack_atoms3_lite
|
||||
:goals: build
|
||||
|
||||
The usual ``flash`` target will work with the ``m5stack_atoms3_lite`` board
|
||||
configuration. Here is an example for the :ref:`hello_world`
|
||||
application.
|
||||
|
||||
.. zephyr-app-commands::
|
||||
:zephyr-app: samples/hello_world
|
||||
:board: m5stack_atoms3_lite
|
||||
:goals: flash
|
||||
|
||||
The baud rate of 921600bps is set by default. If experiencing issues when flashing,
|
||||
try using different values by using ``--esp-baud-rate <BAUD>`` option during
|
||||
``west flash`` (e.g. ``west flash --esp-baud-rate 115200``).
|
||||
|
||||
You can also open the serial monitor using the following command:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
west espressif monitor
|
||||
|
||||
After the board has automatically reset and booted, you should see the following
|
||||
message in the monitor:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx *****
|
||||
Hello World! m5stack_atoms3_lite
|
||||
|
||||
Debugging
|
||||
---------
|
||||
|
||||
M5Stack AtomS3 Lite debugging is not supported due to pinout limitations.
|
||||
|
||||
Related Documents
|
||||
*****************
|
||||
|
||||
- `M5Stack AtomS3 Lite schematic <https://static-cdn.m5stack.com/resource/docs/products/core/AtomS3%20Lite/img-4061fdd4-6954-4709-a7e7-b0f50e5ba52e.webp>`_
|
||||
- `ESP32S3 Datasheet <https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf>`_
|
||||
18
boards/xtensa/m5stack_atoms3_lite/grove_connectors.dtsi
Normal file
18
boards/xtensa/m5stack_atoms3_lite/grove_connectors.dtsi
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Benjamin Cabé <benjamin@zephyrproject.org>
|
||||
* Copyright (c) 2023 Martin Kiepfer <mrmarteng@teleschirm.org>
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/ {
|
||||
grove_header: grove_header {
|
||||
compatible = "grove-header";
|
||||
#gpio-cells = <2>;
|
||||
gpio-map-mask = <0xffffffff 0xffffffc0>;
|
||||
gpio-map-pass-thru = <0 0x3f>;
|
||||
gpio-map = <0 0 &gpio0 1 0>,
|
||||
<1 0 &gpio0 2 0>;
|
||||
};
|
||||
};
|
||||
|
||||
grove_i2c1: &i2c1 {};
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Benjamin Cabé <benjamin@zephyrproject.org>
|
||||
* Copyright (c) 2023 Martin Kiepfer <mrmarteng@teleschirm.org>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include <zephyr/dt-bindings/pinctrl/esp-pinctrl-common.h>
|
||||
#include <dt-bindings/pinctrl/esp32s3-pinctrl.h>
|
||||
#include <zephyr/dt-bindings/pinctrl/esp32s3-gpio-sigmap.h>
|
||||
|
||||
&pinctrl {
|
||||
uart0_default: uart0_default {
|
||||
group1 {
|
||||
pinmux = <UART0_TX_GPIO43>;
|
||||
output-high;
|
||||
};
|
||||
group2 {
|
||||
pinmux = <UART0_RX_GPIO44>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
i2c0_default: i2c0_default {
|
||||
group1 {
|
||||
pinmux = <I2C0_SDA_GPIO38>,
|
||||
<I2C0_SCL_GPIO39>;
|
||||
bias-pull-up;
|
||||
drive-open-drain;
|
||||
output-high;
|
||||
};
|
||||
};
|
||||
|
||||
i2c1_default: i2c1_default {
|
||||
group1 {
|
||||
pinmux = <I2C1_SDA_GPIO2>,
|
||||
<I2C1_SCL_GPIO1>;
|
||||
bias-pull-up;
|
||||
drive-open-drain;
|
||||
output-high;
|
||||
};
|
||||
};
|
||||
|
||||
spim3_ws2812_led: spim3_ws2812_led {
|
||||
group1 {
|
||||
pinmux = <SPIM3_MOSI_GPIO35>;
|
||||
output-low;
|
||||
};
|
||||
};
|
||||
};
|
||||
155
boards/xtensa/m5stack_atoms3_lite/m5stack_atoms3_lite.dts
Normal file
155
boards/xtensa/m5stack_atoms3_lite/m5stack_atoms3_lite.dts
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* Copyright (c) 2023 Benjamin Cabé <benjamin@zephyrproject.org>
|
||||
* Copyright (c) 2023 Martin Kiepfer <mrmarteng@teleschirm.org>
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include <espressif/esp32s3/esp32s3_fn8.dtsi>
|
||||
#include "m5stack_atoms3_lite-pinctrl.dtsi"
|
||||
#include <dt-bindings/led/led.h>
|
||||
#include <dt-bindings/led/worldsemi_ws2812c.h>
|
||||
#include <zephyr/dt-bindings/input/input-event-codes.h>
|
||||
|
||||
/ {
|
||||
model = "M5Stack AtomS3 Lite";
|
||||
compatible = "m5stack,atoms3_lite";
|
||||
|
||||
chosen {
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,console = &usb_serial;
|
||||
zephyr,shell-uart = &usb_serial;
|
||||
zephyr,flash = &flash0;
|
||||
zephyr,code-partition = &slot0_partition;
|
||||
};
|
||||
|
||||
aliases {
|
||||
sw0 = &user_button_0;
|
||||
watchdog0 = &wdt0;
|
||||
i2c-0 = &i2c0;
|
||||
led-strip = &status_rgb_led;
|
||||
};
|
||||
|
||||
buttons {
|
||||
compatible = "gpio-keys";
|
||||
debounce-interval-ms = <100>;
|
||||
user_button_0: button_0 {
|
||||
label = "User button 0";
|
||||
gpios = <&gpio1 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
|
||||
zephyr,code = <INPUT_KEY_0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&cpu0 {
|
||||
clock-frequency = <ESP32_CLK_CPU_240M>;
|
||||
};
|
||||
|
||||
&cpu1 {
|
||||
clock-frequency = <ESP32_CLK_CPU_240M>;
|
||||
};
|
||||
|
||||
&usb_serial {
|
||||
status = "okay";
|
||||
};
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
current-speed = <115200>;
|
||||
pinctrl-0 = <&uart0_default>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
status = "okay";
|
||||
clock-frequency = <I2C_BITRATE_STANDARD>;
|
||||
pinctrl-0 = <&i2c0_default>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
status = "okay";
|
||||
clock-frequency = <I2C_BITRATE_STANDARD>;
|
||||
pinctrl-0 = <&i2c1_default>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
&trng0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi3 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
line-idle-low;
|
||||
pinctrl-0 = <&spim3_ws2812_led>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
status_rgb_led: ws2812@0 {
|
||||
compatible = "worldsemi,ws2812-spi";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <WS2812C_SPI_FREQ>;
|
||||
|
||||
chain-length = <1>;
|
||||
color-mapping = <LED_COLOR_ID_GREEN>,
|
||||
<LED_COLOR_ID_RED>,
|
||||
<LED_COLOR_ID_BLUE>;
|
||||
spi-one-frame = <WS2812C_ONE_FRAME>;
|
||||
spi-zero-frame = <WS2812C_ZERO_FRAME>;
|
||||
};
|
||||
};
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&wdt0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&timer0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&timer1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
status = "okay";
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
boot_partition: partition@0 {
|
||||
label = "mcuboot";
|
||||
reg = <0x00000000 0x0000F000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
slot0_partition: partition@10000 {
|
||||
label = "image-0";
|
||||
reg = <0x00010000 0x00100000>;
|
||||
};
|
||||
|
||||
slot1_partition: partition@110000 {
|
||||
label = "image-1";
|
||||
reg = <0x00110000 0x00100000>;
|
||||
};
|
||||
|
||||
scratch_partition: partition@210000 {
|
||||
label = "image-scratch";
|
||||
reg = <0x00210000 0x00040000>;
|
||||
};
|
||||
|
||||
storage_partition: partition@250000 {
|
||||
label = "storage";
|
||||
reg = <0x00250000 0x00006000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
23
boards/xtensa/m5stack_atoms3_lite/m5stack_atoms3_lite.yaml
Normal file
23
boards/xtensa/m5stack_atoms3_lite/m5stack_atoms3_lite.yaml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
identifier: m5stack_atoms3_lite
|
||||
name: M5Stack AtomS3-Lite
|
||||
type: mcu
|
||||
arch: xtensa
|
||||
toolchain:
|
||||
- zephyr
|
||||
supported:
|
||||
- gpio
|
||||
- uart
|
||||
- i2c
|
||||
- spi
|
||||
- counter
|
||||
- watchdog
|
||||
- entropy
|
||||
- pwm
|
||||
- pinmux
|
||||
- nvs
|
||||
- dma
|
||||
testing:
|
||||
ignore_tags:
|
||||
- net
|
||||
- bluetooth
|
||||
vendor: m5stack
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
CONFIG_BOARD_M5STACK_ATOMS3_LITE=y
|
||||
CONFIG_SOC_SERIES_ESP32S3=y
|
||||
|
||||
CONFIG_MAIN_STACK_SIZE=2048
|
||||
|
||||
CONFIG_CONSOLE=y
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_UART_CONSOLE=y
|
||||
CONFIG_GPIO=y
|
||||
CONFIG_CLOCK_CONTROL=y
|
||||
17
dts/bindings/gpio/m5stack,atom-header.yaml
Normal file
17
dts/bindings/gpio/m5stack,atom-header.yaml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# Copyright (c) 2023 Martin Kiepfer <mrmarteng@teleschirm.org>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: |
|
||||
Pin-header exposed on M5Stack Atom devices.
|
||||
|
||||
This binding provides a nexus mapping for 9 pins as depicted below.
|
||||
|
||||
x 3.3V
|
||||
0 GPIO 1 SCL
|
||||
2 GPIO/MOSI 3 GPIO/DAC0/SDA
|
||||
4 GPIO/CLK 5 5V
|
||||
6 GPIO/ADC0/MISO 7 GND
|
||||
|
||||
compatible: "m5stack,atom-header"
|
||||
|
||||
include: [gpio-nexus.yaml, base.yaml]
|
||||
Loading…
Reference in a new issue