first commit
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_minimum_required(VERSION 3.20.0)
|
||||
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(hello_world)
|
||||
|
||||
target_sources(app PRIVATE src/main.c)
|
||||
@@ -0,0 +1,20 @@
|
||||
# Enable the logging framework
|
||||
CONFIG_LOG=y
|
||||
# Set the default logging level
|
||||
CONFIG_LOG_DEFAULT_LEVEL=3
|
||||
|
||||
#--- DEBUG PRESET - BEGIN ---#
|
||||
# Set to -Og
|
||||
CONFIG_DEBUG_OPTIMIZATIONS=y
|
||||
# Thread awareness support
|
||||
CONFIG_DEBUG_THREAD_INFO=y
|
||||
# Generate stack usage per-function
|
||||
CONFIG_STACK_USAGE=y
|
||||
# Other options in case not set by default
|
||||
CONFIG_BUILD_OUTPUT_HEX=y
|
||||
CONFIG_BUILD_OUTPUT_META=y
|
||||
CONFIG_OUTPUT_SYMBOLS=y
|
||||
CONFIG_OUTPUT_STAT=y
|
||||
CONFIG_OUTPUT_DISASSEMBLY=y
|
||||
CONFIG_OUTPUT_PRINT_MEMORY_USAGE=y
|
||||
#--- DEBUG PRESET - END ---#
|
||||
@@ -0,0 +1,15 @@
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/printk.h>
|
||||
|
||||
int main(void) {
|
||||
|
||||
printk("Hello World from Zephyr! %s\n", CONFIG_BOARD_TARGET);
|
||||
|
||||
if (IS_ENABLED(CONFIG_LOG)) {
|
||||
printk("Logging is enabled (level=%d)\n", CONFIG_LOG_DEFAULT_LEVEL);
|
||||
} else {
|
||||
printk("Logging is disabled\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user