Skip to content
Open
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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ zephyr_include_directories(include)

add_subdirectory(drivers)
add_subdirectory(lib)
add_subdirectory(app/common)
1 change: 1 addition & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@

rsource "drivers/Kconfig"
rsource "lib/Kconfig"
rsource "app/common/Kconfig*"
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Zephyr Example Application
# PHYTEC Zephyr Application

<a href="https://github.com/zephyrproject-rtos/example-application/actions/workflows/build.yml?query=branch%3Amain">
<img src="https://github.com/zephyrproject-rtos/example-application/actions/workflows/build.yml/badge.svg?event=push">
Expand Down Expand Up @@ -62,7 +62,7 @@ command:

```shell
# initialize my-workspace for the example-application (main branch)
west init -m https://github.com/zephyrproject-rtos/example-application --mr main my-workspace
west init -m https://github.com/phytec/zephyr-phytec-application --mr v4.4.0-phy1 my-workspace
# update Zephyr modules
cd my-workspace
west update
Expand All @@ -73,21 +73,21 @@ west update
To build the application, run the following command:

```shell
cd example-application
cd zephyr-phytec-application
west build -b $BOARD app
```

where `$BOARD` is the target board.

You can use the `custom_plank` board found in this
You can use the `phyboard_atlas/mimxrt1176/cm7 ` board found in this
repository. Note that Zephyr sample boards may be used if an
appropriate overlay is provided (see `app/boards`).

A sample debug configuration is also provided. To apply it, run the following
command:

```shell
west build -b $BOARD app -- -DEXTRA_CONF_FILE=debug.conf
west build -b $BOARD app -- -DEXTRA_CONF_FILE=shell.conf
```

Once you have built the application, run the following command to flash it:
Expand Down
37 changes: 0 additions & 37 deletions app/CMakeLists.txt

This file was deleted.

27 changes: 0 additions & 27 deletions app/boards/nucleo_f302r8.overlay

This file was deleted.

15 changes: 15 additions & 0 deletions app/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-License-Identifier: Apache-2.0

add_subdirectory_ifdef(CONFIG_APP_WATCHDOG init/watchdog)

add_subdirectory_ifdef(CONFIG_APP_AUDIO_SELCALL modules/audio_selcall)
add_subdirectory_ifdef(CONFIG_APP_BUTTON modules/button)
add_subdirectory_ifdef(CONFIG_APP_CSI_CAPTURE modules/csi_capture)
add_subdirectory_ifdef(CONFIG_APP_DAC_SAWTOOTH modules/dac_sawtooth)
add_subdirectory_ifdef(CONFIG_APP_HEARTBEAT modules/heartbeat)
add_subdirectory_ifdef(CONFIG_APP_LED_ROLLOVER modules/led_rollover)
add_subdirectory_ifdef(CONFIG_APP_LVGL_RANDOM_NUMBER modules/lvgl_random_number)
add_subdirectory_ifdef(CONFIG_APP_LVGL_TESTCARD modules/lvgl_testcard)
add_subdirectory_ifdef(CONFIG_APP_LVGL_WIDGETS modules/lvgl_widgets)
add_subdirectory_ifdef(CONFIG_APP_UPTIME_COUNTER modules/uptime_counter)
add_subdirectory_ifdef(CONFIG_APP_USB_DEVICE modules/usb_device)
172 changes: 172 additions & 0 deletions app/common/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# Copyright (c) 2025 PHYTEC
# SPDX-License-Identifier: Apache-2.0
#

menu "PHYTEC Testing Options"

config PHYTEC_SOM_TESTING
bool "Modify application for SOM testing."
default n

config PHYTEC_KIT_TESTING
bool "Modify application for kit testing."
default n

config PHYTEC_NIGHTLY_TESTING
bool "Modify application for nightly testing."
default n

endmenu

menu "Example Applications"

config APP_AUDIO_SELCALL
bool "Enable the audio selcall example."
default y
depends on I2C
depends on AUDIO_CODEC

config APP_BUTTON
bool "Enable the button example."
default y
depends on GPIO
depends on !PHYTEC_KIT_TESTING

config APP_CSI_CAPTURE
bool "Enable the csi capture example."
default n

config APP_DAC_SAWTOOTH
bool "Enable the DAC sawtooth example."
default y
depends on DAC
depends on !PHYTEC_SOM_TESTING
depends on !PHYTEC_KIT_TESTING
depends on !PHYTEC_NIGHTLY_TESTING

config APP_HEARTBEAT
bool "Enable the LED heartbeat example."
default y
depends on GPIO
depends on !APP_LED_ROLLOVER

config APP_LED_ROLLOVER
bool "Enable the LED rollover example using LED subsystem."
default n
depends on LED
help
This enables an LED rollover demo that sequentially lights
up LEDs using the LED driver subsystem instead of direct GPIO.

config APP_LVGL_RANDOM_NUMBER
bool "Enable the LVGL random number example."
default y
select LVGL
select LV_FONT_MONTSERRAT_32
select LV_FONT_MONTSERRAT_48
depends on DISPLAY
depends on PHYTEC_KIT_TESTING

config APP_LVGL_TESTCARD
bool "Enable the LVGL test card example."
default y
select LVGL
depends on DISPLAY
depends on PHYTEC_SOM_TESTING

config APP_LVGL_WIDGETS
bool "Enable the LVGL widgets demo."
default y
select LVGL
select LV_USE_DEMO_WIDGETS
depends on DISPLAY
depends on !PHYTEC_SOM_TESTING
depends on !PHYTEC_KIT_TESTING
depends on !APP_CSI_CAPTURE

config APP_UPTIME_COUNTER
bool "Enable the uptime counter example."
default y
depends on EEPROM
depends on !PHYTEC_SOM_TESTING
depends on !PHYTEC_KIT_TESTING

config APP_USB_DEVICE
bool "Enable the USB device mass storage example."
default y
depends on USB_DEVICE_STACK_NEXT

config APP_WATCHDOG
bool "Initialize the watchdog task"
default y
select TASK_WDT
depends on WATCHDOG

config APP_VIDEO_SOURCE_CROP_LEFT
int "Crop area left value"
default 0
help
Left value of the crop area within the video source.

config APP_VIDEO_SOURCE_CROP_TOP
int "Crop area top value"
default 0
help
Top value of the crop area within the video source.

config APP_VIDEO_SOURCE_CROP_WIDTH
int "Crop area width value"
default 0
help
Width value of the crop area within the video source.
If set to 0, the crop is not applied.

config APP_VIDEO_SOURCE_CROP_HEIGHT
int "Crop area height value"
default 0
help
Height value of the crop area within the video source.
If set to 0, the crop is not applied.

config APP_VIDEO_FRAME_HEIGHT
int "Height of the video frame"
default 0
help
Height of the video frame. If set to 0, the default height is used.

config APP_VIDEO_FRAME_WIDTH
int "Width of the video frame"
default 0
help
Width of the video frame. If set to 0, the default width is used.

config APP_VIDEO_PIXEL_FORMAT
string "Pixel format of the video frame"
help
Pixel format of the video frame. If not set, the default pixel format is used.

config APP_VIDEO_CTRL_HFLIP
bool "Mirror the video frame horizontally"
help
If set, mirror the video frame horizontally

config APP_VIDEO_CTRL_VFLIP
bool "Mirror the video frame vertically"
help
If set, mirror the video frame vertically

config APP_VIDEO_SHELL_AND_CAPTURE
bool "Capture video even if the video shell is enabled"
depends on VIDEO_SHELL
default n
help
If set, the video capture is enabled even if the video shell is also enabled.

config APP_VIDEO_CAM_NUM_BUFS
int "Number of video buffers used for the camera"
default 2
help
Number of buffers in the video buffer pool used for the camera device.
The rest of the buffer pool will be used for other purposes such as transformation.

endmenu
40 changes: 40 additions & 0 deletions app/common/Kconfig.usb_device
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (c) 2025 PHYTEC
# SPDX-License-Identifier: Apache-2.0
#
# This file is the application Kconfig entry point. All application Kconfig
# options can be defined here or included via other application Kconfig files.
# You can browse these options using the west targets menuconfig (terminal) or
# guiconfig (GUI).

menu "MSC sample options"

choice
prompt "Storage and file system type used by the application"
default APP_MSC_STORAGE_NONE
help
Specify the type of storage and file system.

config APP_MSC_STORAGE_NONE
bool "Use RAM disk as block device"

config APP_MSC_STORAGE_RAM
bool "Use RAM disk and FAT file system"
imply FILE_SYSTEM
imply FAT_FILESYSTEM_ELM

config APP_MSC_STORAGE_SDCARD
bool "Use SDHC and FAT file system"
imply DISK_DRIVER_SDMMC
imply FILE_SYSTEM
imply FAT_FILESYSTEM_ELM

endchoice

config MASS_STORAGE_DISK_NAME
default "NAND" if DISK_DRIVER_FLASH
default "RAM" if DISK_DRIVER_RAM
default "SD" if DISK_DRIVER_SDMMC

endmenu

source "samples/subsys/usb/common/Kconfig.sample_usbd"
2 changes: 2 additions & 0 deletions app/common/init/watchdog/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/watchdog.c)
target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../)
34 changes: 34 additions & 0 deletions app/common/init/watchdog/watchdog.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2025 PHYTEC
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/kernel.h>
#include <zephyr/task_wdt/task_wdt.h>

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(watchdog, CONFIG_APP_LOG_LEVEL);

/*
* Get watchdog configuration from the devicetree sw0 alias. This is mandatory.
*/
#define WDOG0_NODE DT_ALIAS(watchdog0)
#if !DT_NODE_HAS_STATUS_OKAY(WDOG0_NODE)
#error "Unsupported board: watchdog0 devicetree alias is not defined"
#endif
static const struct device *const wdt = DEVICE_DT_GET(WDOG0_NODE);

int init_watchdog(void)
{
int ret;

ret = task_wdt_init(wdt);
if (ret < 0) {
LOG_ERR("Failed to init task watchdog: %d", ret);
return ret;
}
LOG_DBG("Watchdog initialized");

return 0;
}
12 changes: 12 additions & 0 deletions app/common/init/watchdog/watchdog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2025 PHYTEC
*
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef INIT_WATCHDOG_H
#define INIT_WATCHDOG_H

int init_watchdog(void);

#endif /* INIT_WATCHDOG_H */
2 changes: 2 additions & 0 deletions app/common/modules/audio_selcall/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/audio_selcall.c ${CMAKE_CURRENT_SOURCE_DIR}/selcall_tones.h)
target_include_directories(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../)
Loading