From 790d72ce4d116a3cb87934843dfd9975f1624402 Mon Sep 17 00:00:00 2001 From: Sourabh Mehta Date: Thu, 20 Jul 2023 14:01:04 +0200 Subject: [PATCH] Removed installer creation --- .github/ISSUE_TEMPLATE/blocker.yaml | 84 ------ .github/ISSUE_TEMPLATE/bug.yaml | 78 ------ .github/workflows/toolbox.yml | 348 ++++++++++++------------ .gitmodules | 5 - CMakeLists.txt | 26 -- README.md | 5 - docs/YML-CBuild-Format.md | 91 ++++++- docs/YML-Input-Format.md | 392 ++++++++++++++++++++++------ docs/build-operation.md | 2 +- docs/build-overview.md | 85 +++--- docs/build-tools.md | 13 +- docs/installation.md | 191 +++++--------- docs/migration.md | 64 ----- docs/pack-tools.md | 3 +- docs/progress.md | 4 +- external/open-cmsis-pack-devtools | 1 - installer/create_installer.sh | 91 ------- installer/install.sh | 351 ------------------------- test/CMakeLists.txt | 19 -- test/scripts/installer_run.sh | 84 ------ test/src/InstallerTests.cpp | 182 ------------- test/src/ToolboxTestEnv.cpp | 41 --- test/src/ToolboxTestEnv.h | 34 --- test/tests.py | 34 +++ 24 files changed, 729 insertions(+), 1499 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/blocker.yaml delete mode 100644 .github/ISSUE_TEMPLATE/bug.yaml delete mode 100644 .gitmodules delete mode 100644 CMakeLists.txt delete mode 100644 docs/migration.md delete mode 160000 external/open-cmsis-pack-devtools delete mode 100755 installer/create_installer.sh delete mode 100755 installer/install.sh delete mode 100644 test/CMakeLists.txt delete mode 100755 test/scripts/installer_run.sh delete mode 100644 test/src/InstallerTests.cpp delete mode 100644 test/src/ToolboxTestEnv.cpp delete mode 100644 test/src/ToolboxTestEnv.h create mode 100644 test/tests.py diff --git a/.github/ISSUE_TEMPLATE/blocker.yaml b/.github/ISSUE_TEMPLATE/blocker.yaml deleted file mode 100644 index ae740b2..0000000 --- a/.github/ISSUE_TEMPLATE/blocker.yaml +++ /dev/null @@ -1,84 +0,0 @@ -name: Blocking Bug Report -description: File a report for a blocking bug, i.e., issues that can't be worked around. -title: "[Blocker]: " -labels: ["bug", "critical"] -body: - - type: checkboxes - attributes: - label: Is there an existing issue for this? - description: Please search to see if an issue already exists for the bug you encountered. - options: - - label: I have searched the existing issues - required: true - - type: textarea - attributes: - label: Unusable feature - description: Which feature(s) of CMSIS-Toolbox becomes unusable due to this bug? - validations: - required: true - - type: textarea - attributes: - label: Current Behavior - description: A concise description of what you're experiencing. - validations: - required: true - - type: textarea - attributes: - label: Expected Behavior - description: A concise description of what you expected to happen. - validations: - required: true - - type: textarea - attributes: - label: Steps To Reproduce - description: Steps to reproduce the behavior. - placeholder: | - 1. In this environment... - 1. With this config... - 1. Run '...' - 1. See error... - validations: - required: false - - type: checkboxes - attributes: - label: Affected tools - description: Which tools are affected by this bug? - options: - - label: cbuild - required: false - - label: cbuild-gen - required: false - - label: cpackget - required: false - - label: csolution - required: false - - label: packchk - required: false - - label: svdconv - required: false - - type: checkboxes - attributes: - label: Affected operating systems - description: On which host os platforms does the bug occur? - options: - - label: Windows amd64 - required: false - - label: Windows arm64 - required: false - - label: Linux amd64 - required: false - - label: Linux arm64 - required: false - - label: MacOS amd64 - required: false - - label: MacOS arm64 - required: false - - type: textarea - attributes: - label: Environment - description: Give more details about the affected operating system(s), e.g. distribution and version. - placeholder: | - - Ubuntu 22.04 - - Windows 10 Version 22H2 (Build ...) - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/bug.yaml b/.github/ISSUE_TEMPLATE/bug.yaml deleted file mode 100644 index ee2f24e..0000000 --- a/.github/ISSUE_TEMPLATE/bug.yaml +++ /dev/null @@ -1,78 +0,0 @@ -name: Bug Report -description: File a report for a non-blocking bug, i.e., issues that can be worked around. -title: "[Bug]: " -labels: ["bug"] -body: - - type: checkboxes - attributes: - label: Is there an existing issue for this? - description: Please search to see if an issue already exists for the bug you encountered. - options: - - label: I have searched the existing issues - required: true - - type: textarea - attributes: - label: Current Behavior - description: A concise description of what you're experiencing. - validations: - required: false - - type: textarea - attributes: - label: Expected Behavior - description: A concise description of what you expected to happen. - validations: - required: false - - type: textarea - attributes: - label: Steps To Reproduce - description: Steps to reproduce the behavior. - placeholder: | - 1. In this environment... - 1. With this config... - 1. Run '...' - 1. See error... - validations: - required: false - - type: checkboxes - attributes: - label: Affected tools - description: Which tools are affected by this bug? - options: - - label: cbuild - required: false - - label: cbuild-gen - required: false - - label: cpackget - required: false - - label: csolution - required: false - - label: packchk - required: false - - label: svdconv - required: false - - type: checkboxes - attributes: - label: Affected operating systems - description: On which host os platforms does the bug occur? - options: - - label: Windows amd64 - required: false - - label: Windows arm64 - required: false - - label: Linux amd64 - required: false - - label: Linux arm64 - required: false - - label: MacOS amd64 - required: false - - label: MacOS arm64 - required: false - - type: textarea - attributes: - label: Environment - description: Give more details about the affected operating system(s), e.g. distribution and version. - placeholder: | - - Ubuntu 22.04 - - Windows 10 Version 22H2 (Build ...) - validations: - required: false diff --git a/.github/workflows/toolbox.yml b/.github/workflows/toolbox.yml index dcfbaa7..3b15136 100644 --- a/.github/workflows/toolbox.yml +++ b/.github/workflows/toolbox.yml @@ -5,18 +5,16 @@ on: - main paths: - '.github/workflows/toolbox.yml' - - 'CMakeLists.txt' - '**' pull_request: paths: - '.github/workflows/toolbox.yml' - - 'CMakeLists.txt' - '**' release: types: [published] jobs: - create_installer: + create_archives: if: | ${{ github.event_name == 'pull_request' || github.event_name == 'release' }} runs-on: ubuntu-20.04 @@ -30,6 +28,7 @@ jobs: run: | mkdir -p toolbox/cbuild mkdir -p toolbox/packchk + mkdir -p toolbox/svdconv mkdir -p toolbox/distribution/bin mkdir -p toolbox/distribution/etc mkdir -p toolbox/distribution/doc @@ -92,111 +91,196 @@ jobs: sudo chown -R root:root * working-directory: toolbox/distribution - - name: Create installer - id: installer + - name: Copy files separated by target for archiving run: | - export VERSION=$(echo ${{ github.ref }} | cut -d/ -f5) - ./create_installer.sh --input=../toolbox/distribution --output=. --version=$VERSION - working-directory: installer + mkdir -p zip/cmsis-toolbox-windows-amd64/bin zip/cmsis-toolbox-windows-amd64/etc zip/cmsis-toolbox-windows-amd64/doc + mkdir -p zip/cmsis-toolbox-windows-arm64/bin zip/cmsis-toolbox-windows-arm64/etc zip/cmsis-toolbox-windows-arm64/doc + mkdir -p zip/cmsis-toolbox-linux-amd64/bin zip/cmsis-toolbox-linux-amd64/etc zip/cmsis-toolbox-linux-amd64/doc + mkdir -p zip/cmsis-toolbox-linux-arm64/bin zip/cmsis-toolbox-linux-arm64/etc zip/cmsis-toolbox-linux-arm64/doc + mkdir -p zip/cmsis-toolbox-darwin-amd64/bin zip/cmsis-toolbox-darwin-amd64/etc zip/cmsis-toolbox-darwin-amd64/doc + mkdir -p zip/cmsis-toolbox-darwin-arm64/bin zip/cmsis-toolbox-darwin-arm64/etc zip/cmsis-toolbox-darwin-arm64/doc + cp distribution/bin/cbuild.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/cbuild.exe + cp distribution/bin/cbuildgen.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/cbuildgen.exe + cp distribution/bin/cpackget.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/cpackget.exe + cp distribution/bin/csolution.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/csolution.exe + cp distribution/bin/packchk.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/packchk.exe + cp distribution/bin/svdconv.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/svdconv.exe + cp distribution/bin/cbuild.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/cbuild.exe + cp distribution/bin/cbuildgen.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/cbuildgen.exe + cp distribution/bin/cpackget.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/cpackget.exe + cp distribution/bin/csolution.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/csolution.exe + cp distribution/bin/packchk.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/packchk.exe + cp distribution/bin/svdconv.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/svdconv.exe + cp distribution/bin/cbuild.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/cbuild + cp distribution/bin/cbuildgen.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/cbuildgen + cp distribution/bin/cpackget.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/cpackget + cp distribution/bin/csolution.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/csolution + cp distribution/bin/packchk.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/packchk + cp distribution/bin/svdconv.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/svdconv + cp distribution/bin/cbuild.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/cbuild + cp distribution/bin/cbuildgen.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/cbuildgen + cp distribution/bin/cpackget.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/cpackget + cp distribution/bin/csolution.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/csolution + cp distribution/bin/packchk.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/packchk + cp distribution/bin/svdconv.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/svdconv + cp distribution/bin/cbuild.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/cbuild + cp distribution/bin/cbuildgen.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/cbuildgen + cp distribution/bin/cpackget.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/cpackget + cp distribution/bin/csolution.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/csolution + cp distribution/bin/packchk.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/packchk + cp distribution/bin/svdconv.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/svdconv + cp distribution/bin/cbuild.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/cbuild + cp distribution/bin/cbuildgen.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/cbuildgen + cp distribution/bin/cpackget.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/cpackget + cp distribution/bin/csolution.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/csolution + cp distribution/bin/packchk.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/packchk + cp distribution/bin/svdconv.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/svdconv + cp distribution/LICENSE.txt zip/cmsis-toolbox-windows-amd64/LICENSE.txt + cp distribution/LICENSE.txt zip/cmsis-toolbox-windows-arm64/LICENSE.txt + cp distribution/LICENSE.txt zip/cmsis-toolbox-linux-amd64/LICENSE.txt + cp distribution/LICENSE.txt zip/cmsis-toolbox-linux-arm64/LICENSE.txt + cp distribution/LICENSE.txt zip/cmsis-toolbox-darwin-amd64/LICENSE.txt + cp distribution/LICENSE.txt zip/cmsis-toolbox-darwin-arm64/LICENSE.txt + cp -r distribution/etc/* zip/cmsis-toolbox-windows-amd64/etc + cp -r distribution/etc/* zip/cmsis-toolbox-windows-arm64/etc + cp -r distribution/etc/* zip/cmsis-toolbox-linux-amd64/etc + cp -r distribution/etc/* zip/cmsis-toolbox-linux-arm64/etc + cp -r distribution/etc/* zip/cmsis-toolbox-darwin-amd64/etc + cp -r distribution/etc/* zip/cmsis-toolbox-darwin-arm64/etc + cp -r distribution/doc/* zip/cmsis-toolbox-windows-amd64/doc + cp -r distribution/doc/* zip/cmsis-toolbox-windows-arm64/doc + cp -r distribution/doc/* zip/cmsis-toolbox-linux-amd64/doc + cp -r distribution/doc/* zip/cmsis-toolbox-linux-arm64/doc + cp -r distribution/doc/* zip/cmsis-toolbox-darwin-amd64/doc + cp -r distribution/doc/* zip/cmsis-toolbox-darwin-arm64/doc + working-directory: toolbox - - name: Archive cmsis-toolbox installer - uses: actions/upload-artifact@v2 + - name: Set toolchain default paths + run: | + ./scripts/set-default.sh Windows toolbox/zip/cmsis-toolbox-windows-amd64/etc + ./scripts/set-default.sh Windows toolbox/zip/cmsis-toolbox-windows-arm64/etc + ./scripts/set-default.sh Linux toolbox/zip/cmsis-toolbox-linux-amd64/etc + ./scripts/set-default.sh Linux toolbox/zip/cmsis-toolbox-linux-arm64/etc + ./scripts/set-default.sh Darwin toolbox/zip/cmsis-toolbox-darwin-amd64/etc + ./scripts/set-default.sh Darwin toolbox/zip/cmsis-toolbox-darwin-arm64/etc + + - name: Zip folders + run: | + zip -r cmsis-toolbox-windows-amd64.zip cmsis-toolbox-windows-amd64 + zip -r cmsis-toolbox-windows-arm64.zip cmsis-toolbox-windows-arm64 + tar -czvf cmsis-toolbox-linux-amd64.tar.gz cmsis-toolbox-linux-amd64 + tar -czvf cmsis-toolbox-linux-arm64.tar.gz cmsis-toolbox-linux-arm64 + tar -czvf cmsis-toolbox-darwin-amd64.tar.gz cmsis-toolbox-darwin-amd64 + tar -czvf cmsis-toolbox-darwin-arm64.tar.gz cmsis-toolbox-darwin-arm64 + working-directory: toolbox/zip + + - name: Archive windows amd64 binaries + uses: actions/upload-artifact@v3 + with: + name: cmsis-toolbox-windows-amd64 + path: ./toolbox/zip/cmsis-toolbox-windows-amd64.zip + retention-days: 1 + if-no-files-found: error + + - name: Archive windows arm64 binaries + uses: actions/upload-artifact@v3 + with: + name: cmsis-toolbox-windows-arm64 + path: ./toolbox/zip/cmsis-toolbox-windows-arm64.zip + retention-days: 1 + if-no-files-found: error + + - name: Archive linux amd64 binaries + uses: actions/upload-artifact@v3 + with: + name: cmsis-toolbox-linux-amd64 + path: ./toolbox/zip/cmsis-toolbox-linux-amd64.tar.gz + retention-days: 1 + if-no-files-found: error + + - name: Archive linux arm64 binaries + uses: actions/upload-artifact@v3 with: - name: cmsis-toolbox - path: installer/cmsis-toolbox.sh + name: cmsis-toolbox-linux-arm64 + path: ./toolbox/zip/cmsis-toolbox-linux-arm64.tar.gz + retention-days: 1 + if-no-files-found: error + + - name: Archive darwin amd64 binaries + uses: actions/upload-artifact@v3 + with: + name: cmsis-toolbox-darwin-amd64 + path: ./toolbox/zip/cmsis-toolbox-darwin-amd64.tar.gz + retention-days: 1 + if-no-files-found: error + + - name: Archive darwin arm64 binaries + uses: actions/upload-artifact@v3 + with: + name: cmsis-toolbox-darwin-arm64 + path: ./toolbox/zip/cmsis-toolbox-darwin-arm64.tar.gz retention-days: 1 if-no-files-found: error tests: if: | ${{ github.event_name == 'pull_request' || github.event_name == 'release' }} - needs: [ create_installer ] + needs: [ create_archives ] timeout-minutes: 15 runs-on: ${{ matrix.config.os }} - env: - CI_TOOLBOX_INSTALLER: ${{ github.workspace }}/cmsis-toolbox.sh strategy: fail-fast: true matrix: config: - - { os: macos-12, target: darwin64, arch: amd64 } - - { os: macos-12, target: darwin64, arch: arm64 } - - { os: windows-2019, target: windows64, arch: amd64} - - { os: windows-2019, target: windows64, arch: arm64} - - { os: ubuntu-20.04, target: linux64, arch: amd64} - - { os: ubuntu-20.04, target: linux64, arch: arm64} + - { os: macos-12, target: darwin, arch: amd64 } + - { os: macos-12, target: darwin, arch: arm64 } + - { os: windows-2019, target: windows, arch: amd64} + - { os: windows-2019, target: windows, arch: arm64} + - { os: ubuntu-20.04, target: linux, arch: amd64} + - { os: ubuntu-20.04, target: linux, arch: arm64} steps: - - name: Install macos deps - if: ${{ startsWith(matrix.config.os, 'macos') }} - run: | - brew install \ - ninja - - - name: Install linux deps - if: ${{ startsWith(matrix.config.os, 'ubuntu') }} - run: | - sudo apt update - sudo apt-get install \ - bc \ - build-essential \ - ninja-build - - - name: Install windows deps - if: ${{ startsWith(matrix.config.os, 'windows') }} - run: choco install -y ninja - - name: Checkout cmsis-toolbox uses: actions/checkout@v2 with: submodules: recursive - - name: Create build folder - run: | - mkdir build - - - name: Download cmsis-toolbox installer + - name: Download cmsis toolbox ${{ matrix.config.target }} ${{ matrix.config.arch }} uses: actions/download-artifact@v2 with: - name: cmsis-toolbox - path: ${{ github.workspace }} + name: cmsis-toolbox-${{ matrix.config.target }}-${{ matrix.config.arch }} + path: archive - - name: Set correct cmsis-toolbox file permission - if: ${{ startsWith(matrix.config.os, 'macos') || startsWith(matrix.config.os, 'ubuntu') }} - run: chmod +x cmsis-toolbox.sh + - name: Create directory + run: | + mkdir -p toolbox - - name: Configure windows build for amd64 + - name: unzip cmsis-toolbox windows archive if: ${{ startsWith(matrix.config.os, 'windows') }} - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: amd64 + run: unzip archive/cmsis-toolbox-${{ matrix.config.target }}-${{ matrix.config.arch }}.zip -d toolbox - - uses: ammaraskar/gcc-problem-matcher@master + - name: unzip cmsis-toolbox macos/linux archive if: ${{ startsWith(matrix.config.os, 'macos') || startsWith(matrix.config.os, 'ubuntu') }} - - uses: ammaraskar/msvc-problem-matcher@master - if: ${{ startsWith(matrix.config.os, 'windows') }} + run: tar -xvf archive/cmsis-toolbox-${{ matrix.config.target }}-${{ matrix.config.arch }}.tar.gz -C toolbox + + - name: Set up Python + uses: actions/setup-python@v4 - - name: Build and run Toolbox tests + - name: Install dependencies run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug .. - cmake --build . --target ToolboxTest1 - ctest -V -C Debug -R ToolboxTest1 - working-directory: ./build + python -m pip install --upgrade pip + pip install pytest - - name: Archive tests results - if: ${{ always() }} - uses: actions/upload-artifact@v2 - with: - name: toolboxtest-${{ matrix.config.target }}-${{ matrix.config.arch }} - path: ./build/Testing/Temporary/LastTest.log - retention-days: 1 - if-no-files-found: error + - name: Test with pytest + run: | + ls -l + sudo chmod +x ./test/tests.py + pytest test/tests.py -rA --junitxml=test-results-${{ matrix.config.target }}-${{ matrix.config.arch }}.xml - - name: Archive gtest report - if: ${{ always() }} + - name: Archive test report uses: actions/upload-artifact@v2 with: name: toolbox_test-${{ matrix.config.target }}-${{ matrix.config.arch }} - path: ./build/test_reports/toolboxtest1-*.xml + path: ./test-results-*.xml retention-days: 1 if-no-files-found: error @@ -204,112 +288,44 @@ jobs: uses: mikepenz/action-junit-report@v2 with: check_name: toolbox_test-${{ matrix.config.target }}-${{ matrix.config.arch }} - report_paths: build/test_reports/toolboxtest1-${{ matrix.config.target }}.xml + report_paths: test-results-${{ matrix.config.target }}-${{ matrix.config.arch }}.xml release: if: ${{ github.event_name == 'release' }} - needs: [ create_installer ] + needs: [ create_archives ] runs-on: ubuntu-20.04 timeout-minutes: 15 steps: - - name: Checkout devtools - uses: actions/checkout@v2 - - - name: Download cmsis-toolbox installer + - name: Download cmsis toolbox windows amd64 zip uses: actions/download-artifact@v2 with: - name: cmsis-toolbox - path: ${{ github.workspace }} + name: cmsis-toolbox-windows-amd64 + path: toolbox/zip - - name: Extract cmsis-toolbox installer files - run: | - chmod +x cmsis-toolbox.sh - ./cmsis-toolbox.sh -x toolbox/zip + - name: Download cmsis toolbox windows arm64 zip + uses: actions/download-artifact@v2 + with: + name: cmsis-toolbox-windows-arm64 + path: toolbox/zip - - name: Copy files separated by target for archiving - run: | - mkdir -p zip/cmsis-toolbox-windows-amd64/bin zip/cmsis-toolbox-windows-amd64/etc zip/cmsis-toolbox-windows-amd64/doc - mkdir -p zip/cmsis-toolbox-windows-arm64/bin zip/cmsis-toolbox-windows-arm64/etc zip/cmsis-toolbox-windows-arm64/doc - mkdir -p zip/cmsis-toolbox-linux-amd64/bin zip/cmsis-toolbox-linux-amd64/etc zip/cmsis-toolbox-linux-amd64/doc - mkdir -p zip/cmsis-toolbox-linux-arm64/bin zip/cmsis-toolbox-linux-arm64/etc zip/cmsis-toolbox-linux-arm64/doc - mkdir -p zip/cmsis-toolbox-darwin-amd64/bin zip/cmsis-toolbox-darwin-amd64/etc zip/cmsis-toolbox-darwin-amd64/doc - mkdir -p zip/cmsis-toolbox-darwin-arm64/bin zip/cmsis-toolbox-darwin-arm64/etc zip/cmsis-toolbox-darwin-arm64/doc - cp zip/bin/cbuild.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/cbuild.exe - cp zip/bin/cbuildgen.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/cbuildgen.exe - cp zip/bin/cpackget.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/cpackget.exe - cp zip/bin/csolution.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/csolution.exe - cp zip/bin/packchk.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/packchk.exe - cp zip/bin/svdconv.exe-amd64 zip/cmsis-toolbox-windows-amd64/bin/svdconv.exe - cp zip/bin/cbuild.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/cbuild.exe - cp zip/bin/cbuildgen.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/cbuildgen.exe - cp zip/bin/cpackget.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/cpackget.exe - cp zip/bin/csolution.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/csolution.exe - cp zip/bin/packchk.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/packchk.exe - cp zip/bin/svdconv.exe-arm64 zip/cmsis-toolbox-windows-arm64/bin/svdconv.exe - cp zip/bin/cbuild.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/cbuild - cp zip/bin/cbuildgen.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/cbuildgen - cp zip/bin/cpackget.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/cpackget - cp zip/bin/csolution.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/csolution - cp zip/bin/packchk.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/packchk - cp zip/bin/svdconv.lin-amd64 zip/cmsis-toolbox-linux-amd64/bin/svdconv - cp zip/bin/cbuild.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/cbuild - cp zip/bin/cbuildgen.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/cbuildgen - cp zip/bin/cpackget.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/cpackget - cp zip/bin/csolution.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/csolution - cp zip/bin/packchk.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/packchk - cp zip/bin/svdconv.lin-arm64 zip/cmsis-toolbox-linux-arm64/bin/svdconv - cp zip/bin/cbuild.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/cbuild - cp zip/bin/cbuildgen.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/cbuildgen - cp zip/bin/cpackget.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/cpackget - cp zip/bin/csolution.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/csolution - cp zip/bin/packchk.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/packchk - cp zip/bin/svdconv.mac-amd64 zip/cmsis-toolbox-darwin-amd64/bin/svdconv - cp zip/bin/cbuild.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/cbuild - cp zip/bin/cbuildgen.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/cbuildgen - cp zip/bin/cpackget.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/cpackget - cp zip/bin/csolution.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/csolution - cp zip/bin/packchk.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/packchk - cp zip/bin/svdconv.mac-arm64 zip/cmsis-toolbox-darwin-arm64/bin/svdconv - cp zip/LICENSE.txt zip/cmsis-toolbox-windows-amd64/LICENSE.txt - cp zip/LICENSE.txt zip/cmsis-toolbox-windows-arm64/LICENSE.txt - cp zip/LICENSE.txt zip/cmsis-toolbox-linux-amd64/LICENSE.txt - cp zip/LICENSE.txt zip/cmsis-toolbox-linux-arm64/LICENSE.txt - cp zip/LICENSE.txt zip/cmsis-toolbox-darwin-amd64/LICENSE.txt - cp zip/LICENSE.txt zip/cmsis-toolbox-darwin-arm64/LICENSE.txt - rm zip/etc/setup - cp -r zip/etc/* zip/cmsis-toolbox-windows-amd64/etc - cp -r zip/etc/* zip/cmsis-toolbox-windows-arm64/etc - cp -r zip/etc/* zip/cmsis-toolbox-linux-amd64/etc - cp -r zip/etc/* zip/cmsis-toolbox-linux-arm64/etc - cp -r zip/etc/* zip/cmsis-toolbox-darwin-amd64/etc - cp -r zip/etc/* zip/cmsis-toolbox-darwin-arm64/etc - cp -r zip/doc/* zip/cmsis-toolbox-windows-amd64/doc - cp -r zip/doc/* zip/cmsis-toolbox-windows-arm64/doc - cp -r zip/doc/* zip/cmsis-toolbox-linux-amd64/doc - cp -r zip/doc/* zip/cmsis-toolbox-linux-arm64/doc - cp -r zip/doc/* zip/cmsis-toolbox-darwin-amd64/doc - cp -r zip/doc/* zip/cmsis-toolbox-darwin-arm64/doc - working-directory: toolbox + - name: Download cmsis toolbox linux amd64 zip + uses: actions/download-artifact@v2 + with: + name: cmsis-toolbox-linux-amd64 + path: toolbox/zip - - name: Set toolchain default paths - run: | - ./scripts/set-default.sh Windows toolbox/zip/cmsis-toolbox-windows-amd64/etc - ./scripts/set-default.sh Windows toolbox/zip/cmsis-toolbox-windows-arm64/etc - ./scripts/set-default.sh Linux toolbox/zip/cmsis-toolbox-linux-amd64/etc - ./scripts/set-default.sh Linux toolbox/zip/cmsis-toolbox-linux-arm64/etc - ./scripts/set-default.sh Darwin toolbox/zip/cmsis-toolbox-darwin-amd64/etc - ./scripts/set-default.sh Darwin toolbox/zip/cmsis-toolbox-darwin-arm64/etc + - name: Download cmsis toolbox linux arm64 zip + uses: actions/download-artifact@v2 + with: + name: cmsis-toolbox-linux-arm64 + path: toolbox/zip - - name: Zip folders - run: | - zip -r cmsis-toolbox-windows-amd64.zip cmsis-toolbox-windows-amd64 - zip -r cmsis-toolbox-windows-arm64.zip cmsis-toolbox-windows-arm64 - tar -czvf cmsis-toolbox-linux-amd64.tar.gz cmsis-toolbox-linux-amd64 - tar -czvf cmsis-toolbox-linux-arm64.tar.gz cmsis-toolbox-linux-arm64 - tar -czvf cmsis-toolbox-darwin-amd64.tar.gz cmsis-toolbox-darwin-amd64 - tar -czvf cmsis-toolbox-darwin-arm64.tar.gz cmsis-toolbox-darwin-arm64 - working-directory: toolbox/zip + - name: Download cmsis toolbox darwin amd64 zip + uses: actions/download-artifact@v2 + with: + name: cmsis-toolbox-darwin-amd64 + path: toolbox/zip - name: Calculate checksums run: | diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 06c5fc1..0000000 --- a/.gitmodules +++ /dev/null @@ -1,5 +0,0 @@ -[submodule "external/open-cmsis-pack-devtools"] - path = external/open-cmsis-pack-devtools - url = https://github.com/Open-CMSIS-Pack/devtools.git - branch = main - ignore = dirty diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 2061a41..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 3.18) - -project(toolbox) - -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release") -endif() - -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR - "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR - "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -MD -Wall") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall") -endif() - -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${OUTDIR}") -set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED True) - -# open-cmsis-pack -add_subdirectory(external/open-cmsis-pack-devtools) - -# toolbox test -enable_testing() -add_subdirectory(test) diff --git a/README.md b/README.md index 2d39866..8c4db0a 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,3 @@ Hands-on Tutorial | Description [**SW-Pack-HandsOn**](https://github.com/Open-CMSIS-Pack/SW-Pack-HandsOn) | Explains the steps to create a simple software pack using the Open-CMSIS-Pack technology. [**DFP-Pack-HandsOn**](https://github.com/Open-CMSIS-Pack/DFP-Pack-HandsOn) | Explains the structure and creation of a Device Family Pack (DFP). [**BSP-Pack-HandsOn**](https://github.com/Open-CMSIS-Pack/DFP-Pack-HandsOn) | Explains the structure and creation of a Board Support Pack (BSP). - -## Report a Bug - -Please report any issue you are facing while using CMSIS-Toolbox in the [Issues tab on GitHub](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/issues/new/choose). -Select the appropriate issue template, depending on the severity of the issue. Bugs (or deviations) from the defined behaviour that can be worked around shall be reported as "non-blocking bug". In turn, issues that prevent you from using a certain feature entirely, are considered a "blocking bug" and labelled as *critical*. diff --git a/docs/YML-CBuild-Format.md b/docs/YML-CBuild-Format.md index 3e16e1b..e5f3e54 100644 --- a/docs/YML-CBuild-Format.md +++ b/docs/YML-CBuild-Format.md @@ -1,20 +1,20 @@ -# Build Information Files +# YAML CBuild Format -[**CMSIS-Toolbox**](README.md) **> Build Information Files** - The following chapter explains the YAML CBuild format that describes how to build a complete application. **Table of Contents** -- [Build Information Files](#build-information-files) +- [YAML CBuild Format](#yaml-cbuild-format) - [CBuild Output Files](#cbuild-output-files) - [Directory Structure](#directory-structure) - [File Structure of `*.cbuild-idx.yml`](#file-structure-of-cbuild-idxyml) - [File Structure of `*.cbuild.yml`](#file-structure-of-cbuildyml) - [CBuild-specific Nodes](#cbuild-specific-nodes) + - [`licenses:`](#licenses) - [`cprojects:`](#cprojects) + - [`context-set:`](#context-set) - [`packs:`](#packs) - [`generators:`](#generators) - [Source File Management](#source-file-management) @@ -24,6 +24,7 @@ The following chapter explains the YAML CBuild format that describes how to buil - [`components:`](#components) - [`files:` of a component](#files-of-a-component) - [`constructed-files:`](#constructed-files) + - [`messages:`](#messages) ## CBuild Output Files @@ -46,11 +47,9 @@ As `csolution` based projects should be portable across different host computers - All file references use relative paths to the base directory of the related `*.yml` file. Files that are within the file structure of the `csolution` base directory are also referenced using relative paths, i.e. `../layers/layer1/source-file1.c`. -- Files that are located in the [CMSIS-Pack root directory](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/blob/main/docs/installation.md#environment-variables) are prefixed with %CMSIS_PACK_ROOT%. +> ToDo: Question: when are relative paths used to the base directory and when are absolute paths used? -> **Note:** -> -> All file references to user source code should be relative paths. The environment variables `%CMSIS_PACK_ROOT%` and `%CMSIS_COMPILER_ROOT%` are used to refer to base directories of files that relate to software packs and compiler specific files. This base directories can also be on different filesystem drives. +- Files that are located in the [CMSIS-Pack root directory](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/blob/main/docs/installation.md#environment-variables) are prefixed with %CMSIS_PACK_ROOT%. - Files outside of the directory structure of `csolution` based application use absolute paths. If absolute paths are used, a `warning` is issued in the `*.cbuild-idx.yml` file. @@ -77,7 +76,9 @@ A typical directory structure of a `csolution` based application that uses commo    `cdefault:` | Relative path and name of the [`*.cdefault.yml`](YML-Input-Format.md#default) input file used to generate this application.    `csolution:` | Relative path and name of the [`*.csolution.yml`](YML-Input-Format.md#solution) input file used to generate this application.    [`cprojects:`](#cprojects) | List of `*.cproject.yml` and `*.clayer.yml` input files used to generate this application. +   [`licenses:`](#licenses) | ToDo: List of software license agreements used by this application.    `cbuilds:` | List of `*.cbuild.yml` output files that are generated for this application. +   [`context-set:`](#context-set) | Selected context that is generated for this application. **Example:** @@ -90,6 +91,8 @@ build-idx: - cproject: cm0plus/HelloWorld_cm0plus.cproject.yml - cproject: cm4/HelloWorld_cm4.cproject.yml + licenses: # ToDo: all licenses used in the projects + cbuilds: - cbuild: cm0plus/HelloWorld_cm0plus.Debug+FRDM-K32L3A6.cbuild.yml - cbuild: cm0plus/HelloWorld_cm0plus.Release+FRDM-K32L3A6.cbuild.yml @@ -122,6 +125,7 @@ The `cbuild.yml` file is structured into several sections. The top-level struct    [`components:`](#components) | List of software components used.    [`groups:`](#groups) | List of source file groups along with source files.    [`constructed-files:`](#constructed-files) | List of files that are generated by RTE management of `csolution` tool. +   [`messages:`](#messages) | ToDo: List of messages (errors, warnings, etc.) that apply to this project context. **Example:** @@ -216,6 +220,40 @@ build: ## CBuild-specific Nodes +### `licenses:` + +> ToDo + +The `licenses:` node collects the software licenses from all components and software packs that are used in a `csolution` based software project. + +`licenses:` | Content +:------------------------------------------------------------------|:------------------------------------ +`- license:` | SPDX-name of the license, `` to indicate a dedicated license agreement, or ``. +  `license-agreement:` | In cased of `` a link to the license agreement. +   [`packs:`] | List of software packs that use this license. +   [`components:`] | List of software components that use this license. + +**Example:** + +```yml +licenses: + - license: Apache-2.0 + packs: + - pack: ARM::CMSIS@5.9.0 + - pack: ARM::mbedTLS@1.7.0 + components: + - component: ARM::CMSIS:RTOS2:FreeRTOS&Cortex-M + + - license: + packs: + - pack: ARM::CMSIS-Driver@2.7.2 + + - license: + license-agreement: %CMSIS_PACK_ROOT%/Keil/STM32U5xx_DFP/2.0.0/Package_license.md + packs: + - pack: Keil::STM32U5xx_DFP@2.0.0 +``` + ### `cprojects:` The `cprojects:` node lists all `*.cproject.yml` input files along with `*.clayer.yml` files that are used to compose the application. @@ -237,6 +275,34 @@ The `cprojects:` node lists all `*.cproject.yml` input files along with `*.claye : ``` +### `context-set:` + +**ToDo: Proposal (would replace cbuild: node)** + +The `context-set:` node contains a list of generated files. Note that this depends on the `--context` parameters that are passed to `csolution`. + +The example below shows the content of the `DualCore` example with the following `csolution` invocation: + +```txt +csolution convert HelloWorld.csolution.yml --context HelloWorld_cm0plus.Debug+FRDM-K32L3A6 --context -HelloWorld_cm4.Release+FRDM-K32L3A6 +``` + +```yml + context-set: + - context: HelloWorld_cm4.Release+FRDM-K32L3A6 + bin: ./out/FRDM-K32L3A6/HelloWorld_cm4.bin + hex: ./out/FRDM-K32L3A6/HelloWorld_cm4.hex + elf: ./out/FRDM-K32L3A6/HelloWorld_cm4.axf + map: ./out/FRDM-K32L3A6/HelloWorld_cm4.map + log: ./out/FRDM-K32L3A6/HelloWorld_cm4.Release+FRDM-K32L3A6.log + - context: HelloWorld_cm0plus.Debug+FRDM-K32L3A6 + bin: ./out/FRDM-K32L3A6/HelloWorld_cm0plus.bin + hex: ./out/FRDM-K32L3A6/HelloWorld_cm0plus.hex + elf: ./out/FRDM-K32L3A6/HelloWorld_cm0plus.axf + map: ./out/FRDM-K32L3A6/HelloWorld_cm0plus.map + log: ./out/FRDM-K32L3A6/HelloWorld_cm0plus.Debug+FRDM-K32L3A6.log +``` + ### `packs:` The `packs:` node is the start of a pack list that is used for the project context. @@ -368,3 +434,12 @@ A list of files that are generated by the RTE management of the `csolution` tool `- file:` | Name and path to the file.    [`category:`](https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/pdsc_components_pg.html#FileCategoryEnum) | File category according Open-CMSIS-Pack specification +### `messages:` + +> ToDo: Messages that apply to this project context. + +`messages:` | Content +:--------------------------------------------------------|:------------------------------------ +`- error:` | Error message +`- warning:` | Warning message +`- info:` | Info message diff --git a/docs/YML-Input-Format.md b/docs/YML-Input-Format.md index 3d0a094..007a55f 100644 --- a/docs/YML-Input-Format.md +++ b/docs/YML-Input-Format.md @@ -1,16 +1,15 @@ -# User Input Files +# YAML Input Format -[**CMSIS-Toolbox**](README.md) **> User Input Files** - -The following chapter explains the YAML format of the *user input files* that describes the software of an embedded application. +The following chapter explains the YAML format that is used to describe the `*.yml` input files for the **CSolution** +Project Manager. **Table of Contents** -- [User Input Files](#user-input-files) +- [YAML Input Format](#yaml-input-format) - [Name Conventions](#name-conventions) - [Filename Extensions](#filename-extensions) - [`pack:` Name Conventions](#pack-name-conventions) @@ -85,12 +84,20 @@ The following chapter explains the YAML format of the *user input files* that de - [Example: Board](#example-board) - [Example: Simple Project](#example-simple-project) - [Example: Sensor Shield](#example-sensor-shield) + - [Generator (Proposal)](#generator-proposal) + - [Workflow assumptions](#workflow-assumptions) + - [Steps for component selection and configuration](#steps-for-component-selection-and-configuration) + - [Enhance Usability](#enhance-usability) + - [Workflow](#workflow) + - [Example Content of `*.cgen.json` (in this case `STM32CubeMX.cgen.json`)](#example-content-of-cgenjson-in-this-case-stm32cubemxcgenjson) + - [Changes to the \*.GPDSC file](#changes-to-the-gpdsc-file) + - [Changes to the \*.PDSC file](#changes-to-the-pdsc-file) ## Name Conventions ### Filename Extensions -The **`csolution` Project Manager** recognizes the [categories](https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/pdsc_components_pg.html#FileCategoryEnum) of [files](#files) based on the filename extension in the YAML input files as shown in the table below. +The **csolution - CMSIS Project Manager** recognizes the [categories](https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/pdsc_components_pg.html#FileCategoryEnum) of [files](#files) based on the filename extension in the YAML input files as shown in the table below. File Extension | [Category](https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/pdsc_components_pg.html#FileCategoryEnum) | Description :--------------------------------------------|:-------------|:--------------------- @@ -105,7 +112,7 @@ File Extension | [Category](https://open-cmsis-pack.github.io/Open-CMS ### `pack:` Name Conventions -The **`csolution` Project Manager** uses the following syntax to specify the `pack:` names in the `*.yml` files. +The **csolution - CMSIS Project Manager** uses the following syntax to specify the `pack:` names in the `*.yml` files. ```yml vendor [:: pack-name [@[~ | >=] version] ] @@ -119,7 +126,7 @@ Element | | Description > **Note:** > -> When no version is specified, the **`csolution` Project Manager** only loads the latests version of a software pack. This also applies when wildcards are used in the `pack-name`. +> When no version is specified, the **csolution - CMSIS Project Manager** only loads the latests version of a software pack. This also applies when wildcards are used in the `pack-name`. **Examples:** @@ -133,7 +140,7 @@ Element | | Description ### `component:` Name Conventions -The **`csolution` Project Manager** uses the following syntax to specify the `component:` names in the `*.yml` files. +The **csolution - CMSIS Project Manager** uses the following syntax to specify the `component:` names in the `*.yml` files. ```yml [Cvendor::] Cclass [&Cbundle] :Cgroup [:Csub] [&Cvariant] [@[~ | >=]Cversion] @@ -153,7 +160,7 @@ Element | | Description **Partly defined components** -A component can be partly defined in *user input files* (`*.cproject.yml`, `*.clayer.yml`, `*.genlayer.yml`) by omitting `Cvendor`, `Cvariant`, and `Cversion`, even when this are part of the `components` element of the software pack. The component select algorithm resolves this to a fully defined component by: +A component can be partly defined in `csolution` input files (`*.cproject.yml`, `*.clayer.yml`, `*.genlayer.yml`) by omitting `Cvendor`, `Cvariant`, and `Cversion`, even when this are part of the `components` element of the software pack. The component select algorithm resolves this to a fully defined component by: - when a partly specified component resolves to several possible choices, the tool selects: - (a) the default `Cvariant` of the component as defined in the PDSC file. @@ -167,7 +174,7 @@ The fully resolved component name is shown in the [`*.cbuild.yml`](YML-CBuild-Fo **Multiple component definitions are rejected** -- If a component is added more then once in the *user input files* and an *error* is issued. +- If a component is added more then once in the `csolution` input files and an *error* is issued. - An attempt to select multiple variants (using `Cvariant`) of a component results in an *error*. **Examples:** @@ -460,7 +467,7 @@ Keyword | Description ### `default:` -When [`cdefault:`](#solution) is specified in the `*.csolution.yml` file, the **`csolution` Project Manager** uses a file with the name `cdefault.yml` or `cdefault.yaml` to setup +When [`cdefault:`](#solution) is specified in the `*.csolution.yml` file, the **csolution - CMSIS Project Manager** uses a file with the name `cdefault.yml` or `cdefault.yaml` to setup the compiler along with some specific default controls. The search order for this file is: - A `cdefault.yml` or `cdefault.yaml` file in the same directory as the `.csolution.yml` file. @@ -495,11 +502,11 @@ The `solution:` node is the start of a `*.csolution.yml` file that collects rela `solution:` | | Content :----------------------------------------------------|:-----------|:------------------------------------ -    `created-by:` | Optional | Identifies the tool that created this solution. -    `created-for:` | Optional | Specifies the tool for building this solution, i.e. **CMSIS-Toolbox@1.5.0** -    `description:` | Optional | Brief description text of this solution. +    `created-by:` | Optional | Identifies the tool that created this csolution project. +    `created-for:` | Optional | Specifies the tool for building this csolution project, i.e. **ctools@1.5.0** +    `description:` | Optional | Brief description text of the solution.     `cdefault:` | Optional | When specified, the [`cdefault.yml`](#default) file is used to setup compiler specific controls. -    [`compiler:`](#compiler) | Optional | Overall toolchain selection for this solution. +    [`compiler:`](#compiler) | Optional | Overall toolchain selection for the solution.     [`language-C:`](#language-c) | Optional | Set the language standard for C source file compilation.     [`language-CPP:`](#language-cpp) | Optional | Set the language standard for C++ source file compilation.     [`output-dirs:`](#output-dirs) | Optional | Control the output directories for the build output. @@ -547,7 +554,7 @@ The `project:` node is the start of a `*.cproject.yml` file and can contain the `project:` | | Content :---------------------------------------------------|:-----------|:------------------------------------ -    `description:` | Optional | Brief description text of this project. +    `description:` | Optional | Brief description text of the project.     [`output:`](#output) | Optional | Configure the generated output files.     [`generators:`](#generators) | Optional | Control the directory structure for generator output.     [`rte:`](#rte) | Optional | Control the directory structure for [RTE (run-time environment)](Overview.md#rte-directory-structure) files. @@ -642,7 +649,7 @@ layer: ## Directory Control -The following nodes control the directory structure for the application. +The following nodes control the directory structure for **CSolution** based projects. ### `output-dirs:` @@ -678,7 +685,7 @@ output-dirs: Allows to control the directory structure for generator output files. -When no explicit `generators:` is specified, the **`csolution` Project Manager** uses as path: +When no explicit `generators:` is specified, the **CSolution** Project Manager uses as path: - The `workingDir` defined in the [generators element](https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/pdsc_generators_pg.html#element_generator) of the PDSC file. - When no `workingDir` is defined the default directory `$ProjectDir()$/generated/` is used; `` is defined by the `id` in the generators element of the PDSC file. @@ -771,60 +778,26 @@ compiler: AC6@6.18.0 # Select Arm Compiler version 6 ### `linker:` -The `linker:` node specifies an explicit Linker Script and/or memory regions header file. It can be applied in `*.cproject.yml` and `*.clayer.yml` files. -Refer to [Linker Script Management](build-overview.md#linker-script-management) for detailed information. +The `linker:` node specifies an explicit Linker Script and/or memory regions header file. It can be applied in `*.cproject.yml` and `*.clayer.yml` files. If multiple `linker:` nodes are specified an error is issued. -`linker:` | | Content +`linker:` | | Content :-----------------------------------------------------------|:-----------|:-------------------------------- -`- regions:` | Optional | Path and file name of `.h`, used to generate a Linker Script. -   `script:` | Optional | Explicit file name of the Linker Script, overrules files provided with [`file:`](#files) or components. -   [`define:`](#define) | Optional | Define symbol settings for the linker script file preprocessor. -   [`for-compiler:`](#for-compiler) | Optional | Include Linker Script for the specified toolchain. -   [`for-context:`](#for-context) | Optional | Include Linker Script for a list of *build* and *target* type names. -   [`not-for-context:`](#not-for-context) | Optional | Exclude Linker Script for a list of *build* and *target* type names. - -> **Notes:** -> -> The `linker:` node must have at least `regions:`, `script:`, or `define:`. -> -> If no `script:` file is specified, compiler specific [linker script template files](build-overview.md#linker-script-templates) are used. -> -> A Linker Script file is preprocessed when `regions:` or a `define:` is specified in the `linker:` node. - -**Examples:** - -```yml -linker: - - script: MyLinker.scf # linker script file - regions: MyRegions.h # pre-processed using header file -``` - -```yml -linker: - - regions: MyRegions.h # Default linker script is used and pre-processed using header file -``` - -```yml -linker: - - script: MyLinker.scf # linker script file, not pre-processed - for-compiler: AC6 # for Arm Compiler 6 - - - script: MyLinker.ld # linker script file, not pre-processed - for-compiler: CLANG # for CLANG LLVM based compiler -``` +**`- regions:`** |**Optional**|**Path and file name of `regions_.h`, used to generate a Linker Script.** +    [`for-compiler:`](#for-compiler) | Optional | Include Linker Script for the specified toolchain. +    [`for-context:`](#for-context) | Optional | Include Linker Script for a list of *build* and *target* type names. +    [`not-for-context:`](#not-for-context) | Optional | Exclude Linker Script for a list of *build* and *target* type names. +**`- script:`** |**Optional**|**Explicit file name of the Linker Script, overrules files provided with [`file:`](#files) or components.** +    [`for-compiler:`](#for-compiler) | Optional | Include Linker Script for the specified toolchain. +    [`for-context:`](#for-context) | Optional | Include Linker Script for a list of *build* and *target* type names. +    [`not-for-context:`](#not-for-context) | Optional | Exclude Linker Script for a list of *build* and *target* type names. +**[`- define:`](#define)** |**Optional**|**Define symbol settings for the linker script file preprocessor.** +    [`for-compiler:`](#for-compiler) | Optional | Apply define settings for the specified toolchain. +    [`for-context:`](#for-context) | Optional | Include define settings for a list of *build* and *target* type names. +    [`not-for-context:`](#not-for-context) | Optional | Exclude define settings for a list of *build* and *target* type names. -```yml -linker: - - script: MyLinker.scf # linker script file - for-compiler: AC6 # for Arm Compiler 6 - regions: MyRegions.h # pre-processed using header file - - - script: MyLinker.ld # linker script file - for-compiler: CLANG # for CLANG LLVM based compiler - regions: MyRegions.h # pre-processed using header file - define: # with define setting - - Setup: 1 # define with value -``` +> **Note:** +> +> If no `script:` file is specified, compiler specific [linker script template files](Linker-Script-Management.md#linker-script-templates) are used. ### `output:` @@ -832,7 +805,7 @@ Configure the generated output files. `output:` | | Content :--------------------------------------|:-----------|:-------------------------------- -    `base-name:` | Optional | Specify a common base name for all output files. +    `base-name:` | Optional | Specify a base name for all output files.     `type:` | Optional | A list of output types for code generation (see list below). `type:` | Description @@ -861,11 +834,11 @@ output: # configure output files - bin # generate a BIN file ``` -Generate a **library**: +Gnerate a **library**: ```yml output: # configure output files - type: lib # Generate library file. + type: lib # Generate executeable file. ``` ## Translation Control @@ -1158,7 +1131,7 @@ The `pack:` definition may be specific to a [`context`](#context) that specifies >**Notes:** > -> - By default, the **`csolution` Project Manager** only loads the latest version of the installed software packs. It is however possible to request specific versions using the `- pack:` node. +> - By default, the **csolution - CMSIS Project Manager** only loads the latest version of the installed software packs. It is however possible to request specific versions using the `- pack:` node. > > - An attempt to add two different versions of the same software pack results in an error. @@ -1355,6 +1328,8 @@ target-types: ### `context-map:` +>**Scheduled for CMSIS-Toolbox 2.0 - Q2** + The `context-map:` node allows for a specific `project-name` the remapping of `target-types:` and/or `build-types:` to a different `context:` which enables: - Integrating an existing `*.cproject.yml` file in a different `*.csolution.yml` file that uses different `build-types:` and/or `target-types:` for the overall application. @@ -1887,7 +1862,7 @@ The `connect:` node describes one or more functionalities that belong together. ### `set:` -Some hardware boards have configuration settings (DIP switch or jumper) that configure interfaces. These settings have impact to the functionality (for example hardware interfaces). With `set:` *config-id*.*select* the possible configration options are considered when evaluating compatible `*.cproject.yml` and `*.clayer.yml` project parts. The **`csolution` Project Manager** iterates the `connect:` node with a `set:` *config-id*.*select* as described below: +Some hardware boards have configuration settings (DIP switch or jumper) that configure interfaces. These settings have impact to the functionality (for example hardware interfaces). With `set:` *config-id*.*select* the possible configration options are considered when evaluating compatible `*.cproject.yml` and `*.clayer.yml` project parts. The **csolution - CMSIS Project Manager** iterates the `connect:` node with a `set:` *config-id*.*select* as described below: - For each *config-id* only one `connect:` node with a *select* value is active at a time. Each possible *select* value is checked for a matching configuration. @@ -1899,7 +1874,7 @@ Refer to [Example: Sensor Shield](#example-sensor-shield) for a usage example. A user-defined *key*/*value* pair list of functionality that is implemented or provided by a `project:` or `layer:`. -The **`csolution` Project Manager** combines all the *key*/*value* pairs that listed under `provides:` and matches it with the *key*/*value* pairs that are listed under `consumes:`. For *key*/*value* pairs listed under `provides:` the following rules exist for a match with `consumes:` *key*/*value* pair: +The **csolution - CMSIS Project Manager** combines all the *key*/*value* pairs that listed under `provides:` and matches it with the *key*/*value* pairs that are listed under `consumes:`. For *key*/*value* pairs listed under `provides:` the following rules exist for a match with `consumes:` *key*/*value* pair: - It is possible to omit the *value*. It matches with an identical *key* listed in `consumes:` - A *value* is interpreted as number. Depending on the value prefix, this number must be: @@ -2027,3 +2002,268 @@ This sensor shield layer provides a set of interfaces that are configurable.   consumes:       - Ardunio_Uno_D3: ``` + +## Generator (Proposal) + +>Note: Superseeded by [Generator%20(Proposal).md](Generator%20(Proposal).md) + +--> Requires Review + +### Workflow assumptions + +The composition of a solution of a solution should have the following steps: + +- Create `*.cproject.yml` files and the `*.csolution.yml` container that refers the projects. +- Select `device:` or `board:` (optionally by using `target-types:`) +- Add `components:` or `layers:` to the `*.cproject.yml` file +- For components that have configuration, run the generator in configuration mode + - change pinout, clock, resources, etc. + - reflect configuration in *.gpdsc file (and related settings files) + +> **Note:** +> +> Components can have multiple [instances](#instances). + +### Steps for component selection and configuration + +The following explains the generator workflow of CSolution / CBuild for configuration of components: + +1. User selects components in `*.cproject.yml` under `components:` + - When these components require generation, user is notified to run a generator. + - "CSolution Run GenID” is invoked for a list of components. + - CSolution generates `*.cgen.json` file that provides project context and a list of user-selected components. + +2. Running the Generator (for Component Configuration, i.e. pin selection) + - Generator reads `*.cgen.json` file + - User performs the configuration is done. + - Interactive mode (where a settings file is generated) + - Remote mode (where a settings file is an input) **IS THIS REALLY REQUIRED** + - Generator creates a `*.gpdsc` file that informs the CSolution tool about + - (a) the fact that a component is configured and has generated code, + - (b) additional components that are the result of some user configuration. + + Discussions: + - is a component list or a dependency list + - Generator might be VS Code plugin or web based + +3. User creates CBuild output with CSolution Convert command + - Both `*.cproject.yml` and `*.gpdsc` are read by Csolution and create the complete list of selected components. + - If `*.gpdsc` does not contain component information about a component that has `genId` and selected in + `*.cproject.yml` the generator configuration is incomplete. This can happen when a component is added at a later + step. + - Likewise the Generator can detect with the `` attribute that a component is longer required. + In this case the user is notified to run a generator. + +### Enhance Usability + +Add Run Generator buttons to Cclass descriptions. + +![Add Run Generator buttons to Cclass](./images/gen.png "Add Run Generator buttons to Cclass") + +### Workflow + +1. For `*.cproject.yml` files that contain selected `` with a `generator` or `genid` attribute the + `csolution` manager checks if a file with the name `.//RTE+/.cgen.json` exists. + - When this file is missing, it is required to use the command `csolution run genid` to start the generator. + - When this file exists, the `csolution` manager checks if the list of components with `genid` has changed. If this + is the case it is required to use the command `csolution run genid` to reconfigure generated components. +2. The command `csolution run genid` creates the file `.//RTE+/.cgen.json` and starts the + generator. The generator creates a `*.GDPSC` file along with other source files that are required + [as specified](https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/pdsc_generators_pg.html#element_generators). + +#### Example Content of `*.cgen.json` (in this case `STM32CubeMX.cgen.json`) + +The `*.cgen.json` file is passed to generator as argument. + +> **Note:** +> +> Shown is still a `*.yml` file, but the equivalent data would be formatted in `*.json` format. + +```yml +cgenerator: + device: STM32F407IGHx + board: NucleoF407 + solution: C:/tmp/MySolution/MySolution.csolution.yml + project: C:/tmp//MySolution/Blinky/Blinky.cproject.yml + context: .Debug+Nucelo # build-type and target-type of the current generated context + destination: C:/tmp/MySolution/Blinky/RTE+Nucelo/ + + packs: # packs that are used for the project + - pack: Keil::STM32F4xx_DFP@2.16.1 + path: C:/CMSIS-PACKS/Keil/STM32F4xx_DFP/2.16.1/ + - pack: Keil::STM32F4xx_BSP@2.1.1 + path: C:/CMSIS-PACKS/Keil/STM32F4xx_BSP/2.1.1/ + + components: # components that have a genid and are specified in *.cproject.yml + - component: Device:STM32Cube HAL:Common + - component: Board:LED + - component: Device:HAL:UART + instances: + - WiFi: 0 + setup: wifi-config.json + baudrate: 19200 + - Debug: 2 + baudrate: 57600 +``` + +### Changes to the *.GPDSC file + +To indicate that a component was generated due to a user selection in `*.cproject.yml`, the `component` element is +extended with `User` attribute. When set to `1` it indicates that a component is included due to the selection in +`*.cproject.yml`. + +When a user removes this component in the `*.cproject.yml`, the CSolution could detect that a Run command should be +executed. + +### Changes to the *.PDSC file + +- Add `` to `` element. The `key` is used to invoke the generator and pass the `.cgen.json` file. + - on Windows to a registry key to invoke the generator tool + - on Linux and MacOS to an environment variable that specifies how to invoke the generator tool + - todo: Web based tools? +- Add `genId` to `component` element. Indicates that a component is managed by the ``. +- Add `inherent` to `component` element. Indicates that a component is managed by the `` + Components with inherent attribute are not selectable by the user (and could be managed by the ``). + Components with `inherent` attribute have the following behavior: + - Are selected when a condition requires this component. + - Are de-selected when a no condition requires this component. + - IDE's may choose to hide such components in the RTE selection (default might be to show it). +- Add new file category: + - `genParms` template parameters + - `genInput` source templates for the generator and other related input files for the generator + +**Example:** + +```xml + + + + ST Microelectronics: STCubeMX Environment + STCubeMX_CGENFILE + + url + $PRTE/Device + + + + + + + + + STM32F4xx Hardware Abstraction Layer (HAL) and Drivers + STM32F412 Board Abstraction Layer (HAL) and Drivers + + + + + Common HAL driver + + #define RTE_DEVICE_HAL_COMMON + + + + + + + + + + + + Analog-to-digital converter (ADC) HAL driver + + #define RTE_DEVICE_HAL_ADC + + + + + + + + + + : + + STMicroelectronics STM32F4 Discovery Kit + http://www.st.com/st-web-ui/static/active/en/resource/technical/document/data_brief/DM00037955.pdf + + LED Interface for STMicroelectronics STM32F4-Discovery Kit + + + + + + + +``` + +**Example *.gpdsc file** + +```xml + + + + Keil + FrameworkCubeMX + STM32CubeMX generated pack description + project-path + + + - Generated: 23/09/2021 14:18:05 + + + + + STM32CubeMX Environment +