Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 119 additions & 1 deletion .github/workflows/CubeMX-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ on:
jobs:
Build:
runs-on: ubuntu-latest

outputs:
build_status: ${{ steps.build_step.outcome }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -26,10 +27,127 @@ jobs:
uses: ARM-software/cmsis-actions/vcpkg@v1
with:
config: ".ci/vcpkg-configuration.json"
continue-on-error: false

- name: Capture vcpkg activation output
if: always()
run: |
mkdir -p logs
echo "=== vcpkg Artifacts Activation ===" > logs/vcpkg_artifacts.log
cd $(dirname ".ci/vcpkg-configuration.json")
vcpkg activate 2>&1 | tee -a $GITHUB_WORKSPACE/logs/vcpkg_artifacts.log || echo "vcpkg activate failed" >> $GITHUB_WORKSPACE/logs/vcpkg_artifacts.log

- name: Upload tool logs
if: always()
uses: actions/upload-artifact@v4
with:
name: tool-logs
path: logs/

- name: Activate Arm tool license
uses: ARM-software/cmsis-actions/armlm@v1

- name: Build project with AC6
id: build_step
working-directory: ./CubeMX/
run: cbuild CubeMX.csolution.yml --packs --toolchain AC6 --rebuild

CollectData:
runs-on: ubuntu-latest
needs: Build
if: always()
steps:
- name: Download tool logs
uses: actions/download-artifact@v4
with:
name: tool-logs
path: logs/

- name: Parse and collect data
run: |
# Parse vcpkg artifacts log
if [ -f logs/vcpkg_artifacts.log ]; then
echo "Parsing vcpkg artifacts log..."
cat logs/vcpkg_artifacts.log
else
echo "No vcpkg artifacts log found"
fi

- name: Generate JSON report
run: |
cat << 'EOF' > collect_data.py
import json
import re
from datetime import datetime

def parse_vcpkg_artifacts_log(log_path):
cmsis_toolbox_version = None
try:
with open(log_path, 'r') as f:
content = f.read()

# Parse the vcpkg artifacts table for cmsis-toolbox
# Looking for line like: "arm:tools/open-cmsis-pack/cmsis-toolbox 2.12.0 will install"
match = re.search(r'arm:tools/open-cmsis-pack/cmsis-toolbox\s+(\S+)\s+', content)
if match:
cmsis_toolbox_version = match.group(1)

except FileNotFoundError:
print("vcpkg artifacts log file not found")
except Exception as e:
print(f"Error parsing vcpkg artifacts log: {e}")

return cmsis_toolbox_version

# Collect data
data = {
"workflow": "CubeMX: Test Build",
"repo": "${{ github.repository }}",
"run_id": "${{ github.run_id }}",
"run_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"job": {
"last_run": datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ"),
"status": "${{ needs.Build.outputs.build_status }}",
"passed": "${{ needs.Build.outputs.build_status }}" == "success"
},
"tools": {
"cmsis_toolbox": parse_vcpkg_artifacts_log("logs/vcpkg_artifacts.log")
}
}

# Print JSON
print(json.dumps(data, indent=2))

# Save to file
with open('workflow_data.json', 'w') as f:
json.dump(data, f, indent=2)
EOF

python3 collect_data.py

- name: Display collected data
id: collected_data
run: |
echo "json=$(jq -c '.' workflow_data.json)" >> "$GITHUB_OUTPUT"
echo "=== Workflow Data Collection ==="
cat workflow_data.json

- name: Upload workflow data
uses: actions/upload-artifact@v4
with:
name: workflow-data
path: workflow_data.json

- name: Emit to central repo
uses: peter-evans/repository-dispatch@v4
with:
token: ${{ secrets.METRICS_PAT }} # PAT or GitHub App token
repository: soumeh01/test_ts_app # <-- your central repo
event-type: ci_metrics
client-payload: |
{
"source": "${{ github.repository }}",
"workflow": "CubeMX: Test Build",
"metrics": ${{ steps.collected_data.outputs.json }}

}
81 changes: 70 additions & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,89 @@
"type": "arm-debugger",
"request": "launch",
"programs": [
"${workspaceFolder}/SimpleTrustZone/out/CM33_ns/CS300/Debug/CM33_ns.axf",
"${workspaceFolder}/SimpleTrustZone/out/CM33_s/CS300/Debug/CM33_s.axf"
"${workspaceFolder}/SimpleTrustZone/out/CM33_ns/CS300/Debug/CM33_ns.axf",
"${workspaceFolder}/SimpleTrustZone/out/CM33_s/CS300/Debug/CM33_s.axf"
],
"programMode": "ram",
// armdbg --cdb-list
"cdbEntry": "Arm FVP::MPS2_Cortex_M33::Bare Metal Debug::Bare Metal Debug::Cortex-M33_0",
"cdbEntryParams": {
"model_params": "-f ${workspaceFolder}/SimpleTrustZone/model_config.txt"
"cdbEntryParams": {
"model_params": "-f ${workspaceFolder}/SimpleTrustZone/model_config.txt"
}
},
{
"name": "SimpleTZ (GCC/Clang)",
"type": "arm-debugger",
"request": "launch",
"programs": [
"${workspaceFolder}/SimpleTrustZone/out/CM33_ns/CS300/Debug/CM33_ns.elf",
"${workspaceFolder}/SimpleTrustZone/out/CM33_s/CS300/Debug/CM33_s.elf"
"${workspaceFolder}/SimpleTrustZone/out/CM33_ns/CS300/Debug/CM33_ns.elf",
"${workspaceFolder}/SimpleTrustZone/out/CM33_s/CS300/Debug/CM33_s.elf"
],
"programMode": "ram",
// armdbg --cdb-list
"cdbEntry": "Arm FVP::MPS2_Cortex_M33::Bare Metal Debug::Bare Metal Debug::Cortex-M33_0",
"cdbEntryParams": {
"model_params": "-f ${workspaceFolder}/SimpleTrustZone/model_config.txt"
"cdbEntryParams": {
"model_params": "-f ${workspaceFolder}/SimpleTrustZone/model_config.txt"
}
},
{
"name": "STLink@pyOCD (launch)",
"type": "gdbtarget",
"request": "launch",
"cwd": "${workspaceFolder}/CubeMX",
"program": "out\\CubeMX\\MyBoard_ROM\\Debug\\CubeMX.axf",
"gdb": "arm-none-eabi-gdb",
"preLaunchTask": "CMSIS Load",
"initCommands": [
"monitor reset halt",
"tbreak main"
],
"customResetCommands": [
"monitor reset halt",
"tbreak main",
"continue"
],
"target": {
"server": "pyocd",
"serverParameters": [
"gdbserver",
"--probe",
"stlink:",
"--connect",
"attach",
"--cbuild-run",
"${command:cmsis-csolution.getCbuildRunFile}",
"--quiet",
"--log",
"*.cbuild_run,*server=info"
],
"port": "3333"
},
"cmsis": {
"cbuildRunFile": "${command:cmsis-csolution.getCbuildRunFile}",
"updateConfiguration": "auto"
}
},
{
"name": "STLink@pyOCD (attach)",
"type": "gdbtarget",
"request": "attach",
"cwd": "${workspaceFolder}/CubeMX",
"program": "out\\CubeMX\\MyBoard_ROM\\Debug\\CubeMX.axf",
"gdb": "arm-none-eabi-gdb",
"initCommands": [
""
],
"customResetCommands": [
"monitor reset halt",
"tbreak main",
"continue"
],
"target": {
"port": "3333"
},
"cmsis": {
"cbuildRunFile": "${command:cmsis-csolution.getCbuildRunFile}",
"updateConfiguration": "auto"
}
}
]
}
}