From d3abe6284a3c8ca0e5cd3db76125199fa6931611 Mon Sep 17 00:00:00 2001 From: Brandon Hurst Date: Mon, 7 Sep 2026 15:11:01 -0700 Subject: [PATCH] Add Zephyr support for MAX32690 Eval Boards - Board aliases in ports/zephyr-cp/boards/board_aliases.cmake - Support for MAX32690FTHR, APARD32690, and MAX32690EVKIT APARD / EVKit had storage_partition by default in board support, but the MAX32690FTHR needed an explicit partition. Optional ramdisk usage for testing without flash wear. All boards successfully built, tested on MAX32690FTHR. Signed-off-by: Brandon Hurst --- .../boards/analog/apard32690/board.conf | 6 ++ .../boards/analog/apard32690/board.overlay | 57 +++++++++++++++++ .../boards/analog/max32690evkit/board.conf | 6 ++ .../boards/analog/max32690evkit/board.overlay | 57 +++++++++++++++++ .../boards/analog/max32690fthr/board.conf | 6 ++ .../boards/analog/max32690fthr/board.overlay | 63 +++++++++++++++++++ ports/zephyr-cp/boards/board_aliases.cmake | 3 + 7 files changed, 198 insertions(+) create mode 100644 ports/zephyr-cp/boards/analog/apard32690/board.conf create mode 100644 ports/zephyr-cp/boards/analog/apard32690/board.overlay create mode 100644 ports/zephyr-cp/boards/analog/max32690evkit/board.conf create mode 100644 ports/zephyr-cp/boards/analog/max32690evkit/board.overlay create mode 100644 ports/zephyr-cp/boards/analog/max32690fthr/board.conf create mode 100644 ports/zephyr-cp/boards/analog/max32690fthr/board.overlay diff --git a/ports/zephyr-cp/boards/analog/apard32690/board.conf b/ports/zephyr-cp/boards/analog/apard32690/board.conf new file mode 100644 index 00000000000..227d30de751 --- /dev/null +++ b/ports/zephyr-cp/boards/analog/apard32690/board.conf @@ -0,0 +1,6 @@ +# Optionally use RAMDISK driver for testing +# without flash wear +# CONFIG_DISK_DRIVER_RAM=y + +# Default: Use flash partition +CONFIG_DISK_DRIVER_FLASH=y diff --git a/ports/zephyr-cp/boards/analog/apard32690/board.overlay b/ports/zephyr-cp/boards/analog/apard32690/board.overlay new file mode 100644 index 00000000000..41cc252cfd4 --- /dev/null +++ b/ports/zephyr-cp/boards/analog/apard32690/board.overlay @@ -0,0 +1,57 @@ +&trng { + status = "okay"; +}; + +// MAX32690's internal flash has no partition table by default and no +// external flash chip is wired up on this board +// PARTITIONS +// - Code +// - Zephyr settings storage (needed by CONFIG_SETTINGS/CONFIG_BT_SETTINGS), +// - CIRCUITPY filesystem (supervisor/flash.c looks for a partition labeled +// `circuitpy_partition`) +&flash0 { + partitions { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + code_partition: partition@0 { + compatible = "zephyr,mapped-partition"; + label = "image"; + reg = <0x0 (DT_SIZE_M(1) + DT_SIZE_K(512))>; + }; + + circuitpy_partition: partition@190000 { + compatible = "zephyr,mapped-partition"; + label = "circuitpy"; + reg = <0x190000 (DT_SIZE_M(3) - DT_SIZE_M(1) - DT_SIZE_K(512) - DT_SIZE_K(64))>; + }; + }; +}; + +/ { + soc { + // MAX32690's 1 MiB SRAM is split into 8 by default + // Use one combined node spanning the whole SRAM + m4_sram: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_M(1)>; + }; + }; + + chosen { + zephyr,sram = &m4_sram; + zephyr,code-partition = &code_partition; + }; + + // RAM disk, enabled via CONFIG_DISK_DRIVER_RAM in board.conf + // For use if flash wear is not desired when testing + ramdisk0: ramdisk0 { + compatible = "zephyr,ram-disk"; + disk-name = "RAM"; + sector-size = <512>; + sector-count = <128>; + }; +}; + +#include "../../../app.overlay" diff --git a/ports/zephyr-cp/boards/analog/max32690evkit/board.conf b/ports/zephyr-cp/boards/analog/max32690evkit/board.conf new file mode 100644 index 00000000000..227d30de751 --- /dev/null +++ b/ports/zephyr-cp/boards/analog/max32690evkit/board.conf @@ -0,0 +1,6 @@ +# Optionally use RAMDISK driver for testing +# without flash wear +# CONFIG_DISK_DRIVER_RAM=y + +# Default: Use flash partition +CONFIG_DISK_DRIVER_FLASH=y diff --git a/ports/zephyr-cp/boards/analog/max32690evkit/board.overlay b/ports/zephyr-cp/boards/analog/max32690evkit/board.overlay new file mode 100644 index 00000000000..41cc252cfd4 --- /dev/null +++ b/ports/zephyr-cp/boards/analog/max32690evkit/board.overlay @@ -0,0 +1,57 @@ +&trng { + status = "okay"; +}; + +// MAX32690's internal flash has no partition table by default and no +// external flash chip is wired up on this board +// PARTITIONS +// - Code +// - Zephyr settings storage (needed by CONFIG_SETTINGS/CONFIG_BT_SETTINGS), +// - CIRCUITPY filesystem (supervisor/flash.c looks for a partition labeled +// `circuitpy_partition`) +&flash0 { + partitions { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + code_partition: partition@0 { + compatible = "zephyr,mapped-partition"; + label = "image"; + reg = <0x0 (DT_SIZE_M(1) + DT_SIZE_K(512))>; + }; + + circuitpy_partition: partition@190000 { + compatible = "zephyr,mapped-partition"; + label = "circuitpy"; + reg = <0x190000 (DT_SIZE_M(3) - DT_SIZE_M(1) - DT_SIZE_K(512) - DT_SIZE_K(64))>; + }; + }; +}; + +/ { + soc { + // MAX32690's 1 MiB SRAM is split into 8 by default + // Use one combined node spanning the whole SRAM + m4_sram: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_M(1)>; + }; + }; + + chosen { + zephyr,sram = &m4_sram; + zephyr,code-partition = &code_partition; + }; + + // RAM disk, enabled via CONFIG_DISK_DRIVER_RAM in board.conf + // For use if flash wear is not desired when testing + ramdisk0: ramdisk0 { + compatible = "zephyr,ram-disk"; + disk-name = "RAM"; + sector-size = <512>; + sector-count = <128>; + }; +}; + +#include "../../../app.overlay" diff --git a/ports/zephyr-cp/boards/analog/max32690fthr/board.conf b/ports/zephyr-cp/boards/analog/max32690fthr/board.conf new file mode 100644 index 00000000000..227d30de751 --- /dev/null +++ b/ports/zephyr-cp/boards/analog/max32690fthr/board.conf @@ -0,0 +1,6 @@ +# Optionally use RAMDISK driver for testing +# without flash wear +# CONFIG_DISK_DRIVER_RAM=y + +# Default: Use flash partition +CONFIG_DISK_DRIVER_FLASH=y diff --git a/ports/zephyr-cp/boards/analog/max32690fthr/board.overlay b/ports/zephyr-cp/boards/analog/max32690fthr/board.overlay new file mode 100644 index 00000000000..e7d4d57a018 --- /dev/null +++ b/ports/zephyr-cp/boards/analog/max32690fthr/board.overlay @@ -0,0 +1,63 @@ +&trng { + status = "okay"; +}; + +// MAX32690's internal flash has no partition table by default and no +// external flash chip is wired up on this board +// PARTITIONS +// - Code +// - Zephyr settings storage (needed by CONFIG_SETTINGS/CONFIG_BT_SETTINGS), +// - CIRCUITPY filesystem (supervisor/flash.c looks for a partition labeled +// `circuitpy_partition`) +&flash0 { + partitions { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + code_partition: partition@0 { + compatible = "zephyr,mapped-partition"; + label = "image"; + reg = <0x0 (DT_SIZE_M(1) + DT_SIZE_K(512))>; + }; + + storage_partition: partition@180000 { + compatible = "zephyr,mapped-partition"; + label = "storage"; + reg = <0x180000 DT_SIZE_K(64)>; + }; + + circuitpy_partition: partition@190000 { + compatible = "zephyr,mapped-partition"; + label = "circuitpy"; + reg = <0x190000 (DT_SIZE_M(3) - DT_SIZE_M(1) - DT_SIZE_K(512) - DT_SIZE_K(64))>; + }; + }; +}; + +/ { + soc { + // MAX32690's 1 MiB SRAM is split into 8 by default + // Use one combined node spanning the whole SRAM + m4_sram: memory@20000000 { + compatible = "mmio-sram"; + reg = <0x20000000 DT_SIZE_M(1)>; + }; + }; + + chosen { + zephyr,sram = &m4_sram; + zephyr,code-partition = &code_partition; + }; + + // RAM disk, enabled via CONFIG_DISK_DRIVER_RAM in board.conf + // For use if flash wear is not desired when testing + ramdisk0: ramdisk0 { + compatible = "zephyr,ram-disk"; + disk-name = "RAM"; + sector-size = <512>; + sector-count = <128>; + }; +}; + +#include "../../../app.overlay" diff --git a/ports/zephyr-cp/boards/board_aliases.cmake b/ports/zephyr-cp/boards/board_aliases.cmake index 29ce83ceb5e..6da0e1523e8 100644 --- a/ports/zephyr-cp/boards/board_aliases.cmake +++ b/ports/zephyr-cp/boards/board_aliases.cmake @@ -56,3 +56,6 @@ cp_board_alias(raspberrypi_rpi_pico2_zephyr rpi_pico2/rp2350a/m33) cp_board_alias(raspberrypi_rpi_pico2_w_zephyr rpi_pico2/rp2350a/m33/w) cp_board_alias(st_nucleo_n657x0_q nucleo_n657x0_q/stm32n657xx) cp_board_alias(silabs_siwx917_dk2605a siwx917_dk2605a) +cp_board_alias(analog_max32690fthr max32690fthr/max32690/m4) +cp_board_alias(analog_apard32690 apard32690/max32690/m4) +cp_board_alias(analog_max32690evkit max32690evkit/max32690/m4)