GithubHelp home page GithubHelp logo

open-cmsis-pack / devtools Goto Github PK

View Code? Open in Web Editor NEW
72.0 14.0 52.0 10.95 MB

Open-CMSIS-Pack development tools - C++

License: Apache License 2.0

CMake 2.86% C++ 76.01% C 10.67% Python 0.06% Assembly 1.74% HTML 0.08% Shell 1.10% CSS 0.57% SWIG 0.04% Go 0.02% Batchfile 0.01% Roff 5.98% Groovy 0.84% Dockerfile 0.04%

devtools's Introduction

OpenSSF Scorecard

CMSIS-Pack Development Tools and Libraries

This repository contains the source code of the CMSIS-Toolbox. This toolbox provides command line tools for processing software packs that are provided in Open-CMSIS-Pack format.

This repository provides the C++ source code of most CMSIS-Toolbox components and contains build and test configurations for Windows, Linux and macOS host platforms.

Open-CMSIS-Pack defines a delivery mechanism for software components, device parameters, and evaluation board support. The XML-based package description (*.PDSC) file contains the meta information of a software pack which is a collection of files including:

  • Source code, header files, and software libraries
  • Documentation and source code templates
  • Device parameters along with startup code and programming algorithms
  • Example projects

The complete file collection along with the *.PDSC file is called software pack and distributed as a zip archive using the file extension *.pack.

The goal of this project is to provide a consistent and compliant set of command-line tools for software packs that covers the complete lifecycle including:

  • creation and maintenance of software packs.
  • distribution and installation of software packs.
  • project build with interfaces to various compilation tools.
  • interfaces for flash programming and debugging tools.

Repository toplevel structure

    📦
    ┣ 📂cmake       local cmake functions and configuration files
    ┣ 📂docs        documentation shared by all components
    ┣ 📂external    3rd party components loaded as submodules
    ┣ 📂libs        reusable C++ library component source code shared by tools
    ┣ 📂scripts     scripts used by validation, build and test actions
    ┣ 📂test        test related files shared across tool and library components
    ┗ 📂tools       command line tool source code

Building the tools locally

This section contains steps to generate native makefiles and workspaces that can be used in the compiler environment of your choice.

The instructions contain a complete guide to get you the project build on your local machine for development and testing purposes.

Prerequisites

The following applications are required to be installed on your machine to allow components in this repository to be built and run.

Note that some of the required tools are platform dependent:

  • Git

  • GNU Arm Embedded Toolchain

    Processor Min. Version
    Cortex-M85 12.2.MPACBTI-Rel1
    Others 10-2020-q4-major
  • A toolchain for your platform

    • Windows:

      • GIT Bash
      • Visual Studio 2019 with "Desktop development with C++"
      • CMake (minimum recommended version 3.22)
      • optional make or Ninja
      ☑️ Make sure 'git' and 'bash' paths are listed under the PATH environment
          variable and set the git bash priority higher in the path.
      
      ☑️ GCC/Clang on Windows:
          Currently GCC and Clang (MSYS2/MinGW distribution) compilers do not work
          on Windows. The included libc++ has a known issue in std::filesystem,
          see [MSYS2 GitHub issue #1937](https://github.com/msys2/MSYS2-packages/issues/1937).
    • Linux:

      • GNU Bash (minimum recommended version 4.3)
      • GNU Compiler (minimum recommended version 8.1)
      • alternatively LLVM/Clang Compiler (minimum recommended version 8)
      • CMake (minimum recommended version 3.22)
      • make or Ninja
    • MacOS:

      • GNU Bash (minimum recommended version 4.3)
      • XCode/AppleClang (minimum recommended version 11)
      • CMake (minimum recommended version 3.22)
      ☑️ For Apple Silicon (M1/M2 series):
          Currently the pre-installed bsdtar and apple gzip in macOS may cause some unexpected issues in CbuildIntegTests, like:
            curl: (23) Failure writing output to destination
            tar: Option --wildcards is not supported
          So please use gnu-tar and gzip:
            brew install gnu-tar
            brew install gzip
          And make sure they are added in $PATH.

Clone repository

Clone github repository to create a local copy on your computer to make it easier to develop and test. Cloning of repository can be done by following the below git command:

git clone [email protected]:Open-CMSIS-Pack/devtools.git

Build components

This is a three step process:

  1. Download third party software components specified as git submodules.
  2. Generate configuration files for a build system
  3. Run build

Download third party software components

  • Go to <path>/<to>/devtools and run git command:

    git submodule update --init --recursive
  • Create and switch to the build directory

    mkdir build
    cd build

Generate configuration files

As usual, the actual build steps vary by platform.

  • Linux/MacOS amd64:
    On Linux or MacOS use the following commands:

    Note: If DCMAKE_BUILD_TYPE is not selected, the binaries shall build with Release configuration:

    cmake -DCMAKE_BUILD_TYPE=<Debug/Release> ..

    for e.g.

    cmake -DCMAKE_BUILD_TYPE=Debug ..
  • Linux cross-compiling aarch64:
    For cross-compiling aarch64 you need to generate with -DCMAKE_TOOLCHAIN_FILE=../cmake/TC-linux-aarch64.cmake:

    cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/TC-linux-aarch64.cmake ..
  • Windows:
    On Windows system use the following command to generate the complete workspace:

    cmake -A x64 ..
  • Windows cross-compiling:
    For cross-compiling win32 you need to generate with -DCMAKE_TOOLCHAIN_FILE=../cmake/TC-win32-posix.cmake:

    cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/TC-win32-posix.cmake ..

Run build

One can trigger a build for all CMake targets or specific targets from the command line.

☑️ Note:
    The flag `--config` is optional. If it is not specified in the command, depending on
    the platform the binaries shall build in default configurations.
        - Windows: Debug
        - Linux/macOS: Release

Follow the respective commands:

  • Build all CMake targets

    cmake --build . --config <Debug/Release>

    for e.g.

    cmake --build . --config Debug
  • Users can build specific target of their choice:

    • Get the list of valid CMake generated targets

      cat ./targets
    • Select the target

    • Build the selected target and run command

      cmake --build . --config <Debug/Release> --target <target_name>

      for e.g.

      cmake --build . --config Debug --target CbuildUnitTests

Run Tests

Test Prerequisites

  • Ensure that the above applicable prerequistes are fulfilled.

  • Test environment setup:
    In order to run the tests, the test environment should know about

    Users can configure the test environment by setting the environment variables mentioned below.
    Note: When the variables are already set, User doesn't need to set them again.

    • CMSIS_PACK_ROOT:

      • Follow the details here.
      • When it is pointing to an empty directory. The test scripts shall make this directory ready to be
        used, by initializing (creating subfolder .Download, .Local, .Web and placing a copy of the index
        file under .Web/index) this directory as a pack root directory and automatically downloading all the
        packs required by test projects using cpackget tool.
    • GCC_TOOLCHAIN_ROOT:
      This variable should point to the installation path of GNU Arm Embedded Toolchain.

      • When the variable is not set. Tests shall try to find the toolchain under default path.
        Platform Default path
        Linux ${HOME}/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/bin
        Windows ${PROGRAMFILES} (x86)/Arm GNU Toolchain arm-none-eabi/11.2 2022.02/bin
        MacOS ${HOME}/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/bin
        WSL_Windows ${PROGRAMFILES} (x86)/Arm GNU Toolchain arm-none-eabi/11.2 2022.02/bin
    • AC6_TOOLCHAIN_ROOT:
      This variable should point to the installation path of Arm Compiler 6.

      • When the variable is not set. Tests shall try to find the toolchain under default path.
        Platform Default path
        Linux ${HOME}/ArmCompilerforEmbedded6.18/bin
        Windows ${PROGRAMFILES}/ArmCompilerforEmbedded6.18/bin
        MacOS ${HOME}/ArmCompilerforEmbedded6.18/bin
        WSL_Windows ${PROGRAMFILES}/ArmCompilerforEmbedded6.18/bin
    • CC:
      This variable should point to the full qualified path to GNU Arm Embedded compiler binary (arm-noneabi-gcc)

      • If the variable is not set packgen tests shall fail.

Set the environment variables

  for e.g.
    $export CMSIS_PACK_ROOT=/path/to/Pack/Root
    $export GCC_TOOLCHAIN_ROOT=/path/to/GCC/toolchain
    $export AC6_TOOLCHAIN_ROOT=/path/to/AC6/toolchain
    $export CC=/path/to/arm-noneabi-gcc

One can directly run the tests from command line.

  • Using ctest:
    Use the command below to trigger the tests.

    • ctest -C <config> : Run all registered tests (Note: Running all the tests can take a while)
    • ctest -R <regex> -C <config>: Run all tests matching the regex

    for e.g.

    ctest -C Debug
        or
    ctest -R CbuildUnitTests -C Debug
  • Using test executable:

    • Go to root build directory

      cd <root>

    • Run the executable

      ./<path_to_executable>/<executable_name>

      for e.g.

      cd build
      ./tools/buildmgr/test/integrationtests/windows64/Debug/CbuildIntegTests.exe

Note

  • On running the tests, all required packs shall get downloaded automatically by test scripts
    under configured pack repository.

  • By default, few special tests are skipped from execution as they are dependent on specific
    environment configuration or other dependencies.

    1. CI dependent tests :
      These tests are designed to work only in CI (Continuous Integration) environment
    2. AC6 toolchain test :
      The below listed tests depend on a valid AC6 toolchain installed and can be run in
      the local environment on the installation of valid Arm Compiler 6.

    Make sure you have the proper Arm Compilers licenses.

Code coverage

Users can generate coverage reports locally using a GNU tool lcov.

Prerequisite

Coverage reports can only be generated on linux platform.

  • Ensure that the linux prerequisite are fulfilled.

  • Install lcov

    sudo apt-get install lcov

Generate coverage report

  • Create and switch to build directory

    mkdir build
    cd build
    ☑️ Ensure that the build tree is clean and doesn't have any existing coverage data i.e. .gcda or .gcno files
  • Generate configuration files with coverage flag ON

    cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=ON ..
  • Build target tests

    cmake --build . --config Debug --target <target_name>

    for e.g.

    cmake --build . --config Debug --target CbuildUnitTests
  • Run tests

    ctest -R <regex> -C Debug

    for e.g.

    ctest -R CbuildUnitTests -C Debug
  • Collect coverage data

    lcov -c --directory <path_to_user_space> --output-file <cov_out_file>

    for e.g.

    lcov -c --directory ./tools/buildmgr --output-file full_coverage.info
  • Extract coverage data from file

    ☑️ By default, lcov collects coverage data also from the currently running Linux
        kernel. Specify -e option to extract data from files matching PATTERN from file

    lcov -e <input_file> '<PATTERN>' -o <out_file>

    for e.g.

    lcov -e full_coverage.info '/tools/buildmgr/cbuild/*' '*/tools/buildmgr/cbuildgen/*' '*/tools/buildmgr/cbuild/*' -o coverage.info
  • Generate html coverage report

    genhtml <cov_file> --output-directory <report_out_dir>

    for e.g.

    genhtml coverage.info --output-directory coverage

The coverage report i.e. index.html is generated into the specified directory.

Build Documentation

Some components provide Doxygen-based documentation which needs to be generated before it can be viewed and published. There are specific build targets for these generated documentations, see build target suffix -docs.

☑️ Note:
   The *-docs build targets require doxygen to be available. If CMake fails to
   detect the correct version of doxygen a warning message appears and the build
   targets are skipped.

To build the documentation for a specific component run the following in the CMake build directory:

cmake --build . --target buildmgr-docs

The documentation is generated into the CMake binary directory of the enclosing component.

Visual Studio Code Dev Containers

Using Visual Studio Code in combination with Docker one can use Dev Containers to build, run and debug, instead of using a local toolchain installation, see https://code.visualstudio.com/docs/devcontainers/containers.

Reference devcontainers are defined in .devcontainer folder. To use them from within Code click the remote window button on the lower left, choose Open folder in container, and select one of the configurations from the list.

On the first use the Docker image is built from the configurations Dockerfile. Once the image is cached, a new container is launched and the Code window is connected to it. The workspace is mounted into the container so that one can work with the files right way.

It is also possible to spawn multiple instances of code connected to different dev containers in parallel. All containers share the same workspace with the host. This way, one can run the build using one configuration and run/debug the binaries with another system configuration.

License

Open-CMSIS-Pack is licensed under Apache 2.0.

Contributions and Pull Requests

Contributions are accepted under Apache 2.0. Only submit contributions where you have authored all of the code.

Proposals, Reviews and Project

Please feel free to raise an issue on GitHub to start the discussion about your proposal.

We are in the early days and discuss proposals which we are dividing into 5 work streams with a dedicated label:

  • Core Library Components - common libraries that are re-used across a range of tools. The PoC Tools are the first consumers, but the library components can also be used to create commercial derivatives or in-house tooling.
  • Overall Project Concept - procedures to generate packs and application software. We shall consider complex applications such as multi-core processor systems or secure/non-secure partitions.
  • PoC Tools - command line tools and utilities that implement the overall concepts and are intended to be used for open-source projects or even integrated into commercial software tools.
  • Process Improvements - documentation and tools that help the software community to streamline and secure the software delivery to the user base.
  • Resource Management - describes the data models used to manage and organized software packs and application projects.

These Issues are tracked inside the project board

Issues, Labels

Please feel free to raise an issue on GitHub to report misbehavior (i.e. bugs)

Issues are your best way to interact directly with the maintenance team and the community. We encourage you to append implementation suggestions as this helps to decrease the workload of the very limited maintenance team.

We shall be monitoring and responding to issues as best we can. Please attempt to avoid filing duplicates of open or closed items when possible. In the spirit of openness we shall be tagging issues with the following:

  • bug – We consider this issue to be a bug that shall be investigated.
  • wontfix - We appreciate this issue but decided not to change the current behavior.
  • out-of-scope - We consider this issue loosely related to CMSIS. It might be implemented outside of CMSIS. Let us know about your work.
  • question – We have further questions about this issue. Please review and provide feedback.
  • documentation - This issue is a documentation flaw that shall be improved in the future.
  • DONE - We consider this issue as resolved - please review and close it. In case of no further activity, these issues shall be closed after a week.
  • duplicate - This issue is already addressed elsewhere, see a comment with provided references.

devtools's People

Contributors

brondani avatar dependabot[bot] avatar edriouk avatar erikmallbergstm avatar grasci-arm avatar ithinuel avatar jeromecoutant avatar jkrech avatar jlonnberg avatar jonatanantoni avatar jonny-vb avatar joseph-yiu avatar lmestm avatar lukastycnxp avatar madchutney avatar maribu avatar masmiseim36 avatar miloradcvjetkovic avatar patater avatar reinhardkeil avatar robinkastberg avatar slhultgren avatar soumeh01 avatar spcaipers-arm avatar tarek-bochkati avatar thorstendb-arm avatar torbjorn-svensson avatar vgrstm avatar vmedcy avatar yvesll avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

devtools's Issues

[csolution] how to specify debug interface ?

Hi,

I do not think it has been specified yet but is it possible to specify the debug interface to be used with the csolution ?

My use-case:
csolution-->cprj-->uvision : here I need to select ST-Link

I would like that the ST-Link choice is made when defining application project.
I agree this is not build.

Build flag order needs to be kept

Currently there is no guarantee that e.g. "-I incpath2 -I incpath1" will be passed in that order when building since a set<> is used internally.

The build system first needs to be reliable, predictable and deterministic.

packchk : multiple include pdsc seems not possible

I tried to include 2 PDSC as specified in the usage:
Check: packchk <InFile.pdsc> -i <RefFile1.pdsc> -i ... <RefFile2.pdsc> -v

But only 1 is taken into account:
M051: Adding PDSC File: xxx
M051: Adding PDSC File: xxx OK

[projmgr] list packs related to my project ?

When invoking this command:

$ csolution list packs -s projects_layers/R-CUBE.csolution.yml

I get the list of all the packs present in my CMSIS_PACK_ROOT.

I hoped that by providing the csolution I would get the list of packs used by this application.

$ csolution --help
CMSIS Project Manager 0.9.0 (C) 2022 ARM

Thanks & Regards,
Fred

Directions adding cpackget to cbuild

Hi,

I'm working to integrate cpackget into cbuild by replacing cp_install.sh. Before I go ahead and open a PR, I'd like to ask a few questions/write down my thoughts to make sure I'm on the right path:

  1. What would be the best way to add the cpackget binary, or build it and release it along cbuild_install ? I had thought of adding cpackget's repo to .gitmodules, but I don't know if that's the best way to go
  2. I'll have to change the test in download_packs.sh and make sure its checks in postsetupcheck.sh are always passing. The main change will be in cbuild.sh where I'll get cpackget instead of cp_install.sh.
  3. Then update docs (CmdLineBuild.txt)
  4. Are there any other extra steps?

Thanks in advance!

Using locally referenced packs in build

While trying to use a pack that is locally referenced in $CMSIS_PACK_ROOT/.Local/local_repository.pidx there is this error:

*** ERROR M800:
  RTE Model reports: Error R821: Required pack not installed

Support for locally referenced packs is missing?

[CMSIS-Toolbox] Print config data

Print internal state variables in similar way as git:

$ git config --list
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
core.autocrlf=true
core.fscache=true
core.symlinks=false
core.usebuiltinfsmonitor=true
pull.rebase=false
credential.helper=manager-core
init.defaultbranch=main
core.autocrlf=true

"csolution config --list" could provide data like:

  • currently used installation folder CMSIS_PACK_ROOT
  • current project directory
  • tools folder CMSIS_BUILD_ROOT
  • CMSIS_COMPILER_ROOT
  • registered compiler paths

I would prefer configuration yml file in CMSIS-Toolbox installation folder instead of environment variables.

cdefaults.yml might allow custom redefinition of CMSIS_PACK_ROOT. I think it would be useful for destructive experiments, where is expected total re-installation of all packs afterwards. Re-installation of one huge centralized pack installation folder might consume too much time.

intdir / outdir folders are created in the wrong folder

If --intdir=... / --outdir=... are not specified on the command line to cbuildgen, these folders will be created in the parent folder instead.

The reason for this is because the m_projectDir does not contain a trailing slash, which means that when concatenating it with a path, the result will be missing a separator for the last segment.

Steps to reproduce:

  • Create a test.cprj that specifies
<output intdir="int" outdir="out" ... />
  • Run .../test$ cbuildgen test.cprj cmake
  • Observe that ../testint and ../testout was created instead of ../test/int and ../test/out

[csolution] cbuild error on LVGL Pack

I updated to latest version of tools to get "core0" fix for .cprj output.

  • Ran into issue where prior cproject.yml included "board". New tool excludes board, or fails to find.

  • Removing board the resulting project fails to find files for included LVGL pack. The files can be found in the RTE folder:
    image

  • The path in error seems in the weeds?
    image

Is the issue with the pack being installed prior to update in tool? I could wipe out and start again with tool/pack/project folders?

[projmgr] Using existing .cprj as lockfile

With the recent advances to the .yml format and projmgr/csolution tools I'd like to reopen the discussion around lockfiles.

It seems that the source of truth for the projects are now likely to be the .yml files.

Use-case: User adds a compiler flag to the project

  1. Manually edit the cproject/csolution.yml file to add the defined symbol
  2. Run csolution/projmgr tool to update .cprj files
  3. Trigger build of the project using cbuildgen and the cprj file

During step 2, if there is already a cprj file existing, we should preserve/reuse as much information from that as possible.

For example, the yml files may not specify any packs, or without any version ranges, but the .cprj may be strictly locked down to a specific pack+version.
Same for components.

For the above use-case, the user expects only the define to be added in the build. If the 2. would result in a full recompute/resolving of components+pack-versions it would make the .yml files impossible to use over time or between colleagues, since the contents of the .cprj would very likely be different due to changing CMSIS_PACK_ROOT contents.

This is a followup on the discussion from the build gap

Also, working in this way means that the user should put commit the .yml and the .cprj files in their git repository to make sure that colleagues/CI are building the same thing.

[devtools] Promote standalone tools being orchestrated by consumer itself

Currently Open-CMSIS devtools are supporting lot of nice features but would require some refactoring allowing to promote required flexibility to enable wide adoption. I would push to get "atomic" features a consumer may invoke at proper time according its own workflow.

I would appreciate to get following "atomic" features:

  • [cpackget] is fine to me. Its scope / feature list is quite well defined. Maybe to be renamed to [packget] compared to x2 following items.

  • [packgen] is fine to me. Its scope / feature list is quite well defined.

  • [packchk] is fine to me. Its scope / feature list is quite well defined.

  • I foresee following current [projmgr] capabilities as having to be part of a dedicated new [packlist] tool ?
    Commands:
    list packs Print list of installed packs
    devices Print list of available device names
    components Print list of available components

  • [buildmgr] has to be restricted in my view to generation from .cprj / .clayer to .mak / CMakeLists.txt leading to a [buildgen] tool ? Today [buildmgr] is involved doing *.clayer composition to .cprj and generating RTE material.
    Sounds *.clayer composition is moving to [projmgr] now.
    About RTE I'm myself confused "source code" generation is done asking for *.mak / CMakeLists.txt creation ... not able to foresee relationship between both.

  • [projmgr] has to be restricted in my view to generation from csolution.yml / cproject.yml / clayer.yml to .cprj leading to a [projgen] tool ? (already multiple comments if https://github.com/Open-CMSIS-Pack/devtools/pull/77/files 'project manager' is maybe not best naming)

  • We need then some [codegen] tool I guess to sustain code generation related to configurable components. Today such process is only available if Keil uVision usage (thru .gpdsc usage). According to me [codegen] has to be independent of [projmgr] process because end user may revisit some component parameters which are leading to same file set (content update "only") what has no impact on .yml/.cprj files.

  • We need some [rtegen] tool I guess to get such RTE process explicit out of any other process.

Based on all such a vendor may be able to rely on Open-CMSIS common assets keeping some room to support its own workflow I'm thinking.

[solution] why so many separators in the spec ?

Hi,

I agree it is more the spec than the tool but today I need to use many different separators in a project.yml file.
We have ::, :, & and @

[Cvendor::] Cclass [&Cbundle] :Cgroup [:Csub] [&Cvariant] [@[>=]Cversion]

Is it really useful to have so many different separators ?
Is it to be able to deal with optional parts?

Wouldn't it be simpler to say that the separator is always here but only the content can be omitted ?

So, from the more complete:
STMicroelectronics:Device:MyBundle:HAL:UART:variant1@>=0.0.1

To the less complete:
:Device::HAL::@0.0.2

It may look a bit "not so nice" but we do not have to scratch our head to know which separator to choose.

[projmgr] Source patterns have to be supported (as well as related excluded ones)

Per current https://github.com/Open-CMSIS-Pack/devtools/blob/a9919425f6554425e8723aee5bf7a9b299387e95/tools/projmgr/docs/Manual/Overview.md#groups-and-files proposal source description is file based.
It sounds like a pain from an IDE context. Such assumption is fully valuable if build reproducibility but purpose of *.cprj then. Considering project manager, so *.yml contributions, I would be please to add source patterns and related exclude patterns addon. Up to project manager process building *.cprj file to compute a runtime such patterns leading to a file based proposal.

groups:
- group: main
files:
- file: ./src/main.c
source_patterns:
- pattern: ./src/**/*.c
- pattern: ./src/**/*.cpp
exclude_patterns:
- pattern: ./src/**/*.md

- group: func1
files:
- file: ./func1/src/func1.c

Note: Keywords / schema to be discussed just promoting high level requirement here

[csolution] Print boards list

I am suggesting to print list of available boards in similar way as devices.
It is good to have reference during editing of project/solution yml files.

Usage:
  csolution <command> [<args>] [OPTIONS...]

Commands:
  list packs          Print list of installed packs
       devices        Print list of available device names
       components     Print list of available components
       dependencies   Print list of unresolved project dependencies
       contexts       Print list of contexts in a csolution.yml
  convert             Convert cproject.yml or csolution.yml in cprj files
  help                Print usage

Options:
  -p, --project arg   Input cproject.yml file
  -s, --solution arg  Input csolution.yml file
  -f, --filter arg    Filter words
  -o, --output arg    Output directory
  -h, --help          Print usage

This could be probably extended also for other categories like examples, vendors, keywords, conditions...

Not clear about how to set `packchk`

Hi,

For validating and compressing pack files, the packchk and 7z utilities shall be in the PATH:
packchk: https://github.com/ARM-software/CMSIS_5/tree/master/CMSIS/Utilities/

The instruction of adding packchk is not quite clear.
I copied the file PackChk to my current directory from "https://github.com/ARM-software/CMSIS_5/tree/master/CMSIS/Utilities/Linux64", and ran ./packgen manifest.yml -o output, the output is:

sh: 1: packchk: not found
packgen error: packchk failed

files under current directory:

├── ARM.TestPack.pdsc
├── CMakeLists.txt
├── lib1
│   ├── api
│   │   └── interface.h
│   ├── CMakeLists.txt
│   ├── config
│   │   └── config.h
│   ├── inc
│   │   └── lib1.h
│   └── src
│       └── lib1.cpp
├── lib2
│   ├── CMakeLists.txt
│   ├── inc
│   │   └── lib2.h
│   └── src
│       └── lib2.cpp
├── lib3
│   ├── CMakeLists.txt
│   ├── inc
│   │   └── lib3.h
│   └── src
│       └── lib3.cpp
├── lib4
│   ├── CMakeLists.txt
│   ├── inc
│   │   └── lib4.h
│   └── src
│       └── lib4.cpp
├── lib5
│   ├── CMakeLists.txt
│   ├── inc
│   │   └── lib5.h
│   └── src
│       └── lib5.cpp
├── LICENSE
├── manifest.yml
├── PackChk
└── packgen

[csolution] enhance debug logs

When converting a yml to cprj, it would be great to have additional logs:

  • The cprj indicates packs versions => the logs may show where the packs are taken from (physically on the disk, useful when we have several CMSIS_PACK_ROOT and switching between them

  • gpdsc => when the gpdsc add files in a component which is not present (wrong name or version) in the project we should be warned

[csolution] pack providing the board not listed in cprj

In my csolution I select a board:

solution:
  target-types:
    - type: B-U585I-IOT02A
      board: B-U585I-IOT02A

And I do not use any element from the pack defining this board in my project.
When I generate the cprj:

  <packages>
    <package name="CMSIS" vendor="ARM" version="5.8.0"/>
    <package name="STM32U5xx_DFP" vendor="STMicroelectronics" version="0.0.1"/>
  </packages>

The package defining the board is not listed here.

[projmgr] Open door to vendor specific project(s)

I foresee csolution.yml like the good way to describe as end user a complex application relying on multiple projects like https://github.com/Open-CMSIS-Pack/devtools/blob/main/tools/projmgr/test/data/TrustZoneSolutionLayers/TrustZone.csolution.yml.
I'm discussing here only about relationship between projects description.

We have to anticipate a vendor may introduce some project(s) which is(are) not fully Open-CMSIS compliant. Open-CMSIS compliant means to get bare minimum & meaningful required cproject.yml content.
A vendor may promote as part of application project dependencies (because useful to get dependencies described somewhere) some contributions which are not component aware ones.

I would push so for a new key if cproject.yml allowing [projmgr] to ignore it as part of common processing.

[projmgr] get version

Very minor thing puzzling me a bit:

$ csolution --help
CMSIS Project Manager 0.9.0 (C) 2022 ARM
...

but:

$ csolution --version
error csolution: Option 'version' does not exist

Maybe the --version can be helpful ?
Because to me the 0.9.0 is the version of the bundle, probably not the version of the csolution part ?

Proposal: CPRJ Extensions

The CPRJ format shall be extended to cope with several add-ons introduced within the csolution concept:​

  • Description of inter-context dependencies. All related CPRJs and their inter-dependencies should lead to the generation of a top-level CMakeLists.txt file. To keep the separation of concerns between Project Manager and Build Manager this should be described in the intermediate format.​
  • Compiler options abstractions​
  • Defines and Includes at group/file level​
  • Pre/post-build steps (TBD)

Proposal: Multi CPRJ collection = MCPRJ​

<mcprj ...>​
  <contexts>​
    <context>​
      <path>./parentProject.buildType+targetType.cprj</path>​
    </context>​
    <context>​
      <path>./project.buildType+targetType.cprj</path>​
      <depends>parentProject.buildType+targetType</depends>​
    </context> ​
  </contexts>​
</mcprj>​

CPRJ schemas extension proposal: #170

After hearing @madchutney concerns I believe a good complementary information to add to this proposal could be the explicit back reference from a cprj to its parent mcprj. In such case the Build Manager can unequivocally recognize whether the cprj is part of a multi-project solution. For example:

<cprj ...>
  <info ...>
    <mcprj>path/to/.mcprj</mcprj>
  </info>
</cprj>

warning csolution: key 'processor' was not recognized

My csolution.yml is like this:

# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/0.9.0/tools/projmgr/schemas/csolution.schema.json

solution:
  target-types:
    - type: STM32U585I-IOT02A
      device: STM32U585AIIx
      processor: 
        trustzone: off          # TrustZone disabled for this project              
      defines:
        - STM32U585xx
        - USE_FULL_LL_DRIVER
        - USE_HAL_DRIVER

  build-types:
    - type: AC6
      compiler: AC6
    - type: GCC
      compiler: GCC

  # packs:
    # specify the DFP pack to avoid selecting the U5 device from Keil DFP pack
    # - pack: STMicroelectronics::STM32U5xx_DFP
  projects:
    - project: ./gpio-toggle.cproject.yml

And I get this issue:

frq09468@LMECWL0888  /c/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects
$ csolution.exe -s gpio-toggle.csolution.yml list dependencies
C:/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects/gpio-toggle.csolution.yml - warning csolution: yaml schemas were not found, file can
not be validated
C:/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects/gpio-toggle.csolution.yml:7:7 - warning csolution: key 'processor' was not recognized
C:/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects/gpio-toggle.cproject.yml - warning csolution: yaml schemas were not found, file cannot be validated
error csolution: context was not specified

This seems to be allowed here:
https://github.com/Open-CMSIS-Pack/devtools/blob/main/tools/projmgr/docs/Manual/YML-Format.md#build-types

[solution] Several DFP packs in generated CPRJ

Hin

I have a cproject.yml like this:

  components:
    - component: STMicroelectronics::Application:Example&HAL_GPIO_Toggle
...
    - component: STMicroelectronics::Device:Startup

I converted it to cprj:

frq09468@LMECWL0888  /c/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects
$ csolution.exe -s gpio-toggle.csolution.yml convert
C:/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects/gpio-toggle.csolution.yml - warning csolution: yaml schemas were not found, file cannot be validated
C:/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects/gpio-toggle.cproject.yml - warning csolution: yaml schemas were not found, file cannot be validated
C:/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects/gpio-toggle+STM32U585I-IOT02A.cprj - info csolution: file generated successfully

But then I can see 2 DFP packs being referenced for the U5:

  <packages>
    <package name="CMSIS" vendor="ARM" version="5.8.0"/>
    <package name="STM32U5xx_DFP" vendor="Keil" version="1.1.0"/>
    <package name="Example_HAL_GPIO_Toggle" vendor="STMicroelectronics" version="0.0.1"/>
    <package name="STM32U5xx_DFP" vendor="STMicroelectronics" version="0.0.1"/>
    <package name="STM32U5xx_Drivers" vendor="STMicroelectronics" version="0.0.1"/>
    <package name="board_resources_B-U585I-IOT02A" vendor="STMicroelectronics" version="0.0.1"/>
  </packages>

Why is the DFP from Keil referenced here ?

[projmgr] Library project dependency is not well set

Creating a csolution project describing two cproject ones:

solution:
projects:
- project: ./Project_1/Project_1.cproject.yml
depends:
- Project_2
- project: ./Project_2/Project_2.cproject.yml

If one is set to output-type: lib being dependency of second we end up at that time with some lacking directives if related .cprj file content.

<group name="Project Dependencies">
<file category="other" name=".a"/>
</group>

and nothing if </ldflags>

cbuildgen / make cmake default config files more generic with toolchain version

Hi

Default cmake config files:
https://github.com/Open-CMSIS-Pack/devtools/tree/main/tools/buildmgr/cbuildgen/config

For ex, I am with GCC 10.3.1, but GCC.10.2.1.cmake is used.
It seems that some parts will not be correct:
https://github.com/Open-CMSIS-Pack/devtools/blob/main/tools/buildmgr/cbuildgen/config/GCC.10.2.1.cmake#L156-L158

We can't know which version has all users... How can we make these file more generic ?

Thx

[projmgr] Open door to vendor specific data addon

As common good practice we have to find a way to allow vendor specific data addon to project manager metadata (*.yml files).
See https://github.com/Open-CMSIS-Pack/devtools/pull/77/files#r787702533

Intention is to get Open-CMSIS project manager as smart as possible but just incase we cannot anticipate all vendor specific corner cases / integration context etc.
Even thinking continuous improvement of devtools, sounds nice to consider a contributor may first Thanks some official backdoor validate (possibly in production) its future addon to main solution.

I guess if we want to ensure a robust solution, no choice, *.yml stuff has to be validated up front against a schema. So I do not foresee any chance to support custom material addon to common basis.

Do we have then to add as an option which is part of main schema some include like statement ? Such include statement may allow to get a vendor specific *.<vendor>.yml close to and referenced by related main *.yml file.

solution:
- project: ./SWProject_1/SWProject_1.cproject.yml
- project: ./SWProject_2/SWProject_2.cproject.yml
vendor-extension: ./.extended.csolution.yml

Today produces .csolution.yml:4:1 - warning projmgr: key 'vendor-extension' was not recognized
Good is no blocking process but long run I would prefer to block it (more robust) preventing at same time spurious trace.
Primary *.yml has to be validated strictly against an Open-CMSIS schema. Vendor specific part if under vendor responsibility.

Finding currently used packs programmatically

When we release a binary, we need to record the version numbers of the various packs that went into it (so we can reliably reproduce it later).
Can anyone suggest a reliable way of achieving this please?

We use Keil uVision 5, Sourcetree/git under Windoze and don't (yet!) build our own packs.

[solution] multi-compilers support

I tried to create a cproject like this:

project:
  compiler: AC6
  compiler: GCC
  optimize: size                   # Code optimization: emphasis code size
  debug: on                        # Enable debug symbols
...

And did the following:

frq09468@LMECWL0888  /c/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects
$ csolution.exe -s gpio-toggle.csolution.yml convert
C:/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects/gpio-toggle.csolution.yml - warning csolution: yaml schemas were not found, file cannot be validated
C:/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects/gpio-toggle.cproject.yml - warning csolution: yaml schemas were not found, file cannot be validated
C:/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects/gpio-toggle+STM32U585I-IOT02A.cprj - info csolution: file generated successfully

frq09468@LMECWL0888  /c/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects
$ cbuild.sh gpio-toggle+STM32U585I-IOT02A.cprj --toolchain=GCC
(cbuild.sh): Build Invocation 0.10.4 (C) 2021 ARM
xmllint was not found, proceed without xml validation
(cbuildgen): Build Process Manager 0.10.4+p53-g0715f4d (C) 2022 ARM
M650: Command completed successfully.
(cbuildgen): Build Process Manager 0.10.4+p53-g0715f4d (C) 2022 ARM

*** ERROR M800:
  RTE Model reports: Error R817: Toolchain not supported by project: GCC: gpio-toggle+STM32U585I-IOT02A.cprj

Indeed, the CPRJ does not contain anything about GCC:

  <compilers>
    <compiler name="AC6" version="6.16.0"/>
  </compilers>

I would have expected a CPRJ looking a bit like this (except the version):

  <compilers>
    <compiler name="AC6" version="6.0.0:6.99.99"/>
    <compiler name="GCC" version="9.0.0:9.99.99"/>
  </compilers>

Discuss Consistency of Version Range Specification (PDSC/CPRJ vs. cproject.YML)

For consistency reasons and reuse of existing implementation we should consider aligning version range specification in PDSC/CPRJ and cproject.yml

PDSC/CPRJ:

@1.2.3         larger or equal
@1.2.3:1.2.3   strictly equal (fixed version)
@1.2.3:1.3.0   any version in the rage from 1.2.3 till 1.2.99

cproject.yml:

- component: ARM::CMSIS:CORE           # CMSIS Core component from vendor ARM (any version)
- component: ARM::CMSIS:[email protected]     # CMSIS Core component from vendor ARM (with version 5.5.0)
- component: ARM::CMSIS:CORE@>=5.5.0   # CMSIS Core component from vendor ARM (with version 5.5.0 or higher)
- component: ARM::CMSIS:CORE@~=5.5.0  # CMSIS Core component from vendor ARM (version compatible with 5.5.0)

use '~=' to indicate compatible version based on semantic versioning (= major version unchanged).

[csolution] project compiling with cbuild.sh does not compile with uvision

I can build successfully:

$ cbuild.sh gpio-toggle.AC6+STM32U585I-IOT02A.cprj
(cbuild.sh): Build Invocation 0.10.4 (C) 2021 ARM
gpio-toggle.AC6+STM32U585I-IOT02A.cprj validates
(cbuildgen): Build Process Manager 0.10.4+p53-g0715f4d (C) 2022 ARM
M650: Command completed successfully.
(cbuildgen): Build Process Manager 0.10.4+p53-g0715f4d (C) 2022 ARM
M652: Generated file for project build: 'C:/Cube20/stm32cube_fw_all/examples/hal/gpio/toggle/projects/gpio-toggle.AC6+STM32U585I-IOT02A_IntDir/CMakeLists.txt'
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.22/Modules/Compiler/ARMClang.cmake:91 (message):
  Policy CMP0123 is not set: ARMClang cpu/arch compile and link flags must be
  set explicitly.  Run "cmake --help-policy CMP0123" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

  For compatibility, CMake will automatically add cpu/arch flags based on the
  CMAKE_SYSTEM_PROCESSOR and/or CMAKE_SYSTEM_ARCH variables.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.22/Modules/Compiler/ARMClang-C.cmake:3 (__compiler_armclang)
  C:/Program Files/CMake/share/cmake-3.22/Modules/CMakeCInformation.cmake:25 (include)
  CMakeLists.txt:59 (project)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: C:/Cube20/stm32cube_fw_all/examples/hal/gpio/toggle/projects/gpio-toggle.AC6+STM32U585I-IOT02A_IntDir
[1/15] Building C object CMakeFiles/gpio-toggle.AC6+STM32U585I-IOT02A.dir/C_/Cube20/stm32cube_fw_all/examples/hal/gpio/toggle/targets/B-U585I-IOT02A/stm32_system.o
[2/15] Building C object CMakeFiles/gpio-toggle.AC6+STM32U585I-IOT02A.dir/C_/Cube20/examples/hal/gpio/toggle/example.o
[3/15] Building C object CMakeFiles/gpio-toggle.AC6+STM32U585I-IOT02A.dir/C_/Cube20/stm32cube_fw_all/examples/hal/gpio/toggle/targets/B-U585I-IOT02A/stm32_gpio.o
[4/15] Building C object CMakeFiles/gpio-toggle.AC6+STM32U585I-IOT02A.dir/C_/Cube20/examples/hal/gpio/toggle/example_status.o
[5/15] Building C object CMakeFiles/gpio-toggle.AC6+STM32U585I-IOT02A.dir/C_/Cube20/examples/hal/gpio/toggle/main.o
[6/15] Building C object CMakeFiles/gpio-toggle.AC6+STM32U585I-IOT02A.dir/C_/Cube20/infra/Firmware/drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_gpio.o
[7/15] Building C object CMakeFiles/gpio-toggle.AC6+STM32U585I-IOT02A.dir/C_/Cube20/infra/Firmware/drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal.o
[8/15] Building C object CMakeFiles/gpio-toggle.AC6+STM32U585I-IOT02A.dir/C_/Cube20/infra/Firmware/drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_cortex.o
[9/15] Building C object CMakeFiles/gpio-toggle.AC6+STM32U585I-IOT02A.dir/C_/Cube20/infra/Firmware/drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_pwr.o
[10/15] Building C object CMakeFiles/gpio-toggle.AC6+STM32U585I-IOT02A.dir/C_/Cube20/infra/Firmware/drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_pwr_ex.o
[11/15] Building C object CMakeFiles/gpio-toggle.AC6+STM32U585I-IOT02A.dir/C_/Cube20/infra/Firmware/drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_rcc.o
[12/15] Building C object CMakeFiles/gpio-toggle.AC6+STM32U585I-IOT02A.dir/C_/Cube20/infra/Firmware/drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal_rcc_ex.o
[13/15] Building C object CMakeFiles/gpio-toggle.AC6+STM32U585I-IOT02A.dir/C_/Cube20/infra/Firmware/cmsis/Device/ST/STM32U5xx/Source/startup_stm32u585xx.o
[14/15] Building C object CMakeFiles/gpio-toggle.AC6+STM32U585I-IOT02A.dir/c2beb62ea54e6255ca3e9c1c2ab641e8/gpio/toggle/projects/RTE/Device/STM32U585AIIx/system_stm32u5xx.o
[15/15] Linking C executable C:\Cube20\stm32cube_fw_all\examples\hal\gpio\toggle\projects\gpio-toggle.AC6+STM32U585I-IOT02A_OutDir\gpio-toggle.AC6+STM32U585I-IOT02A.axf
cbuild.sh finished successfully!

This cprj:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<cprj schemaVersion="1.7.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PACK.xsd">
  <created timestamp="2022-03-07T11:10:49" tool="csolution 0.9.1+p2-g0715f4d"/>

  <info isLayer="false">
    <description>Automatically generated project</description>
  </info>

  <packages>
    <package name="CMSIS" vendor="ARM" version="5.8.0"/>
    <package name="STM32U5xx_DFP" vendor="Keil" version="1.1.0"/>
    <package name="Example_HAL_GPIO_Toggle" vendor="STMicroelectronics" version="0.0.1"/>
    <package name="STM32U5xx_DFP" vendor="STMicroelectronics" version="0.0.1"/>
    <package name="STM32U5xx_Drivers" vendor="STMicroelectronics" version="0.0.1"/>
    <package name="board_resources_B-U585I-IOT02A" vendor="STMicroelectronics" version="0.0.1"/>
  </packages>

  <compilers>
    <compiler name="AC6" version="6.16.0"/>
  </compilers>

  <target Ddsp="DSP" Dfpu="SP_FPU" Dname="STM32U585AIIx" Dsecure="TZ-disabled" Dtz="TZ" Dvendor="STMicroelectronics:13">
    <output intdir="gpio-toggle.AC6+STM32U585I-IOT02A_IntDir/" name="gpio-toggle.AC6+STM32U585I-IOT02A" outdir="gpio-toggle.AC6+STM32U585I-IOT02A_OutDir/" type="exe"/>
    <ldflags compiler="AC6" file="RTE/Device/STM32U585AIIx/stm32u585xx_flash.sct"/>
    <defines>STM32U585xx;USE_HAL_DRIVER</defines>
  </target>

  <components>
    <component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.5.0"/>
    <component Cclass="Application" Cgroup="Example" Cvariant="HAL_GPIO_Toggle" Cvendor="STMicroelectronics" Cversion="0.0.1"/>
    <component Cbundle="B-U585I-IOT02A" Cclass="Board Support" Cgroup="Board Resource" Cvendor="STMicroelectronics" Cversion="0.0.1"/>
    <component Cclass="Device" Cgroup="STM32 HAL" Csub="Common" Cvendor="STMicroelectronics" Cversion="0.0.1"/>
    <component Cclass="Device" Cgroup="STM32 HAL" Csub="Cortex" Cvendor="STMicroelectronics" Cversion="0.0.1"/>
    <component Cclass="Device" Cgroup="STM32 HAL" Csub="GPIO" Cvendor="STMicroelectronics" Cversion="0.0.1"/>
    <component Cclass="Device" Cgroup="STM32 HAL" Csub="PWR" Cvendor="STMicroelectronics" Cversion="0.0.1"/>
    <component Cclass="Device" Cgroup="STM32 HAL" Csub="RCC" Cvendor="STMicroelectronics" Cversion="0.0.1"/>
    <component Cclass="Device" Cgroup="Startup" Cvendor="STMicroelectronics" Cversion="0.0.1">
      <file attr="config" category="header" name="Include/stm32_external_env.h" version="0.0.1"/>
      <file attr="config" category="linkerScript" name="Source/Templates/arm/linker/stm32u585xx_flash.sct" version="0.0.1"/>
      <file attr="config" category="source" name="Source/Templates/system_stm32u5xx.c" version="0.0.1"/>
    </component>
  </components>

  <files>
    <group name="Generated Code">
      <file category="sourceC" name="../targets/B-U585I-IOT02A/stm32_gpio.c"/>
      <file category="header" name="../targets/B-U585I-IOT02A/stm32_gpio.h"/>
      <file category="sourceC" name="../targets/B-U585I-IOT02A/stm32_system.c"/>
      <file category="header" name="../targets/B-U585I-IOT02A/stm32_system.h"/>
      <file category="header" name="../targets/B-U585I-IOT02A/stm32_target.h"/>
      <file category="header" name="../targets/B-U585I-IOT02A/stm32_assert.h"/>
      <file category="header" name="../targets/B-U585I-IOT02A/stm32u5xx_hal_conf.h"/>
    </group>
  </files>
</cprj>

And by default I get this error:

image

packchk : wrong ERROR M310 ?

Hi

It seems that function that is checking file name doesn't work when path name includes "." ?

*** ERROR M310: C:/xxx/STMicroelectronics.STM32U5xx_Drivers.pdsc (Line 597) 
  Filename mismatch (case sensitive):
  PDSC name : 'config/ReferenceFiles/CRC/stm32_crc_template.h'
  Filename  : '.config/ReferenceFiles/CRC/stm32_crc_template.h'

Here is STMicroelectronics.STM32U5xx_Drivers.pdsc (Line 597):

        <file category="other" name=".config/ReferenceFiles/CRC/stm32_crc_template.h"/>

Build error: No such file or directory - <filesystem>

When I am trying to build the tool, an error is reported:

In file included from /home/minsun01/git/devtools/libs/rtefsutils/src/RteFsUtils.cpp:15:0:
/home/minsun01/git/devtools/libs/rtefsutils/include/RteFsUtils.h:23:12: fatal error: filesystem: No such file or directory
   #include <filesystem>
            ^~~~~~~~~~~~
compilation terminated.

The cmake configuration process is finished with no error, but the build process broke down.
These are the information:

-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building for: Linux
-- Found PythonInterp: /usr/bin/python (found version "3.6.9")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/minsun01/git/devtools/build

Could you give me some guide?

PackChk problem with "doc" attribute in the <example> element

I have encountered an issue with PackChk where is does not check the documentation path of an example correctly. Consider the following in a PDSC file:

<example name="MyExample" folder="Boards/v1/MyExample" doc="../../../Documentation/html/myexamples.html" version="1.0">
  <description>This is an example</description>
  <board vendor="Anyone" name="MyEVK" Dvendor="ARM:82"/>
  <project>
    <environment name="uv"  folder="./" load="MyExample.uvprojx"/>
  </project>
  <attributes>
    <component Cclass="CMSIS" Cgroup="Core"/>
    <component Cclass="Device" Cgroup="Startup"/>
  </attributes>
</example>

According to the PACK.xsd, the "doc" attribute is relative to the "folder" attribute. And it is not forbidden to specify folders in a couple of levels above (../../../). But PackChk throws an error on this, like:

*** ERROR M310: C:\03_work\Packs\Anyone\build\Anyone.MyPack.pdsc (Line 465)
  Filename mismatch (case sensitive):
  PDSC name : 'Boards\v1\MyExample\..\..\..\Documentation\html\myexamples.html'
  Filename  : 'Boards\v1\MyExample\v1\Boards\build\Documentation\html\myexamples.html'

PackChk needs to traverse the folder structure correctly to identify the correctness of the PDSC file.

CMSIS Tools: common message output format for error/warning/info

We should align on a common message output format across the different Open-CMSIS-Pack tool / library components.

This is a proposal of a output format that would work also in IDE context with the possibility to synchronize to source file:

relpath/filename.ext:line:col: - msg_type tool_id+msg_id: message

where:

  • file specification is optional and composed of:

    • relpath is a relative path to the working directory
    • filename is the filename that this message relates too
    • ext is the complete file extension
    • line is the line number that this message relates too (optional)
    • col is the column number that this message relates too (optional)
    • ' - ' (optional only present when a file specification is part of the message).
  • msg_type indicates the severe level of the message and is "error", "warning", "info"

  • tool_id is a 2-character identifier for the tool or libs component (i.e. CP for CMSIS Project Manager, RM for RTE Model)

  • msg_id is a 3-digit decimal number that is assigned to the message (could be used for context help)

  • message is a text message with 2 optional fields that provide context

The message text should come from a (per component) central string table, which would allow to translate messages into different languages. Optional fields are inserted into the message text as 'field'.

In source code the tool_id+msg_id should be used to refer to the message, i.e.

OutInfo (CP123, ....);

Examples:

test.cproject.yml - error CP001: file not found

The input file does not exist.

test.cproject.yml - error CP002: value for 'compiler:' not set

There is not value defined for the required key 'compiler:'. 'compiler:' is a optional message parameter, so that the message could be also for any other must have key, such as 'device:'.

test.cproject.yml - error CP003: multiple components were found for identifier 'Device.Startup'
ARM::Device.Startup:1.2.2
ARM::Device.Startup:C Startup:2.0.3

The component identifier 'Device.Startup' does not allow to select a unique component from the list of software packs.

Alternatively such messages could be also presented using two optional message parameters.

test.cproject.yml - error CP003: multiple items were found for 'component:' identifier 'Device.Startup'
ARM::Device.Startup:1.2.2
ARM::Device.Startup:C Startup:2.0.3

Same message as before, but also 'component:' was supplied as optional parameter.

myproj/test.cproject.yml:10 - error CP003: multiple items were found for 'device:' identifier 'LPC55S69'
NXP::LPC55S69JBD100
NXP::LPC55S69JET98

In this case the device: identifier at source line 10 is incorrect

TestProject/test.cproject.yml:12:4 - error CP004: incorrect input format, end of map not found

A syntax error with line and col information.

Longer term
We could also offer the option to output colors with error messages. At this point, I would not mandate for it as not every console might support it. An output could look like:

color-message

error csolution: context was not specified

My csolution.yml is like this:

# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/0.9.0/tools/projmgr/schemas/csolution.schema.json

solution:
  target-types:
    - type: STM32U585I-IOT02A
      device: STM32U585AIIx
      processor: 
        trustzone: off          # TrustZone disabled for this project              
      defines:
        - STM32U585xx
        - USE_FULL_LL_DRIVER
        - USE_HAL_DRIVER

  build-types:
    - type: AC6
      compiler: AC6
    - type: GCC
      compiler: GCC

  # packs:
    # specify the DFP pack to avoid selecting the U5 device from Keil DFP pack
    # - pack: STMicroelectronics::STM32U5xx_DFP
  projects:
    - project: ./gpio-toggle.cproject.yml

And I get this issue:

frq09468@LMECWL0888  /c/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects
$ csolution.exe -s gpio-toggle.csolution.yml list dependencies
C:/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects/gpio-toggle.csolution.yml - warning csolution: yaml schemas were not found, file can
not be validated
C:/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects/gpio-toggle.csolution.yml:7:7 - warning csolution: key 'processor' was not recognized
C:/Cube20/stm32cube_fw_u5/examples/hal/gpio/toggle/projects/gpio-toggle.cproject.yml - warning csolution: yaml schemas were not found, file cannot be validated
error csolution: context was not specified

[projmgr] [buildmgr] Open door to more compilers

Per current schemas supported compilers are limited to AC6, IAR & GCC:

"CompilerType": {
"type": "string",
"pattern": "^(GCC|AC6|IAR)(@(\d+\.\d+\.\d+((\+|\-)[\w.+-]+)?))?$",
"description": "Selection of the toolchain used in the project (GCC, AC6, IAR), optionally with version, for example [email protected]"
},

What about if aiming to rely on clang as example ?

Configure default 3-way merge utility for 'unattended' merge

The PLM of configuration file requires to run a three way merge of configuration files:
a) default configuration file @ version A
b) modified configuration file based on version A
c) default configuration file @ version B
=> all modifications shall be applied to default configuration file @ version B

a) In an IDE or CLI interactive development flow the merge operation should be executed manually by the User, who should be able to configure the preferred merge utility as part of the IDE/CLI specific environment configuration (not workspace/solution/project specific)
b) In an unattended CI workflow the 'csolution' tool may attempt to execute the 3-way merge automatically in case of a change in the configuration file version. In case of "errors" the original configuration file is restored. For this case we need to configure the 3-way merge utility via an installation specific config file or using an Environment Variable as we are using for specifying the default CMSIS_PACK_ROOT.

[projmgr] Get rid of project name usage as much as possible

I would push to not propagate project name across project description files, artifacts, etc.
From my experience it's a real pain thinking alive project having at a point end user expecting to rename a project. Project renaming is so common / one click operation if IDE usage. Promoting project name at too many places is a mess then including source control workflow pain.

Current project manager proposal is requiring from my trial to get a unique name if *.cproject files. Most obvious policy is <project name>.cproject.yml. By the end of process lot of artifacts are project name related like:

  • <project name>.cprj
  • <cprj><target><output intdir="<project name>_IntDir" outdir="<project name>_OutDir"></target></cprj>

I would push to get rid as much as possible of project name propagation. Thinking best is to rely on directory structure which is required anyway to support data separation. I would prefer to move:

  • from <project name>.csolution.yml to .csolution.yml
  • from <project name>.cproject.yml to .cproject.yml
  • etc. ...
  • from <output intdir="<project name>_IntDir" to <output intdir="IntDir"

Please find attached some basic project setup allowing to support PR contribution activity: GetRidOfProjectName.zip
Extra note: as part of such delivery "_OK" material is tagged as "OK" because only functional setup if current project manager code base ... per my comment I would push to get "_KO" material being supported as result of such issue solving

[projmgr] [buildmgr] Opportunity to introduce toolchain-independent configuration using the most common generic configurations

Discussion initiated if #120

#120 (comment)
#120 (comment)
#120 (comment)

Sounds good to me to get dedicated issue to comment / amend on.

Discussion is about following yml schema contributions: https://github.com/Open-CMSIS-Pack/devtools/blob/main/tools/projmgr/schemas/common.schema.json

"OptimizeType": {
"enum": [ "max", "size", "speed", "debug" ],
"description": "Generic optimize levels (max, size, speed, debug) for code generation."
},
"DebugType": {
"enum": [ "on", "off" ],
"description": "Generic control for the generation of debug information (on, off)."
},
"WarningsType": {
"enum": [ "no", "all", "Misra", "AC5-like" ],
"description": "Control warnings (no, all, Misra, AC5-like)."
},

[csolution] Declare c99 support in cprj

When I open the cprj generated with csolution for AC6, by default the C language is C90 and all warnings are turned on.

I need to change it manually like this:

image

I do not find how I can tune this from the yml definition ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.