Skip to content

Commit

Permalink
FIR-442: M85 Banner and Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
M.Mankal-TSI committed Dec 24, 2024
1 parent 558afee commit 20649c5
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tsi_core/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)
29 changes: 29 additions & 0 deletions tsi_core/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. _m85:

TSI Banner

Check failure on line 3 in tsi_core/README.rst

View workflow job for this annotation

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

TRAILING_WHITESPACE

tsi_core/README.rst:3 trailing whitespace
###########

Overview
********

This is the core M85 Zephyr platform and initial startup code. It prints TSI Banner to the console by invocation of Zephyr main. This module also enables the logging functionality to log messages to console at different levels of severity such as Info, Warning, Error & Debug.

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

This application can be built as follows:

.. zephyr-app-commands::
:zephyr-app:

Check failure on line 17 in tsi_core/README.rst

View workflow job for this annotation

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

TRAILING_WHITESPACE

tsi_core/README.rst:17 trailing whitespace
:host-os: unix
:board: ek_tsi_skyp/m85

Check failure on line 19 in tsi_core/README.rst

View workflow job for this annotation

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

TRAILING_WHITESPACE

tsi_core/README.rst:19 trailing whitespace
:goals: run
:compact:


Sample Output
=============

.. code-block:: console
!! Welcome to TSI Platform !!

Check failure on line 29 in tsi_core/README.rst

View workflow job for this annotation

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

TRAILING_WHITESPACE

tsi_core/README.rst:29 trailing whitespace
11 changes: 11 additions & 0 deletions tsi_core/overlay_deferred.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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
CONFIG_LOG_BLOCK_IN_THREAD=y
CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_MIPI_SYST_ENABLE=y
CONFIG_LOG_BACKEND_UART_OUTPUT_SYST=y
3 changes: 3 additions & 0 deletions tsi_core/overlay_immediate.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_MIPI_SYST_ENABLE=y
CONFIG_LOG_BACKEND_UART_OUTPUT_SYST=y
19 changes: 19 additions & 0 deletions tsi_core/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CONFIG_LOG=y
CONFIG_CONSOLE=y
CONFIG_LOG_PRINTK=y
CONFIG_UART_CONSOLE=y
CONFIG_SHELL=n
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
4 changes: 4 additions & 0 deletions tsi_core/prj_poll.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CONFIG_SHELL=y
CONFIG_SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN=n
CONFIG_SHELL_BACKEND_SERIAL_RX_POLL_PERIOD=1
CONFIG_BOOT_BANNER=n
15 changes: 15 additions & 0 deletions tsi_core/sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
sample:
description: TSI Core platform - M85

Check warning on line 2 in tsi_core/sample.yaml

View workflow job for this annotation

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

YAMLLint (trailing-spaces)

tsi_core/sample.yaml:2 trailing spaces

Check failure on line 2 in tsi_core/sample.yaml

View workflow job for this annotation

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

TRAILING_WHITESPACE

tsi_core/sample.yaml:2 trailing whitespace
name: m85

Check warning on line 3 in tsi_core/sample.yaml

View workflow job for this annotation

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

YAMLLint (trailing-spaces)

tsi_core/sample.yaml:3 trailing spaces

Check failure on line 3 in tsi_core/sample.yaml

View workflow job for this annotation

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

TRAILING_WHITESPACE

tsi_core/sample.yaml:3 trailing whitespace
common:
tags: introduction
integration_platforms:
- ek_tsi_skyp

Check warning on line 7 in tsi_core/sample.yaml

View workflow job for this annotation

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

YAMLLint (trailing-spaces)

tsi_core/sample.yaml:7 trailing spaces

Check failure on line 7 in tsi_core/sample.yaml

View workflow job for this annotation

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

TRAILING_WHITESPACE

tsi_core/sample.yaml:7 trailing whitespace
harness: console
harness_config:
type: one_line
regex:
- "Welcome to TSI!"
tests:
sample.m85:
tags: introduction
48 changes: 48 additions & 0 deletions tsi_core/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2024-2025 TSI

Check failure on line 2 in tsi_core/src/main.c

View workflow job for this annotation

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

TRAILING_WHITESPACE

tsi_core/src/main.c:2 trailing whitespace
*
*/


#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 DATA_MAX_DLEN 8
#define LOG_MODULE_NAME m85

Check failure on line 16 in tsi_core/src/main.c

View workflow job for this annotation

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

TRAILING_WHITESPACE

tsi_core/src/main.c:16 trailing whitespace
LOG_MODULE_REGISTER(LOG_MODULE_NAME);
#define PRINT_TSI_BOOT_BANNER() printk(" Tsavorite Scalable Intelligence \n")

Check warning on line 18 in tsi_core/src/main.c

View workflow job for this annotation

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

QUOTED_WHITESPACE_BEFORE_NEWLINE

tsi_core/src/main.c:18 unnecessary whitespace before a quoted newline

int main(void)
{

/* TSI banner */
PRINT_TSI_BOOT_BANNER();
printf("\n");
printf(" |||||||||||||||||||||||||||||||||||||\n");;

Check warning on line 26 in tsi_core/src/main.c

View workflow job for this annotation

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

ONE_SEMICOLON

tsi_core/src/main.c:26 Statements terminations use 1 semicolon
printf(" ||||||||||||||||||||||||||||||||||||| \n");

Check warning on line 27 in tsi_core/src/main.c

View workflow job for this annotation

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

QUOTED_WHITESPACE_BEFORE_NEWLINE

tsi_core/src/main.c:27 unnecessary whitespace before a quoted newline
printf(" |||||| |||||\n");
printf(" |||||| ||||| \n");

Check warning on line 29 in tsi_core/src/main.c

View workflow job for this annotation

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

QUOTED_WHITESPACE_BEFORE_NEWLINE

tsi_core/src/main.c:29 unnecessary whitespace before a quoted newline
printf(" ||||||||||||||||| ||||| ||||| \n");

Check warning on line 30 in tsi_core/src/main.c

View workflow job for this annotation

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

QUOTED_WHITESPACE_BEFORE_NEWLINE

tsi_core/src/main.c:30 unnecessary whitespace before a quoted newline
printf(" ||||||||||||||||| ||||| |||||\n");
printf(" |||||| |||||\n");
printf(" |||||| |||||| ||||| ||||||\n");
printf(" |||||||| |||||| ||||| ||||||||\n");
printf(" |||||||||||||| ||||||||||||||\n");
printf(" ||||||||||| ||||||||||||\n");
printf(" ||||||||| ||||||||||\n");
printf(" ||||||| ||||||||\n");
printf(" ||||| |||||\n");
printf(" ||| |||\n");
printf(" |\n");

LOG_INF("Test Platform: %s",CONFIG_BOARD_TARGET);

Check failure on line 43 in tsi_core/src/main.c

View workflow job for this annotation

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

CODE_INDENT

tsi_core/src/main.c:43 code indent should use tabs where possible

Check warning on line 43 in tsi_core/src/main.c

View workflow job for this annotation

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

LEADING_SPACE

tsi_core/src/main.c:43 please, no spaces at the start of a line
LOG_WRN("Testing on FPGA");

Check warning on line 44 in tsi_core/src/main.c

View workflow job for this annotation

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

LEADING_SPACE

tsi_core/src/main.c:44 please, no spaces at the start of a line
printk("TSI Logging enabled and printk is functional\n");

return 0;
}

0 comments on commit 20649c5

Please sign in to comment.