Skip to content

Commit abaa9f8

Browse files
always build all projects + test libs (commaai#1038)
* always build all projects * and tests * fix that
1 parent d3e2477 commit abaa9f8

File tree

5 files changed

+45
-55
lines changed

5 files changed

+45
-55
lines changed

Jenkinsfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pipeline {
4040
--volume /var/run/dbus:/var/run/dbus \
4141
--net host \
4242
${env.DOCKER_IMAGE_TAG} \
43-
bash -c 'cd /tmp/panda && ./board/build_all.sh && PANDAS_JUNGLE=23002d000851393038373731 PANDAS_EXCLUDE=\"1d0002000c51303136383232 2f002e000c51303136383232\" ./tests/automated/test.sh'"
43+
bash -c 'cd /tmp/panda && scons -j8 && PANDAS_JUNGLE=23002d000851393038373731 PANDAS_EXCLUDE=\"1d0002000c51303136383232 2f002e000c51303136383232\" ./tests/automated/test.sh'"
4444
}
4545
}
4646
}
@@ -56,7 +56,7 @@ pipeline {
5656
--volume /var/run/dbus:/var/run/dbus \
5757
--net host \
5858
${env.DOCKER_IMAGE_TAG} \
59-
bash -c 'cd /tmp/panda && ./board/build_all.sh && JUNGLE=058010800f51363038363036 H7_PANDAS_EXCLUDE=\"080021000c51303136383232\" ./tests/canfd/test_canfd.py'"
59+
bash -c 'cd /tmp/panda && scons -j8 && JUNGLE=058010800f51363038363036 H7_PANDAS_EXCLUDE=\"080021000c51303136383232\" ./tests/canfd/test_canfd.py'"
6060
}
6161
}
6262
}

SConstruct

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ AddOption('--test',
22
action='store_true',
33
help='build test files')
44

5+
# panda fw
56
SConscript('board/SConscript')
67

7-
if GetOption('test'):
8-
SConscript('tests/safety/SConscript')
8+
# test files
9+
SConscript('tests/safety/SConscript')

board/README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,13 @@ Programming
2121
**Panda**
2222

2323
```
24-
./flash.sh # for any pandas
24+
./flash.sh # for any panda
2525
```
2626

2727
Troubleshooting
2828
----
2929

30-
If your panda will not flash and is quickly blinking a single Green LED, use:
31-
```
32-
./recover_h7.sh # for red panda
33-
./recover.sh # for other pandas
34-
```
30+
If your panda will not flash and is quickly blinking a single Green LED, use `recover.sh`.
3531

3632
A [panda paw](https://comma.ai/shop/products/panda-paw) can be used to put panda into DFU mode.
3733

board/SConscript

+38-39
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import copy
23
import subprocess
34

45
PREFIX = "arm-none-eabi-"
@@ -7,25 +8,23 @@ BUILDER = "DEV"
78
common_flags = []
89
build_projects = {}
910

10-
if os.getenv("PEDAL"):
11-
build_projects["pedal"] = {
12-
"MAIN": "pedal/main.c",
13-
"STARTUP_FILE": "stm32fx/startup_stm32f205xx.s",
14-
"LINKER_SCRIPT": "stm32fx/stm32fx_flash.ld",
15-
"APP_START_ADDRESS": "0x8004000",
16-
"PROJECT_FLAGS": [
17-
"-mcpu=cortex-m3",
18-
"-msoft-float",
19-
"-DSTM32F2",
20-
"-DSTM32F205xx",
21-
"-O2",
22-
"-DPEDAL",
23-
],
24-
}
25-
26-
if os.getenv("PEDAL_USB"):
27-
build_projects["pedal_usb"] = build_projects.pop("pedal")
28-
build_projects["pedal_usb"]["PROJECT_FLAGS"].append("-DPEDAL_USB")
11+
build_projects["pedal"] = {
12+
"MAIN": "pedal/main.c",
13+
"STARTUP_FILE": "stm32fx/startup_stm32f205xx.s",
14+
"LINKER_SCRIPT": "stm32fx/stm32fx_flash.ld",
15+
"APP_START_ADDRESS": "0x8004000",
16+
"PROJECT_FLAGS": [
17+
"-mcpu=cortex-m3",
18+
"-msoft-float",
19+
"-DSTM32F2",
20+
"-DSTM32F205xx",
21+
"-O2",
22+
"-DPEDAL",
23+
],
24+
}
25+
26+
build_projects["pedal_usb"] = copy.deepcopy(build_projects["pedal"])
27+
build_projects["pedal_usb"]["PROJECT_FLAGS"].append("-DPEDAL_USB")
2928

3029
build_projects["panda"] = {
3130
"MAIN": "main.c",
@@ -45,25 +44,23 @@ build_projects["panda"] = {
4544
],
4645
}
4746

48-
# arm-none-eabi-gcc on comma two has no cortex-m7 support
49-
if not os.path.exists("/EON"):
50-
build_projects["panda_h7"] = {
51-
"MAIN": "main.c",
52-
"STARTUP_FILE": "stm32h7/startup_stm32h7x5xx.s",
53-
"LINKER_SCRIPT": "stm32h7/stm32h7x5_flash.ld",
54-
"APP_START_ADDRESS": "0x8020000",
55-
"PROJECT_FLAGS": [
56-
"-mcpu=cortex-m7",
57-
"-mhard-float",
58-
"-DSTM32H7",
59-
"-DSTM32H725xx",
60-
"-mfpu=fpv5-d16",
61-
"-fsingle-precision-constant",
62-
"-Os",
63-
"-g",
64-
"-DPANDA",
65-
],
66-
}
47+
build_projects["panda_h7"] = {
48+
"MAIN": "main.c",
49+
"STARTUP_FILE": "stm32h7/startup_stm32h7x5xx.s",
50+
"LINKER_SCRIPT": "stm32h7/stm32h7x5_flash.ld",
51+
"APP_START_ADDRESS": "0x8020000",
52+
"PROJECT_FLAGS": [
53+
"-mcpu=cortex-m7",
54+
"-mhard-float",
55+
"-DSTM32H7",
56+
"-DSTM32H725xx",
57+
"-mfpu=fpv5-d16",
58+
"-fsingle-precision-constant",
59+
"-Os",
60+
"-g",
61+
"-DPANDA",
62+
],
63+
}
6764

6865
if os.getenv("RELEASE"):
6966
BUILD_TYPE = "RELEASE"
@@ -137,6 +134,7 @@ with open("obj/cert.h", "w") as f:
137134
for cert in certs:
138135
f.write("\n".join(cert) + "\n")
139136

137+
140138
for project_name in build_projects:
141139
project = build_projects[project_name]
142140
linkerscript_fn = File(project["LINKER_SCRIPT"]).srcnode().abspath
@@ -169,7 +167,8 @@ for project_name in build_projects:
169167
'Objcopy': Builder(generator=objcopy, suffix='.bin', src_suffix='.elf')
170168
}
171169
)
172-
startup = project_env.Object(project["STARTUP_FILE"])
170+
171+
startup = project_env.Object(f"obj/startup_{project_name}", project["STARTUP_FILE"])
173172

174173
# Bootstub
175174
crypto_obj = [

board/build_all.sh

-6
This file was deleted.

0 commit comments

Comments
 (0)