-
Notifications
You must be signed in to change notification settings - Fork 4
201 lines (177 loc) · 6.68 KB
/
bxarm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: BXARM on Linux
# This workflow will run when a push is made to any branch in the repository
on: push
# Workflow's environment variables can be referred by all jobs
env:
TARGET_DIR: /opt/iarsystems/bxarm-9.60.2/arm/bin
COMMON_DIR: /opt/iarsystems/bxarm-9.60.2/common/bin
jobs:
build-library:
runs-on: [ self-hosted, linux ]
steps:
- uses: actions/checkout@v4
- name: Check compiler version
run: |
$COMMON_DIR/../../arm/bin/iccarm --version
- name: Build library
run: |
$COMMON_DIR/iarbuild project/EWARM/ChecksumLibrary.ewp -make Debug -log all
- name: Upload library
uses: actions/upload-artifact@v3
with:
name: library
path: project/EWARM/Debug/Exe/ChecksumLibrary.a
if-no-files-found: error
cstat-library:
runs-on: [ self-hosted, linux ]
steps:
- uses: actions/checkout@v4
- name: C-STAT - Library
run: |
$COMMON_DIR/iarbuild project/EWARM/ChecksumLibrary.ewp -cstat_analyze Debug -log all
$COMMON_DIR/iarbuild project/EWARM/ChecksumLibrary.ewp -cstat_report Debug -log all
- name: Upload library report (C-STAT)
uses: actions/upload-artifact@v3
with:
name: library-report.html
path: project/EWARM/Debug/C-STAT/*.html
if-no-files-found: error
build-project:
needs: build-library
runs-on: [ self-hosted, linux ]
steps:
- uses: actions/checkout@v4
- name: Download library
uses: actions/download-artifact@v3
with:
name: library
path: project/EWARM/Debug/Exe/
- name: Build project
run: |
$COMMON_DIR/iarbuild project/EWARM/project.ewp -make Debug -log all
- name: Upload project
uses: actions/upload-artifact@v3
with:
name: project
path: project/EWARM/Debug/Exe/project.out
if-no-files-found: error
# Comment out the `cstat-project` job if your license has no IAR C-STAT for static code analysis
cstat-project:
needs: build-project
runs-on: [ self-hosted, linux ]
steps:
- uses: actions/checkout@v4
- name: Static Analysis
run: |
$COMMON_DIR/iarbuild project/EWARM/project.ewp -cstat_analyze Debug -log all
$COMMON_DIR/iarbuild project/EWARM/project.ewp -cstat_report Debug -log all
- name: Upload project report (C-STAT)
uses: actions/upload-artifact@v3
with:
name: project-cstat.html
path: project/EWARM/project/C-STAT/*.html
if-no-files-found: error
# Comment out the `crun-project` job if your license has no IAR C-RUN for runtime analysis
crun-project:
needs: build-project
runs-on: [ self-hosted, linux ]
steps:
- name: Download project
uses: actions/download-artifact@v3
with:
name: project
path: project/EWARM/Debug/Exe/
- name: Runtime Analysis
run: |
$COMMON_DIR/CSpyBat \
$TARGET_DIR/libarmPROC.so \
$TARGET_DIR/libarmSIM2.so \
--plugin=$TARGET_DIR/libarmLibsupportUniversal.so \
--debug_file=project/EWARM/Debug/Exe/project.out \
--rtc_enable \
--rtc_output=crun-messages.txt \
--timeout=2000000 \
--backend \
--cpu=cortex-m4 \
--fpu=vfpv4_sp \
--endian=little \
--semihosting || true
- name: Upload project report (C-RUN)
uses: actions/upload-artifact@v3
with:
name: project-crun.txt
path: ./crun-messages.txt
if-no-files-found: error
# Update `needs` to `build-project` if you do not have C-STAT and/or C-RUN enabled for your license
cspy-project-on-hw:
needs: [ cstat-project, crun-project ]
runs-on: [ self-hosted, linux ]
steps:
- name: Download project
uses: actions/download-artifact@v3
with:
name: project
path: project/EWARM/Debug/Exe/
- name: Run project on-hardware
run: |
$COMMON_DIR/CSpyBat \
$TARGET_DIR/libarmPROC.so \
$TARGET_DIR/libarmJET.so \
--plugin=$TARGET_DIR/libarmLibsupportUniversal.so \
--device_macro=$TARGET_DIR/../config/debugger/ST/STM32F4xx.dmac \
--flash_loader=$TARGET_DIR/../config/flashloader/ST/FlashSTM32F4xxx.board \
--debug_file=project/EWARM/Debug/Exe/project.out \
--timeout=2000000 \
--backend \
--board_file=$TARGET_DIR/../config/flashloader/ST/FlashSTM32F4xxx.board \
--endian=little \
--cpu=cortex-m4 \
--fpu=vfpv4_sp \
-p $TARGET_DIR/../config/debugger/ST/STM32F407VG.ddf \
--semihosting \
--device=STM32F407VG \
--multicore_nr_of_cores=1 \
--jet_standard_reset=9,0,0 \
--reset_style=\"0,-,0,Disabled__no_reset_\" \
--reset_style=\"1,-,0,Software\" \
--reset_style=\"2,-,0,Hardware\" \
--reset_style=\"3,-,0,Core\" \
--reset_style=\"4,-,0,System\" \
--reset_style=\"9,ConnectUnderReset,1,Connect_during_reset\" \
--jet_power_from_probe=switch_off \
--drv_communication_log=cspycomm.log \
--drv_interface=SWD \
--jet_swo_protocol=Manchester \
--jet_cpu_clock=72000000 \
--jet_swo_prescaler=1 \
--drv_catch_exceptions=0xff0 \
--drv_trace_settings=None
- name: Upload C-SPY log
uses: actions/upload-artifact@v3
with:
name: cspycomm.log
path: ./cspycomm.log
if-no-files-found: error
# Update `needs` to `build-project` if you do not have C-STAT and/or C-RUN enabled for your license
deploy:
needs: cspy-project-on-hw
runs-on: [ self-hosted, linux ]
steps:
- name: Download ELF
uses: actions/download-artifact@v3
with:
name: project
path: ./
- name: Convert to SREC
run: |
mkdir output
$TARGET_DIR/ielftool --srec --verbose project.out output/project.srec
- name: Convert to HEX
run: |
$TARGET_DIR/ielftool --ihex --verbose project.out output/project.hex
- name: Upload firmwares
uses: actions/upload-artifact@v3
with:
name: firmwares-srec-hex
path: ./output/*.*
if-no-files-found: error