Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@FIR-43: Added Zephyr logging and TSI application #3

Closed
wants to merge 4 commits into from
Closed
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
8 changes: 8 additions & 0 deletions tsi_app/m85/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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(m85)

target_sources(app PRIVATE src/main.c)
30 changes: 30 additions & 0 deletions tsi_app/m85/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. _m85:

TSI Banner
###########

Overview
********

This is the core TSI M85 Zephyr platform application startup code. It prints TSI Banner to the console, enables logging functionality so that developers can log messages to console at different levels of severity such as Info, Warning, Error & Debug. It also enables the shell functionality.

Building and Running
********************

This application can be built as follows:

.. zephyr-app-commands::
:zephyr-app: tsi_m85
:host-os: unix
:board: ek_tsi_skyp/m85
:goals: run
:compact:


Output
=============

.. code-block:: console
***** !! WELCOME TO TSAVORITE SCALABLE INTELLIGENCE !! *****
[00:00:00.010,000] <inf> tsi_m85: Test Platform: ek_tsi/skyp/m85
[00:00:00.020,000] <wrn> tsi_m85: Testing on FPGA; Multi module init TBD
9 changes: 9 additions & 0 deletions tsi_app/m85/overlay_deferred.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CONFIG_LOG_MODE_IMMEDIATE=n
CONFIG_LOG_MODE_DEFERRED=y
CONFIG_LOG_BUFFER_SIZE=1024
CONFIG_LOG_PROCESS_THREAD=y
CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=100
CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=2
CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=4096
atrivedi-tsavoritesi marked this conversation as resolved.
Show resolved Hide resolved
CONFIG_LOG_BLOCK_IN_THREAD=y
CONFIG_LOG_BACKEND_UART=y
1 change: 1 addition & 0 deletions tsi_app/m85/overlay_immediate.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_LOG_BACKEND_UART=y
18 changes: 18 additions & 0 deletions tsi_app/m85/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CONFIG_LOG=y
CONFIG_CONSOLE=y
CONFIG_LOG_PRINTK=y
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need this ?

CONFIG_UART_CONSOLE=y
CONFIG_SHELL=y
CONFIG_BOOT_BANNER=y
CONFIG_SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN=n
CONFIG_SHELL_BACKEND_SERIAL_RX_POLL_PERIOD=1
CONFIG_LOG_BACKEND_UART=y

# Use immediate mode so all messages are being
# printed. Under deferred mode, there may be
# dropped messages as there are quite a number of
# messages to be printed.
CONFIG_LOG_MODE_IMMEDIATE=y

# Need bigger stack for immediate mode
CONFIG_MAIN_STACK_SIZE=4096
29 changes: 29 additions & 0 deletions tsi_app/m85/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) 2012-2014 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <stddef.h>
#include <stdio.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/sys/printk.h>
#include <zephyr/logging/log_ctrl.h>
#include <zephyr/logging/log_output.h>

#define PRINT_TSI_BOOT_BANNER() printk("***** !! WELCOME TO TSAVORITE SCALABLE INTELLIGENCE !! *****\n")

Check warning on line 15 in tsi_app/m85/src/main.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LONG_LINE

tsi_app/m85/src/main.c:15 line length of 105 exceeds 100 columns
#define LOG_MODULE_NAME tsi_m85_
LOG_MODULE_REGISTER(LOG_MODULE_NAME);

int main(void)
{

/* TSI banner */
PRINT_TSI_BOOT_BANNER();
LOG_INF("Test Platform: %s",CONFIG_BOARD_TARGET);

Check failure on line 24 in tsi_app/m85/src/main.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

tsi_app/m85/src/main.c:24 code indent should use tabs where possible

Check warning on line 24 in tsi_app/m85/src/main.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

tsi_app/m85/src/main.c:24 please, no spaces at the start of a line

Check failure on line 24 in tsi_app/m85/src/main.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

SPACING

tsi_app/m85/src/main.c:24 space required after that ',' (ctx:VxV)

LOG_WRN("Testing on FPGA; Multi module init TBD");

Check failure on line 26 in tsi_app/m85/src/main.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

tsi_app/m85/src/main.c:26 code indent should use tabs where possible

Check warning on line 26 in tsi_app/m85/src/main.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

tsi_app/m85/src/main.c:26 please, no spaces at the start of a line

return 0;
}
17 changes: 17 additions & 0 deletions tsi_app/m85/tsi_m85.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
sample:
description: TSI Core platform application on M85
name: tsi_m85
common:
tags: introduction
integration_platforms:
- ek_tsi_skyp
harness: console
harness_config:
type: one_line
regex:
-***** !! WELCOME TO TSAVORITE SCALABLE INTELLIGENCE !! *****
- [00:00:00.010,000] <inf> tsi_m85: Test Platform: ek_tsi/skyp/m85

Check warning on line 13 in tsi_app/m85/tsi_m85.yaml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

YAMLLint (None)

tsi_app/m85/tsi_m85.yaml:13 syntax error: mapping values are not allowed here (syntax)
- [00:00:00.020,000] <wrn> tsi_m85: Testing on FPGA; Multi module init TBD
tests:
sample.m85:
tags: apps
Loading