summaryrefslogtreecommitdiffstatshomepage
path: root/ports
diff options
context:
space:
mode:
Diffstat (limited to 'ports')
-rw-r--r--ports/zephyr/CMakeLists.txt10
-rw-r--r--ports/zephyr/Kconfig8
-rw-r--r--ports/zephyr/boards/beagleconnect_freedom.conf1
-rw-r--r--ports/zephyr/boards/beagleconnect_freedom.overlay41
-rw-r--r--ports/zephyr/boards/manifest.py7
-rw-r--r--ports/zephyr/boards/nrf5340dk_nrf5340_cpuapp.conf2
-rw-r--r--ports/zephyr/boards/nrf5340dk_nrf5340_cpuapp.overlay16
-rw-r--r--ports/zephyr/boards/nrf9151dk_nrf9151.conf7
-rw-r--r--ports/zephyr/boards/nrf9151dk_nrf9151.overlay22
9 files changed, 112 insertions, 2 deletions
diff --git a/ports/zephyr/CMakeLists.txt b/ports/zephyr/CMakeLists.txt
index b955089066..4f457f4a58 100644
--- a/ports/zephyr/CMakeLists.txt
+++ b/ports/zephyr/CMakeLists.txt
@@ -34,6 +34,11 @@ set(MICROPY_TARGET micropython)
include(${MICROPY_DIR}/py/py.cmake)
include(${MICROPY_DIR}/extmod/extmod.cmake)
+if (CONFIG_MICROPY_FROZEN_MODULES)
+ cmake_path(ABSOLUTE_PATH CONFIG_MICROPY_FROZEN_MANIFEST BASE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
+ set(MICROPY_FROZEN_MANIFEST ${CONFIG_MICROPY_FROZEN_MANIFEST})
+endif()
+
set(MICROPY_SOURCE_PORT
main.c
help.c
@@ -115,10 +120,11 @@ zephyr_library_compile_definitions(
zephyr_library_sources(${MICROPY_SOURCE_QSTR})
zephyr_library_link_libraries(kernel)
-add_dependencies(${MICROPY_TARGET} zephyr_generated_headers)
-
include(${MICROPY_DIR}/py/mkrules.cmake)
+add_dependencies(BUILD_VERSION_HEADER zephyr_generated_headers)
+add_dependencies(${MICROPY_TARGET} zephyr_generated_headers)
+
target_sources(app PRIVATE
src/zephyr_start.c
src/zephyr_getchar.c
diff --git a/ports/zephyr/Kconfig b/ports/zephyr/Kconfig
index 227e943bcd..f8d1543155 100644
--- a/ports/zephyr/Kconfig
+++ b/ports/zephyr/Kconfig
@@ -41,6 +41,14 @@ config MICROPY_VFS_LFS1
config MICROPY_VFS_LFS2
bool "LittleFs version 2 file system"
+config MICROPY_FROZEN_MODULES
+ bool "Enable Frozen Modules"
+
+config MICROPY_FROZEN_MANIFEST
+ string "Path to Frozen Modules manifest.py"
+ depends on MICROPY_FROZEN_MODULES
+ default "boards/manifest.py"
+
endmenu # MicroPython Options
source "Kconfig.zephyr"
diff --git a/ports/zephyr/boards/beagleconnect_freedom.conf b/ports/zephyr/boards/beagleconnect_freedom.conf
index 14ce9c526e..1e3f6037bd 100644
--- a/ports/zephyr/boards/beagleconnect_freedom.conf
+++ b/ports/zephyr/boards/beagleconnect_freedom.conf
@@ -1,4 +1,5 @@
# Hardware features
+CONFIG_PWM=y
CONFIG_I2C=y
CONFIG_SPI=y
diff --git a/ports/zephyr/boards/beagleconnect_freedom.overlay b/ports/zephyr/boards/beagleconnect_freedom.overlay
new file mode 100644
index 0000000000..7dd4469c99
--- /dev/null
+++ b/ports/zephyr/boards/beagleconnect_freedom.overlay
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2024 Ayush Singh <ayush@beagleboard.org>
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+&pinctrl {
+ /* MB1 PWM */
+ pwm0_default: pwm0_default {
+ pinmux = <17 IOC_PORT_MCU_PORT_EVENT1>;
+ bias-disable;
+ drive-strength = <2>;
+ };
+
+ /* MB2 PWM */
+ pwm1_default: pwm1_default {
+ pinmux = <19 IOC_PORT_MCU_PORT_EVENT3>;
+ bias-disable;
+ drive-strength = <2>;
+ };
+};
+
+&gpt0 {
+ status = "okay";
+};
+
+&gpt1 {
+ status = "okay";
+};
+
+&pwm0 {
+ status = "okay";
+ pinctrl-0 = <&pwm0_default>;
+ pinctrl-names = "default";
+};
+
+&pwm1 {
+ status = "okay";
+ pinctrl-0 = <&pwm1_default>;
+ pinctrl-names = "default";
+};
diff --git a/ports/zephyr/boards/manifest.py b/ports/zephyr/boards/manifest.py
new file mode 100644
index 0000000000..df1169c081
--- /dev/null
+++ b/ports/zephyr/boards/manifest.py
@@ -0,0 +1,7 @@
+# This is an example frozen module manifest. Enable this by configuring
+# the Zephyr project and enabling the frozen modules config feature.
+
+freeze("$(PORT_DIR)/modules")
+
+# Require a micropython-lib module.
+require("upysh")
diff --git a/ports/zephyr/boards/nrf5340dk_nrf5340_cpuapp.conf b/ports/zephyr/boards/nrf5340dk_nrf5340_cpuapp.conf
new file mode 100644
index 0000000000..b4aed364a7
--- /dev/null
+++ b/ports/zephyr/boards/nrf5340dk_nrf5340_cpuapp.conf
@@ -0,0 +1,2 @@
+CONFIG_FLASH=y
+CONFIG_FLASH_MAP=y
diff --git a/ports/zephyr/boards/nrf5340dk_nrf5340_cpuapp.overlay b/ports/zephyr/boards/nrf5340dk_nrf5340_cpuapp.overlay
new file mode 100644
index 0000000000..7310d1e55f
--- /dev/null
+++ b/ports/zephyr/boards/nrf5340dk_nrf5340_cpuapp.overlay
@@ -0,0 +1,16 @@
+// Replace default internal storage partition with external flash
+
+/delete-node/ &storage_partition;
+
+&mx25r64 {
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ storage_partition: partition@0 {
+ reg = <0x00000000 0x800000>;
+ label = "storage";
+ };
+ };
+};
diff --git a/ports/zephyr/boards/nrf9151dk_nrf9151.conf b/ports/zephyr/boards/nrf9151dk_nrf9151.conf
new file mode 100644
index 0000000000..e89f332ba1
--- /dev/null
+++ b/ports/zephyr/boards/nrf9151dk_nrf9151.conf
@@ -0,0 +1,7 @@
+# Enable external flash
+CONFIG_SPI=y
+CONFIG_SPI_NOR=y
+CONFIG_SPI_NOR_SFDP_DEVICETREE=y
+
+CONFIG_FLASH=y
+CONFIG_FLASH_MAP=y
diff --git a/ports/zephyr/boards/nrf9151dk_nrf9151.overlay b/ports/zephyr/boards/nrf9151dk_nrf9151.overlay
new file mode 100644
index 0000000000..85cab57414
--- /dev/null
+++ b/ports/zephyr/boards/nrf9151dk_nrf9151.overlay
@@ -0,0 +1,22 @@
+/ {
+ /* Configure partition manager to use gd25wb256 as the external flash */
+ chosen {
+ nordic,pm-ext-flash = &gd25wb256;
+ };
+};
+
+/delete-node/ &storage_partition;
+
+&gd25wb256 {
+ status = "okay";
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ storage_partition: partition@0 {
+ reg = <0x00000000 0x2000000>;
+ label = "storage";
+ };
+ };
+};