-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proposal for Run+Debug Management (#208)
Added also _RTE_ preprocessor symbols
- Loading branch information
1 parent
e9fb7a4
commit cfcda5a
Showing
5 changed files
with
178 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
# Proposal - Run and Debug Management | ||
|
||
<!-- markdownlint-disable MD009 --> | ||
<!-- markdownlint-disable MD013 --> | ||
<!-- markdownlint-disable MD036 --> | ||
<!-- markdownlint-disable MD032 --> | ||
|
||
This proposal discusses how the CMSIS-Toolbox may simplify workflows with programming and debug tools. | ||
|
||
- [Proposal - Run and Debug Management](#proposal---run-and-debug-management) | ||
- [Overview](#overview) | ||
- [Run and Debug Information Management](#run-and-debug-information-management) | ||
- [The problems to solve](#the-problems-to-solve) | ||
- [Proposed solution](#proposed-solution) | ||
- [Usage](#usage) | ||
- [Questions](#questions) | ||
|
||
## Overview | ||
|
||
The CMSIS-Pack PDSC files contain information about device/board parameters and software components: | ||
|
||
- [Flash algorithms](https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/flashAlgorithm.html) of device memory (in DFP) and board memory (in BSP). | ||
- On-board debug adapter (a default programming/debug channel) including features. | ||
- Available memory of device and board. | ||
- Device parameters such as processor core(s) and clock speed. | ||
- [Debug Access Sequences](https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/debug_description.html) and [System Description Files](https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/sdf_pg.html) that support more complex Cortex-A/R/M configurations. | ||
- [CMSIS-SVD System View Description (SVD)](https://open-cmsis-pack.github.io/svd-spec/main/index.html) files for viewing device peripherals. | ||
- [CMSIS-View Software Component Viewer Description (SCVD)](https://arm-software.github.io/CMSIS-View/latest/SCVD_Format.html) files for analysis of software components (RTOS, Middleware). | ||
|
||
The CMSIS-Toolbox build system manages device/board/software components and controls the build output (typically ELF/DWARF files) and has provisions for HEX, BIN and post-processing. It allows to manage different [target-types](build-overview.md#project-setup-for-multiple-targets-and-builds) and the [context set](build-overview.md#working-with-context-set) manages the images that belong to a target. | ||
|
||
In addition the user may need the following information which should be added to the YML-Input files for the CMSIS-Toolbox. | ||
|
||
- Flash algorithms for external memory in custom hardware. | ||
- Additional images that should be loaded. | ||
- Device configuration information. | ||
- Access information for protected debug ports (i.e. encryption keys). | ||
|
||
|
||
## Run and Debug Information Management | ||
|
||
### The problems to solve | ||
|
||
- Provide information for command line and IDE workflows in a consistent way. | ||
- Simplify the implementation in run and debug tools, reduce dependency to other tools. | ||
- Ensure that information is portable, i.e from a cloud-hosted CI system to a desktop test system. | ||
- Provide flexibility and ease-of-use. | ||
|
||
Today, some programmers access DFP and BSP information via the packs. This results in additional complexity of the tool and more dependencies. | ||
|
||
In VS Code, [task configurations](https://code.visualstudio.com/docs/editor/tasks) control the **Run** action (`tasks.json`) and [launch configurations](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations) control the **Debug** action (`launch.json`). The `tasks.json` and `launch.json` files store multiple configurations and are located in the `.vscode` folder of your workspace (the csolution project root folder). The current implementation uses extension commands to obtain project information. This limits the portability of these files. | ||
|
||
**Example `launch.json:** | ||
|
||
```json | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "Arm Debugger", | ||
"type": "arm-debugger", | ||
"request": "launch", | ||
"serialNumber": "${command:device-manager.getSerialNumber}", | ||
"programs": "${command:cmsis-csolution.getBinaryFiles}", | ||
"cmsisPack": "${command:cmsis-csolution.getTargetPack}", | ||
"deviceName": "${command:cmsis-csolution.getDeviceName}", | ||
"processorName": "${command:cmsis-csolution.getProcessorName}" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### Proposed solution | ||
|
||
- Introduce a new target-type specific file `*.cbuild-run.yml` generated by CMSIS-Toolbox. This file provides access to PDSC information and build output of one target. | ||
- Potentially export the [Debug Access Sequences](https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/debug_description.html) into an additional parameter file as PDSC file processing is complexity due to device dependencies. | ||
- Introduce a new folder `.cmsis` that contains these additional files. This folder might be also used for other build information files. | ||
|
||
 | ||
|
||
The `cbuild-run.yml` file represents a context-set. | ||
|
||
**Content of `*.cbuild-run.yml`:** | ||
|
||
```yml | ||
run: # Start of file, contains run and debug information for a target | ||
generated-by: csolution version 2.7.0 | ||
solution: ../USB_Device.csolution.yml | ||
target-type: +STM32U585AIIx | ||
compiler: AC6 | ||
board: STMicroelectronics::B-U585I-IOT02A:Rev.C | ||
board-pack: Keil::B-U585I-IOT02A_BSP@2.0.0 | ||
device: STMicroelectronics::STM32U585AIIx | ||
device-pack: Keil::STM32U5xx_DFP@3.0.0 | ||
|
||
programming: # Flash programming algorithms | ||
- algorithm: ${CMSIS_PACK_ROOT}/DFP-path/<programming-algorithm> | ||
- algorithm: ${CMSIS_PACK_ROOT}/BSP-path/<programming-algorithm> | ||
config: <potential config options> # is this required | ||
- algorithm: custom-hw-path/<programming-algorithm> | ||
|
||
output: # application image files | ||
- type: elf | ||
file: HID.axf | ||
load: <scope> # all (default), symbols only, binary only | ||
|
||
system-description: | ||
- file: ${CMSIS_PACK_ROOT}/DFP-path/<svd> | ||
type: svd | ||
- file: ${CMSIS_PACK_ROOT}/pack-path/<scvd> | ||
type: scvd | ||
from-pack: <pack> | ||
|
||
# information from DFP, BSP specific to the target | ||
# https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/packFormat.html | ||
board: # Board element | ||
debugProbe: | ||
... | ||
debugInterface: | ||
... | ||
debug-port: # Information from DFP | ||
access-port-v1: | ||
... | ||
access-port-v2: | ||
... | ||
jtag: | ||
cjtag: | ||
swd: | ||
|
||
default-settings: # Default debug configuration | ||
default: # debug protocol (SWD or JTAG) to use for target connections. | ||
clock: # clock setting in Hz for a target connection. | ||
swj: # allows Serial Wire Debug (SWD) and JTAG protocols | ||
dormant: # device access via CoreSight DP requires the dormant state | ||
sdf: ${CMSIS_PACK_ROOT}/DFP-path/<sdf> # path of the system description file (SDF). | ||
|
||
sequences: | ||
... | ||
|
||
trace: | ||
... | ||
``` | ||
### Usage | ||
The `*.cbuild-run.yml` file can be directly passed to programmers and debug tools, for example using a command line option. It contains all information that needs to be passed. | ||
|
||
```bash | ||
>programmer -csolution MySolution+MyHardware.cbuild-run.yml | ||
``` | ||
|
||
## Questions | ||
|
||
- What should be done now to simplify above information while making it more future proof? | ||
|
||
For CMSIS-Toolbox 3.0: | ||
|
||
- Should the location of cbuild information files change to folder `.\.cmsis`? | ||
- Should the structure of build information file change and include `cbuild-run.yml`? The cbuild information file will then represent a context-set, and not just one context. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.