Skip to content

Commit

Permalink
Merge branch 'update-workflows' into add-coding-convention-check-work…
Browse files Browse the repository at this point in the history
…flow
  • Loading branch information
silabs-bingocth authored Oct 9, 2024
2 parents f832f8f + 0bc4033 commit e5a170d
Show file tree
Hide file tree
Showing 3,590 changed files with 1,903,106 additions and 7 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
19 changes: 19 additions & 0 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Hello World Workflow

on:
push:
branches:
- "*"
pull_request:
workflow_dispatch:

jobs:
print_hello:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Print Hello World
run: echo "Hello, World!"

163 changes: 163 additions & 0 deletions .github/workflows/generate_firmware.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: Generate Firmware
on:
push:
branches:
- '*' # matches every branch that doesn't contain a '/'
- '*/*' # matches every branch containing a single '/'
- '**' # matches every branch

env:
AM_CORRETTO_17: https://corretto.aws/downloads/latest/amazon-corretto-17-x64-linux-jdk.tar.gz
SLC_CLI_URL: https://www.silabs.com/documents/login/software/slc_cli_linux.zip
COMMANDER_URL: https://www.silabs.com/documents/login/software/SimplicityCommander-Linux.zip
GCC_URL: https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz
SIM_REPO: https://github.com/SiliconLabs/simplicity_sdk.git
GECKO_SDK_REPO: https://github.com/SiliconLabs/gecko_sdk.git
SDK_VER: v4.4.2
JLINK_SEGGER_URL: https://www.segger.com/downloads/jlink/JLink_Linux_x86_64.tgz
TOOL_DIRS: /home/sqa/SimplicityStudio-5/SimplicityStudio_v5/developer/toolchains/gnu_arm/10.3_2021.10/bin
SDK_PATH: /home/sqa/SimplicityStudio/SDKs/gecko_sdk
TOOL_CHAINS: GCC
START_ADDR_FLASH: 0x8000000
BOARD_NAME: brd4187c
TASK: gen-only
jobs:
job1:
name: Generate Firmware
runs-on: ubuntu-20.04
permissions:
contents: read
pull-requests: write
env:
HOST_IP: 192.168.1.69
COMPILER: GCC
PLATFORM: MG12
APP_TYPE: SecureApp
SECURITY: APP_SECURE=false
COMMAND: all
COMPONENT: all
ADAPTER_SN: 440133193
OPTION_INTEGRATION_TEST: -DENABLE_CAL_CRC_32=ON -DENABLE_CRC_USE_SW=ON -DTEST_SECURE_PERIPHERALS_ENABLE=ON -DINTEGRATION_TEST_WDOG1_ENABLE=ON - INTEGRATION_TEST_USE_MARCHX_DISABLE=ON
steps:
- name: Checkout
uses: actions/[email protected]
with:
ref: create-unit-test-functions-in-lib-iec60730
- name: Install Simplicity SDK
if: always()
run: |
git clone $SIM_REPO
cd simplicity_sdk
ls -la
cd ..
ls -la
- name: Install Gecko SDK
if: always()
run: |
git clone $GECKO_SDK_REPO gecko_sdk_$SDK_VER
cd gecko_sdk_$SDK_VER
git checkout tags/$SDK_VER
ls -la
mkdir extension
cd extension
git clone https://github.com/SiliconLabs/IEC60730_Libs.git
cd IEC60730_Libs
git checkout create-unit-test-functions-in-lib-iec60730
ls -la
cd ..
ls -la
cd ..
ls -la
- name: Install Amazon Corretto 17
if: always()
run: |
wget $AM_CORRETTO_17
tar -xzf amazon-corretto-17-x64-linux-jdk.tar.gz
ls -la
- name: Install SLC CLI
if: always()
run: |
wget $SLC_CLI_URL
unzip slc_cli_linux.zip
ls -la
- name: Install Simplicity Commander
if: always()
run: |
wget $COMMANDER_URL
unzip SimplicityCommander-Linux.zip
cd SimplicityCommander-Linux
ls -la
cd ..
mkdir commander
tar -xf SimplicityCommander-Linux/Commander_linux_x86_64_*.tar.bz commander
cd commander
ls -la
- name: Install GCC
if: always()
run: |
wget $GCC_URL
tar -xf arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz
ls -la
cd arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi
ls -la
- name: Install Ninja build
run: |
sudo apt update
sudo apt -y install ninja-build
ninja --version
- name: Install python3.11
if: always()
run: |
sudo apt update
sudo apt upgrade
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt update
sudo apt install python3.11
python3.11 --version
which python3.11
cat ~/.bashrc
echo "alias python3=python3.11" >> ~/.bashrc
echo "alias python3=python3.11" >> ~/.bash_profile
cat ~/.bashrc
source ~/.bash_profile
source ~/.bashrc
python3 --version
sudo apt install python3.11-full
sudo apt install python3-pip
- name: Generate image
run: |
export PATH=$PATH:$PWD/commander
export PATH=$PATH:$PWD/slc_cli
export JLINK_PATH=/opt/SEGGER/JLink/libjlinkarm.so
export TOOL_DIRS=$PWD/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin
export PATH=$PATH:/usr/bin/
export SDK_PATH=$PWD/gecko_sdk_$SDK_VER
export PATH=$PATH:$PWD/amazon-corretto-17.0.12.7.1-linux-x64/bin
echo $PATH
echo 2 | sudo update-alternatives --config java
java --version
slc --version
slc configuration --sdk=${SDK_PATH}
ninja --version
slc signature trust --sdk $SDK_PATH
slc configuration -gcc=$TOOL_DIRS
make prepare
cd build
slc signature trust -extpath $SDK_PATH/extension/IEC60730_Libs
cmake --toolchain ../cmake/toolchain.cmake .. -DENABLE_INTEGRATION_TESTING=ON -DBOARD_NAME=$BOARD_NAME
cmake --build . --target integration_test_info -j4
export CHIP=EFR32MG24BXXXF1536 ADAPTER_SN=440133193
export LST_PATH=$PWD/test/integration_test/build/brd4187c/integration_test_iec60730_watchdog/S
export JLINK_PATH=/opt/SEGGER/JLink/libjlinkarm.so
export HOST_IP=192.168.1.69
bash execute_test.sh $BOARD_NAME $TASK $COMPONENT $ADAPTER_SN $GCC $OPTION_INTEGRATION_TEST
- name: Upload firmware
uses: actions/[email protected]
with:
name: firmware
path: ${{ github.workspace }}/build/test/integration_test/build/${{ env.BOARD_NAME }}/integration_test_iec60730_invariable_memory/NS/
warn: Output a warning but do not fail the action
retention-days: 90



4 changes: 4 additions & 0 deletions .github/workflows/manual_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
if: github.event.inputs.test_mg12 == 'true'
name: GCC-MG12 regression test
runs-on: [self-hosted, sqa-ds-hn-006]
timeout-minutes: 30
permissions:
contents: read
pull-requests: write
Expand Down Expand Up @@ -128,6 +129,7 @@ jobs:
needs: [job1]
name: GCC-MG24 regression test
runs-on: [self-hosted, sqa-ds-hn-006]
timeout-minutes: 30
permissions:
contents: read
pull-requests: write
Expand Down Expand Up @@ -197,6 +199,7 @@ jobs:
needs: [job1, job2]
name: IAR-MG12 regression test
runs-on: [self-hosted, sqa-ds-hn-006]
timeout-minutes: 30
permissions:
contents: read
pull-requests: write
Expand Down Expand Up @@ -266,6 +269,7 @@ jobs:
needs: [job1, job2, job3]
name: IAR-MG24 regression test
runs-on: [self-hosted, sqa-ds-hn-006]
timeout-minutes: 0
permissions:
contents: read
pull-requests: write
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/unit_test_auto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Unit Tests Auto Trigger
on:
push:
branches:
- '*' # matches every branch that doesn't contain a '/'
- '*/*' # matches every branch containing a single '/'
- '**' # matches every branc
workflow_dispatch:
inputs:
branch:
description: 'Branch to test'
type: string
default: 'main'
jobs:
job1:
name: Unit test
runs-on: [self-hosted, ds-sqa-hn-iec]
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/[email protected]
with:
ref: create-unit-test-functions-in-lib-iec60730
- name: Unit Testing
run: |
export PATH=$PATH:/home/sqa/SimplicityStudio-5/SimplicityStudio_v5/developer/adapter_packs/commander
export PATH=$PATH:~/slc_cli
export JLINK_PATH=/opt/SEGGER/JLink/libjlinkarm.so
export TOOL_DIRS=/home/sqa/SimplicityStudio-5/SimplicityStudio_v5/developer/toolchains/gnu_arm/12.2.rel1_2023.7/bin
export PATH=$PATH:/usr/bin/
export SDK_PATH=/home/sqa/SimplicityStudio/SDKs/gecko_sdk
export PATH=$PATH:/home/sqa/amazon-corretto-17.0.12.7.1-linux-x64/bin
export START_ADDR_FLASH=0x8000000
export CHIP=EFR32MG12
export ADAPTER_SN=440189400
export LST_PATH=~/devs_cooper_lighting_safty_lib/build/test/integration_test/build/brd4187c/integration_test_iec60730_watchdog/S
export HOST_IP=192.168.1.69
slc configuration --sdk=${SDK_PATH}
ninja --version
slc signature trust --sdk $SDK_PATH
slc configuration -gcc=$TOOL_DIRS
make prepare
cd build
slc signature trust -extpath /home/sqa/SimplicityStudio/SDKs/gecko_sdk/extension/devs_cooper_lighting_safty_lib
cmake --toolchain ../cmake/toolchain.cmake .. -DENABLE_UNIT_TESTING=ON -DBOARD_NAME=brd4161a
make unit_test_info -j4
cd ../test
ls -la
bash execute_unit_test.sh brd4161a all all $ADAPTER_SN GCC
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.json
GNU ARM */
build
test/test_script/__pycache__
doc/html/EFR32_ICE60730_Libraries/latex
*.temp-stream*
gecko_sdk/src/*
!gecko_sdk/src/CMakeLists.txt
cmake_build
log/
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
exclude: ^(Doc/|Build/|artifact|Lib/asm|Lib/CMSIS|Lib/Device/efm32pg22|Lib/Device/efr32bg22|Lib/Device/efr32fg22|Lib/Device/efr32fg23|Lib/Device/efr32mg12p|Lib/Device/efr32mg21|Lib/Device/efr32mg22|Lib/Device/efr32mg24|Lib/Device/efr32zg23|Make|Test/test_script|Test/test_compile|Test/test_script|Test/artifact|Test/comm/emlib|Lib/inc/coding_standard.h|Releases)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
args: [-w,--config,./tools/.codespell/.codespellrc]
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.3.5
hooks:
- id: clang-format
args: [-i,--style=file:./tools/.clang-format]
- id: cppcheck
args: [--language=c,--std=c99,--check-config,-DIEC_BOARD_HEADER="sl_iec60730_board.h",-DEFR32MG24_DEVICE,-D__CM33_REV,--suppress=missingInclude,--suppress=unmatchedSuppression]
68 changes: 68 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Define minimal required version of CMake.
cmake_minimum_required(VERSION "3.25")

# Project definition
project(
IE60730_LIBRARY
VERSION 1.2.0
LANGUAGES C ASM CXX
)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED OFF)
set(CMAKE_CXX_EXTENSIONS OFF)

set(LIBRARY_NAME iec60730)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
set(LIB_IEC60730_MAP "lib_iec60730.map")
set(SDK_CMAKE_RELATIVE_DIR "gecko_sdk")
set(SDK_LIB_CMAKE_RELATIVE_DIR "${SDK_CMAKE_RELATIVE_DIR}/src/lib_iec60730_cmake")

# choose toolchain
if(DEFINED ENV{TOOL_CHAINS})
set(TOOL_CHAINS "$ENV{TOOL_CHAINS}")
else()
set(TOOL_CHAINS "GCC")
endif()
message("-- Toolchains build: ${TOOL_CHAINS}")

# enable unit test
option(ENABLE_UNIT_TESTING "Enable a Unit Testing Build" OFF)

# choose board name
option(BOARD_NAME "choose board name" brd4187c)
message("-- Board name: ${BOARD_NAME}")

#Add external libraries with Fetch Content
include(FetchContent)

if(ENABLE_UNIT_TESTING)
FetchContent_Declare(
unity
GIT_REPOSITORY https://github.com/ThrowTheSwitch/Unity
GIT_TAG v2.6.0
GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(unity)
endif()

add_subdirectory(lib)
add_subdirectory(test)
# Run Make file
include(makefile)

if(ENABLE_UNIT_TESTING)

# Run generate_lib_iec60730
include(generate_lib_iec60730)

generate_lib_iec60730(${SDK_CMAKE_RELATIVE_DIR})
get_target_property(MAIN_CFLAGS_LIB_IEC60730 slc_lib_iec60730 COMPILE_OPTIONS)
string(REPLACE "$<$<COMPILE_LANGUAGE:C>:SHELL:-imacros sl_gcc_preinclude.h>;" "" MAIN_CFLAGS_LIB_IEC60730 "${MAIN_CFLAGS_LIB_IEC60730}")
string(REPLACE "$<$<COMPILE_LANGUAGE:CXX>:SHELL:-imacros sl_gcc_preinclude.h>;" "" MAIN_CFLAGS_LIB_IEC60730 "${MAIN_CFLAGS_LIB_IEC60730}")
string(REPLACE "$<$<COMPILE_LANGUAGE:ASM>:SHELL:-imacros sl_gcc_preinclude.h>;" "" MAIN_CFLAGS_LIB_IEC60730 "${MAIN_CFLAGS_LIB_IEC60730}")
target_compile_options(unity PUBLIC
${MAIN_CFLAGS_LIB_IEC60730})

endif()


Binary file not shown.
Binary file not shown.
Binary file added Doc/html/EFR32 ICE60730 Libraries.7z
Binary file not shown.
Binary file added Doc/images/BIST_flowchart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/images/BIST_system_clock_frequency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/images/Watchdog_flowchart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/images/comm_plausibility_check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/images/cpu_registers_check_flowchart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/images/irq_plausibility_test_flowchart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/images/post_flowchart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/images/programme_counter_check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e5a170d

Please sign in to comment.