Skip to content

Commit

Permalink
Further rework to improve ReadTheDocs. Fixed:
Browse files Browse the repository at this point in the history
  • Loading branch information
ReinhardKeil committed Jan 7, 2025
1 parent 20979ec commit aef3c73
Show file tree
Hide file tree
Showing 16 changed files with 207 additions and 2,440 deletions.
12 changes: 5 additions & 7 deletions docs/CreateApplications.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ An application is based on a *device* and/or *board* supported by a Device Famil

- For simple projects, the default settings should be sufficient.

- The [build information file](YML-CBuild-Format.md#cbuild-output-files) `<name>.cbuild.Debug+<target-name>.yml` lists configuration files of components and other useful information such as links to documentation of the component.
- The [build information file](YML-CBuild-Format.md) `<name>.cbuild.Debug+<target-name>.yml` lists configuration files of components and other useful information such as links to documentation of the component.

### Step 6: Add application functionality

Expand Down Expand Up @@ -296,15 +296,13 @@ A potential solution is discussed [here](https://github.com/Open-CMSIS-Pack/devt
**Duplicate Heap definition in Assembler startup file**

When using memory allocation functions (i.e. `malloc`), the application ends in a hard fault handler. This is typically caused by different methods of stack and heap definitions.
The Arm Compiler offers [three ways to configure stack and heap](https://developer.arm.com/documentation/100073/0623/The-Arm-C-and-C---Libraries/Stack-and-heap-memory-allocation-and-the-Arm-C-and-C---libraries/Stack-pointer-initialization-and-heap-bounds).

- Use a scatter file to define `ARM_LIB_STACKHEAP`, `ARM_LIB_STACK`, or `ARM_LIB_HEAP` regions.
The Arm Compiler offers [three ways to configure stack and heap](https://developer.arm.com/documentation/100073/0623/The-Arm-C-and-C---Libraries/Stack-and-heap-memory-allocation-and-the-Arm-C-and-C---libraries/Stack-pointer-initialization-and-heap-bounds). Only one of the following methods should be used:

- Use a linker scatter file to define `ARM_LIB_STACKHEAP`, `ARM_LIB_STACK`, or `ARM_LIB_HEAP` regions.
- Use the symbols `__initial_sp`, `__heap_base`, and `__heap_limit`.
- Implement `__user_setup_stackheap()` or `__user_initial_stackheap()`.

!!! Warning
You have to choose one of these three ways.

The [C startup code](https://arm-software.github.io/CMSIS_6/latest/Core/startup_c_pg.html) recommended by CMSIS Version 6 uses the linker scatter file for stack and heap definition. The C startup code is generic and works across all toolchains that are supported by the CMSIS-Toolbox.

However, some assembler startup files define stack and heap with other methods, for example by using the symbols `__initial_sp`, `__heap_base`, and `__heap_limit`.
Expand All @@ -313,7 +311,7 @@ There are two options to solve the problem.

1. Remove the stack and heap definition in the assembler startup code.

2. Disable in the [Regions Header File](#regions-header-file) the stack and heap definition by setting `__STACK_SIZE` and `__HEAP_SIZE` to 0 as shown below.
2. Disable in the [Regions Header File](#regions-header-file) the stack and heap definition by setting `__STACK_SIZE` and `__HEAP_SIZE` to 0 as shown below. This removes the definition in the linker scatter file.

```txt
// <h> Stack / Heap Configuration
Expand Down
207 changes: 98 additions & 109 deletions docs/YML-CBuild-Format.md

Large diffs are not rendered by default.

2,032 changes: 0 additions & 2,032 deletions docs/YML-Input-Format - Preinclude.md

This file was deleted.

7 changes: 3 additions & 4 deletions docs/YML-Input-Format.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CMSIS Solution Project File Format
# CSolution Project Format

<!-- markdownlint-disable MD009 -->
<!-- markdownlint-disable MD013 -->
Expand Down Expand Up @@ -394,14 +394,13 @@ When [`cdefault:`](#solution) is specified in the `*.csolution.yml` file, the **
the compiler with specific default controls. The search order for this file is:

- A [`cdefault.yml`](build-overview.md#cdefaultyml) file in the same directory as the `<solution-name>.csolution.yml` file.
- A [`cdefault.yml`](build-overview.md#cdefaultyml) file in the directory specified by the environment variable [`CMSIS_COMPILER_ROOT`](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/blob/main/docs/installation.md#environment-variables).
- A [`cdefault.yml`](build-overview.md#cdefaultyml) file in the directory [`<cmsis-toolbox-installation-dir>/etc`](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/blob/main/docs/installation.md##etccmake).
- A [`cdefault.yml`](build-overview.md#cdefaultyml) file in the directory [`<cmsis-toolbox-installation-dir>/etc`](installation.md#environment-variables).

The `default:` node is the start of a [`cdefault.yml`](build-overview.md#cdefaultyml) file and contains the following.

`default:` | | Content
:---------------------------------------------------------|:-----------|:------------------------------------
&nbsp;&nbsp; [`misc:`](#misc) | Optional | Literal tool-specific controls. Refer to [Build Overview - `cdefault.yml`](build-overview.md#cdefaultyml) for an example.
&nbsp;&nbsp; [`misc:`](#misc) | Optional | Literal tool-specific controls. Refer to [CSolution Project Structure - `cdefault.yml`](build-overview.md#cdefaultyml) for an example.

!!! Note
The [`compiler:`](#compiler) selection in `cdefault.yml` has been deprecated in CMSIS-Toolbox 2.6.0.
Expand Down
8 changes: 4 additions & 4 deletions docs/build-operation.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ Typical IDE environments use a `--context-set` that specifies the [context](buil
- Check correctness of all files specified by `<name>.csolution.yml`.
- Evaluate the potential [software layers](YML-CBuild-Format.md#configurations) for [Reference Applications](ReferenceApplications.md) using `variables:` to refer to layers (if the value is undefined). All projects are considered in this step.
- Evaluate the [selectable compiler toolchains](YML-CBuild-Format.md#select-compiler) when the *csolution project* does not contain a `compiler:` selection or the `--toolchain` option is not applied. The available toolchains are based on the [compiler registration](installation.md#compiler-registration) and the `select-compiler:` node in the file [`<name>.csolution.yml`](YML-Input-Format.md#solution) or [`cdefault.yml`](YML-Input-Format.md#cdefault).
- Create the file `compile_commands.json` in the [output directory](build-overview.md#output-directory-structure) for the context defined in [`*.cbuild-set.yml`](YML-CBuild-Format.md#cbuild-output-files).
- Create the file `compile_commands.json` in the [output directory](build-overview.md#output-directory-structure) for the context defined in [`*.cbuild-set.yml`](YML-CBuild-Format.md).

!!! Note
The file `compile_commands.json` is generated by `CMake` with the option `--target <context>-database` and contains all source files of the `context` along with compiler options. It is used by the [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense) system of an IDE.

The operation is further controlled by options:

- The option `--packs` downloads missing software packs.
- The option `--context-set` restricts the operation to the [`context-set`](build-overview.md#working-with-context-set) selected by the file [`<name>.cbuild-set.yml`](YML-CBuild-Format.md#cbuild-output-files). If this file is missing a file `<name>.cbuild-set.yml` with selection of the first `target-type`, the first `build-type`, and first `project` that is specified in the file `<name>.csolution.yml` is created.
- The option `--context-set` restricts the operation to the [`context-set`](build-overview.md#working-with-context-set) selected by the file [`<name>.cbuild-set.yml`](YML-CBuild-Format.md). If this file is missing a file `<name>.cbuild-set.yml` with selection of the first `target-type`, the first `build-type`, and first `project` that is specified in the file `<name>.csolution.yml` is created.
- The option [`--update-rte`](build-overview.md#rte-directory-structure) updates the configuration files of the application.
- With the option `--frozen-packs` the file `*.cbuild-pack.yml` is used as input. An error is issued when a pack version changes.
- The option `--toolchain` can be used to explicitly select a compiler.
Expand Down Expand Up @@ -245,11 +245,11 @@ solution:
## Generator Integration
The diagram below shows how a generator is integrated into the CMSIS build process. The data flow is exemplified on STM32CubeMX (Generator ID for this example is `CubeMX`). The information about the project is delivered to the generator using the [Generator Information](YML-CBuild-Format.md#generator-information-files) files (`<csolution-name>.cbuild-gen-idx.yml` and `<context>.cbuild-gen.yml`). This information provides `CubeMX` with the project context, such as selected board or device, and CPU mode such as TrustZone disabled/enabled.
The diagram below shows how a generator is integrated into the CMSIS build process. The data flow is exemplified on STM32CubeMX (Generator ID for this example is `CubeMX`). The information about the project is delivered to the generator using the [Generator Information](YML-CBuild-Format.md#generator-information-files) files (`<solution-name>.cbuild-gen-idx.yml` and `<context>.cbuild-gen.yml`). This information provides `CubeMX` with the project context, such as selected board or device, and CPU mode such as TrustZone disabled/enabled.

![Generator Integration](./images/Generator-Integration.png "Generator Integration")

The utility [`cbridge`](https://github.com/Open-CMSIS-Pack/generator-bridge) gets as parameter the `<csolution-name>.cbuild-gen-idx.yml` and calls the generator. For the `CubeMX` generator example these files are created:
The utility [`cbridge`](https://github.com/Open-CMSIS-Pack/generator-bridge) gets as parameter the `<solution-name>.cbuild-gen-idx.yml` and calls the generator. For the `CubeMX` generator example these files are created:

- `*.ioc` CubeMX project file with current project settings
- `*.c/.h` source files, i.e. for interfacing with drivers
Expand Down
Loading

0 comments on commit aef3c73

Please sign in to comment.