From f7f5c4470a3b074039a9e4fa4a1e36960d90d3e5 Mon Sep 17 00:00:00 2001 From: Nikola Trifunovic Date: Sat, 27 Jan 2024 22:18:38 +0100 Subject: [PATCH] boards: xtensa: m5stack_atom_lite: initial support Source code of board/m5stack/m5stickc_plus and board/m5stack/m5stack_atoms3_lite were adapted for an inital support of the M5Stack ATOM Lite board. Signed-off-by: Nikola Trifunovic --- .../m5stack_atom_lite/Kconfig.defconfig | 26 +++ .../Kconfig.m5stack_atom_lite | 10 + boards/m5stack/m5stack_atom_lite/board.cmake | 12 ++ boards/m5stack/m5stack_atom_lite/board.yaml | 5 + .../doc/img/m5stack_atom_lite.webp | Bin 0 -> 8572 bytes .../m5stack/m5stack_atom_lite/doc/index.rst | 134 ++++++++++++ .../m5stack_atom_lite/grove_connectors.dtsi | 18 ++ .../m5stack_atom_lite-pinctrl.dtsi | 65 ++++++ .../m5stack_atom_lite_esp32_appcpu.dts | 74 +++++++ .../m5stack_atom_lite_esp32_appcpu.yaml | 27 +++ .../m5stack_atom_lite_esp32_appcpu_defconfig | 4 + .../m5stack_atom_lite_esp32_procpu.dts | 190 ++++++++++++++++++ .../m5stack_atom_lite_esp32_procpu.yaml | 19 ++ .../m5stack_atom_lite_esp32_procpu_defconfig | 9 + 14 files changed, 593 insertions(+) create mode 100644 boards/m5stack/m5stack_atom_lite/Kconfig.defconfig create mode 100644 boards/m5stack/m5stack_atom_lite/Kconfig.m5stack_atom_lite create mode 100644 boards/m5stack/m5stack_atom_lite/board.cmake create mode 100644 boards/m5stack/m5stack_atom_lite/board.yaml create mode 100644 boards/m5stack/m5stack_atom_lite/doc/img/m5stack_atom_lite.webp create mode 100644 boards/m5stack/m5stack_atom_lite/doc/index.rst create mode 100644 boards/m5stack/m5stack_atom_lite/grove_connectors.dtsi create mode 100644 boards/m5stack/m5stack_atom_lite/m5stack_atom_lite-pinctrl.dtsi create mode 100644 boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_appcpu.dts create mode 100644 boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_appcpu.yaml create mode 100644 boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_appcpu_defconfig create mode 100644 boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_procpu.dts create mode 100644 boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_procpu.yaml create mode 100644 boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_procpu_defconfig diff --git a/boards/m5stack/m5stack_atom_lite/Kconfig.defconfig b/boards/m5stack/m5stack_atom_lite/Kconfig.defconfig new file mode 100644 index 0000000000..d56d34b22d --- /dev/null +++ b/boards/m5stack/m5stack_atom_lite/Kconfig.defconfig @@ -0,0 +1,26 @@ +# M5Stack ATOM Lite board configuration +# Copyright (c) 2023 Benjamin Cabé +# Copyright (c) 2022 AVSystem Sławomir Wolf Sp.j. (AVSystem) +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_M5STACK_ATOM_LITE_ESP32_PROCPU + +config HEAP_MEM_POOL_ADD_SIZE_BOARD + int + default 65535 if WIFI && BT + default 51200 if WIFI + default 40960 if BT + default 4096 + +choice BT_HCI_BUS_TYPE + default BT_ESP32 if BT +endchoice + +endif # BOARD_M5STACK_ATOM_LITE_ESP32_PROCPU + +if BOARD_M5STACK_ATOM_LITE_ESP32_APPCPU + +config HEAP_MEM_POOL_ADD_SIZE_BOARD + default 256 + +endif # BOARD_M5STACK_ATOM_LITE_ESP32_APPCPU diff --git a/boards/m5stack/m5stack_atom_lite/Kconfig.m5stack_atom_lite b/boards/m5stack/m5stack_atom_lite/Kconfig.m5stack_atom_lite new file mode 100644 index 0000000000..2150b48e32 --- /dev/null +++ b/boards/m5stack/m5stack_atom_lite/Kconfig.m5stack_atom_lite @@ -0,0 +1,10 @@ +# M5Stack Atom Lite board configuration + +# Copyright (c) 2024 Nikola Trifunovic +# Copyright (c) 2022 AVSystem Sławomir Wolf Sp.j. (AVSystem) +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_M5STACK_ATOM_LITE + select SOC_ESP32_PICO_D4 + select SOC_ESP32_PROCPU if BOARD_M5STACK_ATOM_LITE_ESP32_PROCPU + select SOC_ESP32_APPCPU if BOARD_M5STACK_ATOM_LITE_ESP32_APPCPU diff --git a/boards/m5stack/m5stack_atom_lite/board.cmake b/boards/m5stack/m5stack_atom_lite/board.cmake new file mode 100644 index 0000000000..91b3caa2c7 --- /dev/null +++ b/boards/m5stack/m5stack_atom_lite/board.cmake @@ -0,0 +1,12 @@ +# 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) + +# the default ESP32 baud rate is not supported +board_runner_args(esp32 "--esp-baud-rate=1500000") diff --git a/boards/m5stack/m5stack_atom_lite/board.yaml b/boards/m5stack/m5stack_atom_lite/board.yaml new file mode 100644 index 0000000000..d7202eda26 --- /dev/null +++ b/boards/m5stack/m5stack_atom_lite/board.yaml @@ -0,0 +1,5 @@ +board: + name: m5stack_atom_lite + vendor: m5stack + socs: + - name: esp32 diff --git a/boards/m5stack/m5stack_atom_lite/doc/img/m5stack_atom_lite.webp b/boards/m5stack/m5stack_atom_lite/doc/img/m5stack_atom_lite.webp new file mode 100644 index 0000000000000000000000000000000000000000..532b73af8fdb70f9588d437339e93439d5b38525 GIT binary patch literal 8572 zcmV-?A%oshNk&F=ApihZMM6+kP&il$0000G000120sylC06|PpNGlHj00Hoa?f*I@ z{{P*FnPKP8x= zIf}x6RmliHy=h8IPe)sgm4>rVhjq6T`JXO`3p=s0*IQ+rwN@9UI|oH)^S_;&^vljk z@6_~hw4$(UcZ7>>(xq=kx2flCV-?YIYc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)^g)`I z`&x#oeY3w_!V^_mbJ3~M!PH5TDk7yQ;n-?31K*@-?z;DHPyl7ZMJ+~`Tb@&Gr%^^a zF`Omj`g%U=rZ;6DNzk(V&=pSSCTLw$-riJX32>H{1U1R=qR(y3d|e~m$;#n ze^e6%i@9i$*bP%V!*XAx5Th*Z49-AK^FLwTN(FSl```co5hpwAxUfvWI)AQi~4w;^s z_@H!;t`9Je7QY!;5_>Qd03!CxL)i_L12#nV7j-$Y?>(NTW1q1HCjnW$d=N>rhaCy1 z-r3=u_pa@=pwEE*`` 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_atom_lite + +Debugging +--------- + +M5Stack ATOM Lite debugging is not supported due to pinout limitations. + +Related Documents +***************** +- `M5Stack ATOM Lite docs `_ +- `M5Stack ATOM Lite schematic `_ +- `ESP32-PICO-D4 Datasheet `_ (PDF) diff --git a/boards/m5stack/m5stack_atom_lite/grove_connectors.dtsi b/boards/m5stack/m5stack_atom_lite/grove_connectors.dtsi new file mode 100644 index 0000000000..a2926d68eb --- /dev/null +++ b/boards/m5stack/m5stack_atom_lite/grove_connectors.dtsi @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Nikola Trifunovic + * Copyright (c) 2023 Benjamin Cabé + * 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 26 0>, + <1 0 &gpio1 0 0>; + }; +}; + +grove_i2c1: &i2c1 {}; diff --git a/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite-pinctrl.dtsi b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite-pinctrl.dtsi new file mode 100644 index 0000000000..8db8fd6cd3 --- /dev/null +++ b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite-pinctrl.dtsi @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2024 Nikola Trifunovic + * Copyright (c) 2023 Benjamin Cabé + * Copyright (c) 2023 Martin Kiepfer + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +&pinctrl { + uart0_default: uart0_default { + group1 { + pinmux = ; + output-high; + }; + group2 { + pinmux = ; + bias-pull-up; + }; + }; + + i2c0_default: i2c0_default { + group1 { + pinmux = , + ; + bias-pull-up; + drive-open-drain; + output-high; + }; + }; + + i2c1_default: i2c1_default { + group1 { + pinmux = , + ; + bias-pull-up; + drive-open-drain; + output-high; + }; + }; + + spim2_default: spim2_default { + group1 { + pinmux = , + , + ; + }; + group2 { + pinmux = ; + output-low; + }; + + }; + + /* used for SK6812 */ + spim3_ws2812_led: spim3_ws2812_led { + group1 { + pinmux = ; + output-low; + }; + }; +}; diff --git a/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_appcpu.dts b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_appcpu.dts new file mode 100644 index 0000000000..59a908a3fe --- /dev/null +++ b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_appcpu.dts @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd. + * + * SPDX-License-Identifier: Apache-2.0 + */ +/dts-v1/; + +#include + +/ { + model = "M5Stack Atom Lite APPCPU"; + compatible = "espressif,esp32"; + + chosen { + zephyr,sram = &sram0; + zephyr,ipc_shm = &shm0; + zephyr,ipc = &ipm0; + }; +}; + +&cpu0 { + clock-frequency = ; +}; + +&cpu1 { + clock-frequency = ; +}; + +&ipm0 { + status = "okay"; +}; + +&trng0 { + status = "okay"; +}; + +&flash0 { + status = "okay"; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Reserve 60kB for the bootloader */ + boot_partition: partition@1000 { + label = "mcuboot"; + reg = <0x00001000 0x0000F000>; + read-only; + }; + + /* Reserve 1024kB for the application in slot 0 */ + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x00010000 0x00100000>; + }; + + /* Reserve 1024kB for the application in slot 1 */ + slot1_partition: partition@110000 { + label = "image-1"; + reg = <0x00110000 0x00100000>; + }; + + /* Reserve 256kB for the scratch partition */ + scratch_partition: partition@210000 { + label = "image-scratch"; + reg = <0x00210000 0x00040000>; + }; + + storage_partition: partition@250000 { + label = "storage"; + reg = <0x00250000 0x00006000>; + }; + }; +}; diff --git a/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_appcpu.yaml b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_appcpu.yaml new file mode 100644 index 0000000000..0880b2f798 --- /dev/null +++ b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_appcpu.yaml @@ -0,0 +1,27 @@ +identifier: m5stack_atom_lite/esp32/appcpu +name: M5Stack ATOM Lite +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - uart +testing: + ignore_tags: + - net + - bluetooth + - flash + - cpp + - posix + - watchdog + - logging + - kernel + - pm + - gpio + - crypto + - eeprom + - heap + - cmsis_rtos + - jwt + - zdsp +vendor: m5stack diff --git a/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_appcpu_defconfig b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_appcpu_defconfig new file mode 100644 index 0000000000..9abf2ff043 --- /dev/null +++ b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_appcpu_defconfig @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_MAIN_STACK_SIZE=2048 +CONFIG_CLOCK_CONTROL=y diff --git a/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_procpu.dts b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_procpu.dts new file mode 100644 index 0000000000..53f6175e4d --- /dev/null +++ b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_procpu.dts @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2024 Nikola Trifunovic + * Copyright (c) 2023 Benjamin Cabé + * Copyright (c) 2023 Martin Kiepfer + * + * SPDX-License-Identifier: Apache-2.0 + */ +/dts-v1/; + +#include +#include "m5stack_atom_lite-pinctrl.dtsi" +#include "grove_connectors.dtsi" +#include +#include +#include + +/ { + model = "M5Stack ATOM Lite PROCPU"; + compatible = "m5stack,m5stack-atom-lite"; + + chosen { + zephyr,sram = &sram0; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; + }; + + aliases { + sw0 = &user_button_0; + watchdog0 = &wdt0; + i2c-0 = &i2c0; + led-strip = &status_rgb_led; + }; + + leds { + compatible = "gpio-leds"; + + ir_led: led_0 { + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + label = "Infrared LED"; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + + user_button_0: button_0 { + label = "User button 0"; + gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; // G39 + zephyr,code = ; + }; + }; +}; + +&cpu0 { + clock-frequency = ; +}; + +&cpu1 { + clock-frequency = ; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-names = "default"; +}; + +&i2c0 { + status = "okay"; + clock-frequency = ; + pinctrl-0 = <&i2c0_default>; + pinctrl-names = "default"; + sda-gpios = <&gpio0 25 GPIO_OPEN_DRAIN>; + scl-gpios = <&gpio0 21 GPIO_OPEN_DRAIN>; + +}; + +&i2c1 { + status = "okay"; + clock-frequency = ; + pinctrl-0 = <&i2c1_default>; + pinctrl-names = "default"; + sda-gpios = <&gpio0 26 GPIO_OPEN_DRAIN>; + scl-gpios = <&gpio1 0 GPIO_OPEN_DRAIN>; +}; + + +&timer0 { + status = "okay"; +}; + +&timer1 { + status = "okay"; +}; + +&timer2 { + status = "okay"; +}; + +&timer3 { + status = "okay"; +}; + +&trng0 { + status = "okay"; +}; + +&spi2 { + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&spim2_default>; + pinctrl-names = "default"; +}; + +/* used for SK6812 */ +&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 = ; + + chain-length = <1>; + color-mapping = , + , + ; + spi-one-frame = ; + spi-zero-frame = ; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&wdt0 { + status = "okay"; +}; + +&flash0 { + status = "okay"; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Reserve 60kB for the bootloader */ + boot_partition: partition@1000 { + label = "mcuboot"; + reg = <0x00001000 0x0000F000>; + read-only; + }; + + /* Reserve 1024kB for the application in slot 0 */ + slot0_partition: partition@10000 { + label = "image-0"; + reg = <0x00010000 0x00100000>; + }; + + /* Reserve 1024kB for the application in slot 1 */ + slot1_partition: partition@110000 { + label = "image-1"; + reg = <0x00110000 0x00100000>; + }; + + /* Reserve 256kB for the scratch partition */ + scratch_partition: partition@210000 { + label = "image-scratch"; + reg = <0x00210000 0x00040000>; + }; + + storage_partition: partition@250000 { + label = "storage"; + reg = <0x00250000 0x00006000>; + }; + }; +}; diff --git a/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_procpu.yaml b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_procpu.yaml new file mode 100644 index 0000000000..14462ac58f --- /dev/null +++ b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_procpu.yaml @@ -0,0 +1,19 @@ +identifier: m5stack_atom_lite/esp32/procpu +name: M5Stack ATOM Lite +type: mcu +arch: xtensa +toolchain: + - zephyr +supported: + - gpio + - i2c + - spi + - watchdog + - uart + - pinmux + - nvs +testing: + ignore_tags: + - net + - bluetooth +vendor: m5stack diff --git a/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_procpu_defconfig b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_procpu_defconfig new file mode 100644 index 0000000000..0ec9d05366 --- /dev/null +++ b/boards/m5stack/m5stack_atom_lite/m5stack_atom_lite_esp32_procpu_defconfig @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_MAIN_STACK_SIZE=2048 + +CONFIG_GPIO=y + +CONFIG_CONSOLE=y +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y