Compare commits

..

4 Commits

Author SHA1 Message Date
Adeeb Shihadeh db336329c5 fix not going onroad on clean dashcam install (#2280) 2020-10-06 11:11:04 +02:00
Adeeb Shihadeh 7a7f343978 Fix calibration invalid alert on startup 2020-10-05 22:08:03 -07:00
Vehicle Researcher 49d82d6ac1 openpilot v0.7.9 release 2020-10-02 01:45:44 +00:00
Vehicle Researcher 0aa4867be4 openpilot v0.7.8 release 2020-08-13 00:37:05 +00:00
347 changed files with 9470 additions and 7623 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ You can test your changes on your machine by running `run_docker_tests.sh`. This
### Automated Testing
All PRs and commits are automatically checked by Github Actions. Check out `.github/workflows/` for what Github Actions runs. Any new tests sould be added to Github Actions.
All PRs and commits are automatically checked by Github Actions. Check out `.github/workflows/` for what Github Actions runs. Any new tests should be added to Github Actions.
### Code Style and Linting
@@ -28,7 +28,7 @@ Code is automatically checked for style by Github Actions as part of the automat
We've released a [Model Port guide](https://medium.com/@comma_ai/openpilot-port-guide-for-toyota-models-e5467f4b5fe6) for porting to Toyota/Lexus models.
If you port openpilot to a substantially new car brand, see this more generic [Brand Port guide](https://medium.com/@comma_ai/how-to-write-a-car-port-for-openpilot-7ce0785eda84). You might also be eligible for a bounty. See our bounties at [comma.ai/bounties.html](https://comma.ai/bounties.html)
If you port openpilot to a substantially new car brand, see this more generic [Brand Port guide](https://medium.com/@comma_ai/how-to-write-a-car-port-for-openpilot-7ce0785eda84). You might also be eligible for a bounty.
## Pull Requests
Vendored
+112 -45
View File
@@ -1,33 +1,60 @@
pipeline {
agent {
docker {
image 'python:3.7.3'
args '--user=root'
def phone(String ip, String step_label, String cmd) {
def ci_env = "CI=1 TEST_DIR=${env.TEST_DIR} GIT_BRANCH=${env.GIT_BRANCH} GIT_COMMIT=${env.GIT_COMMIT}"
withCredentials([file(credentialsId: 'id_rsa_public', variable: 'key_file')]) {
sh label: step_label,
script: """
ssh -tt -o StrictHostKeyChecking=no -i ${key_file} -p 8022 root@${ip} '${ci_env} /usr/bin/bash -le' <<'EOF'
echo \$\$ > /dev/cpuset/app/tasks || true
echo \$PPID > /dev/cpuset/app/tasks || true
mkdir -p /dev/shm
chmod 777 /dev/shm
cd ${env.TEST_DIR} || true
${cmd}
exit 0
EOF"""
}
}
def phone_steps(String device_type, steps) {
lock(resource: "", label: device_type, inversePrecedence: true, variable: 'device_ip', quantity: 1) {
timeout(time: 60, unit: 'MINUTES') {
phone(device_ip, "kill old processes", "pkill -f comma || true")
phone(device_ip, "git checkout", readFile("selfdrive/test/setup_device_ci.sh"),)
steps.each { item ->
phone(device_ip, item[0], item[1])
}
}
}
}
pipeline {
agent none
environment {
COMMA_JWT = credentials('athena-test-jwt')
TEST_DIR = "/data/openpilot"
}
stages {
stage('Release Build') {
agent {
docker {
image 'python:3.7.3'
args '--user=root'
}
}
when {
branch 'devel-staging'
}
steps {
lock(resource: "", label: 'eon-build', inversePrecedence: true, variable: 'eon_ip', quantity: 1){
timeout(time: 60, unit: 'MINUTES') {
dir(path: 'selfdrive/test') {
sh 'pip install paramiko'
sh 'python phone_ci.py "cd release && PUSH=1 ./build_release2.sh"'
}
}
}
phone_steps("eon-build", [
["build release2-staging and dashcam-staging", "cd release && PUSH=1 ./build_release2.sh"],
])
}
}
stage('On-device Tests') {
stage('openpilot tests') {
when {
not {
anyOf {
@@ -36,51 +63,91 @@ pipeline {
}
}
parallel {
stage('Build') {
environment {
CI_PUSH = "${env.BRANCH_NAME == 'master' ? 'master-ci' : ''}"
stages {
/*
stage('PC tests') {
agent {
dockerfile {
filename 'Dockerfile.openpilotci'
args '--privileged --shm-size=1G --user=root'
}
}
steps {
lock(resource: "", label: 'eon', inversePrecedence: true, variable: 'eon_ip', quantity: 1){
timeout(time: 60, unit: 'MINUTES') {
dir(path: 'selfdrive/test') {
sh 'pip install paramiko'
sh 'python phone_ci.py "cd release && ./build_devel.sh"'
}
stages {
stage('Build') {
steps {
sh 'scons -j$(nproc)'
}
}
}
post {
always {
// fix permissions since docker runs as another user
sh "chmod -R 777 ."
}
}
}
*/
stage('Replay Tests') {
steps {
lock(resource: "", label: 'eon2', inversePrecedence: true, variable: 'eon_ip', quantity: 1){
timeout(time: 60, unit: 'MINUTES') {
dir(path: 'selfdrive/test') {
sh 'pip install paramiko'
sh 'python phone_ci.py "cd selfdrive/test/process_replay && ./camera_replay.py"'
stage('On-device Tests') {
agent {
docker {
image 'python:3.7.3'
args '--user=root'
}
}
stages {
stage('parallel tests') {
parallel {
stage('Devel Build') {
environment {
CI_PUSH = "${env.BRANCH_NAME == 'master' ? 'master-ci' : ' '}"
}
steps {
phone_steps("eon", [
["build devel", "cd release && CI_PUSH=${env.CI_PUSH} ./build_devel.sh"],
["test openpilot", "nosetests -s selfdrive/test/test_openpilot.py"],
["test cpu usage", "cd selfdrive/test/ && ./test_cpu_usage.py"],
["test car interfaces", "cd selfdrive/car/tests/ && ./test_car_interfaces.py"],
["test spinner build", "cd selfdrive/ui/spinner && make clean && make"],
["test text window build", "cd selfdrive/ui/text && make clean && make"],
])
}
}
stage('Replay Tests') {
steps {
phone_steps("eon2", [
["camerad/modeld replay", "cd selfdrive/test/process_replay && ./camera_replay.py"],
])
}
}
stage('HW + Unit Tests') {
steps {
phone_steps("eon", [
["build cereal", "SCONS_CACHE=1 scons -j4 cereal/"],
["test sounds", "nosetests -s selfdrive/test/test_sounds.py"],
["test boardd loopback", "nosetests -s selfdrive/boardd/tests/test_boardd_loopback.py"],
["test loggerd", "CI=1 python selfdrive/loggerd/tests/test_loggerd.py"],
//["test updater", "python installer/updater/test_updater.py"],
])
}
}
}
}
}
}
stage('HW Tests') {
steps {
lock(resource: "", label: 'eon', inversePrecedence: true, variable: 'eon_ip', quantity: 1){
timeout(time: 60, unit: 'MINUTES') {
dir(path: 'selfdrive/test') {
sh 'pip install paramiko'
sh 'python phone_ci.py "SCONS_CACHE=1 scons -j3 cereal/ && \
nosetests -s selfdrive/test/test_sounds.py && \
nosetests -s selfdrive/boardd/tests/test_boardd_loopback.py"'
}
}
post {
always {
cleanWs()
}
}
}
}
+37 -26
View File
@@ -66,35 +66,34 @@ Supported Cars
| ----------| ------------------------------| ------------------| -----------------| -------------------| ------------------|
| Acura | ILX 2016-18 | AcuraWatch Plus | openpilot | 25mph<sup>1</sup> | 25mph |
| Acura | RDX 2016-18 | AcuraWatch Plus | openpilot | 25mph<sup>1</sup> | 12mph |
| Honda | Accord 2018-19 | All | Stock | 0mph | 3mph |
| Honda | Accord 2018-20 | All | Stock | 0mph | 3mph |
| Honda | Accord Hybrid 2018-20 | All | Stock | 0mph | 3mph |
| Honda | Civic Hatchback 2017-19 | Honda Sensing | Stock | 0mph | 12mph |
| Honda | Civic Sedan/Coupe 2016-18 | Honda Sensing | openpilot | 0mph | 12mph |
| Honda | Civic Sedan/Coupe 2019-20 | Honda Sensing | Stock | 0mph | 2mph<sup>2</sup> |
| Honda | Civic Sedan/Coupe 2019-20 | All | Stock | 0mph | 2mph<sup>2</sup> |
| Honda | CR-V 2015-16 | Touring | openpilot | 25mph<sup>1</sup> | 12mph |
| Honda | CR-V 2017-20 | Honda Sensing | Stock | 0mph | 12mph |
| Honda | CR-V Hybrid 2017-2019 | Honda Sensing | Stock | 0mph | 12mph |
| Honda | Fit 2018-19 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
| Honda | HR-V 2019 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
| Honda | Insight 2019 | Honda Sensing | Stock | 0mph | 3mph |
| Honda | Insight 2019-20 | All | Stock | 0mph | 3mph |
| Honda | Odyssey 2018-20 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 0mph |
| Honda | Passport 2019 | All | openpilot | 25mph<sup>1</sup> | 12mph |
| Honda | Pilot 2016-18 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
| Honda | Pilot 2019 | All | openpilot | 25mph<sup>1</sup> | 12mph |
| Honda | Pilot 2016-19 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
| Honda | Ridgeline 2017-20 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
| Hyundai | Palisade 2020 | All | Stock | 0mph | 0mph |
| Hyundai | Sonata 2020 | All | Stock | 0mph | 0mph |
| Lexus | CT Hybrid 2017-18 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Lexus | CT Hybrid 2017-18 | LSS | Stock<sup>3</sup>| 0mph | 0mph |
| Lexus | ES 2019 | All | openpilot | 0mph | 0mph |
| Lexus | ES Hybrid 2019 | All | openpilot | 0mph | 0mph |
| Lexus | IS 2017-2019 | All | Stock | 22mph | 0mph |
| Lexus | IS Hybrid 2017 | All | Stock | 0mph | 0mph |
| Lexus | NX Hybrid 2018 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Lexus | RX 2016-17 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Lexus | RX 2016-18 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Lexus | RX 2020 | All | openpilot | 0mph | 0mph |
| Lexus | RX Hybrid 2016-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Lexus | RX Hybrid 2020 | All | openpilot | 0mph | 0mph |
| Toyota | Avalon 2016 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
| Toyota | Avalon 2017-18 | All | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
| Toyota | Avalon 2016-18 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
| Toyota | Camry 2018-20 | All | Stock | 0mph<sup>4</sup> | 0mph |
| Toyota | Camry Hybrid 2018-19 | All | Stock | 0mph<sup>4</sup> | 0mph |
| Toyota | C-HR 2017-19 | All | Stock | 0mph | 0mph |
@@ -102,19 +101,16 @@ Supported Cars
| Toyota | Corolla 2017-19 | All | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
| Toyota | Corolla 2020 | All | openpilot | 0mph | 0mph |
| Toyota | Corolla Hatchback 2019-20 | All | openpilot | 0mph | 0mph |
| Toyota | Corolla Hybrid 2020 | All | openpilot | 0mph | 0mph |
| Toyota | Corolla Hybrid 2020-21 | All | openpilot | 0mph | 0mph |
| Toyota | Highlander 2017-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Toyota | Highlander Hybrid 2017-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Toyota | Highlander 2020 | All | openpilot | 0mph | 0mph |
| Toyota | Highlander Hybrid 2017-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Toyota | Highlander Hybrid 2020 | All | openpilot | 0mph | 0mph |
| Toyota | Prius 2016 | TSS-P | Stock<sup>3</sup>| 0mph | 0mph |
| Toyota | Prius 2017-20 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Toyota | Prius 2016-20 | TSS-P | Stock<sup>3</sup>| 0mph | 0mph |
| Toyota | Prius Prime 2017-20 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Toyota | Rav4 2016 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
| Toyota | Rav4 2017-18 | All | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
| Toyota | Rav4 2016-18 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
| Toyota | Rav4 2019-20 | All | openpilot | 0mph | 0mph |
| Toyota | Rav4 Hybrid 2016 | TSS-P | Stock<sup>3</sup>| 0mph | 0mph |
| Toyota | Rav4 Hybrid 2017-18 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Toyota | Rav4 Hybrid 2016-18 | TSS-P | Stock<sup>3</sup>| 0mph | 0mph |
| Toyota | Rav4 Hybrid 2019-20 | All | openpilot | 0mph | 0mph |
| Toyota | Sienna 2018-20 | All | Stock<sup>3</sup>| 0mph | 0mph |
@@ -136,29 +132,29 @@ Community Maintained Cars and Features
| Chrysler | Pacifica 2020 | Adaptive Cruise | Stock | 0mph | 39mph |
| Chrysler | Pacifica Hybrid 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph |
| Chrysler | Pacifica Hybrid 2019-20 | Adaptive Cruise | Stock | 0mph | 39mph |
| Genesis | G70 2018 | All | Stock | 0mph | 0mph |
| Genesis | G80 2018 | All | Stock | 0mph | 0mph |
| Genesis | G90 2018 | All | Stock | 0mph | 0mph |
| GMC | Acadia Denali 2018<sup>2</sup>| Adaptive Cruise | openpilot | 0mph | 7mph |
| Holden | Astra 2017<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
| Hyundai | Elantra 2017-19 | SCC + LKAS | Stock | 19mph | 34mph |
| Hyundai | Genesis 2015-16 | SCC + LKAS | Stock | 19mph | 37mph |
| Hyundai | Ioniq Electric Premium SE 2020| SCC + LKAS | Stock | 0mph | 32mph |
| Hyundai | Ioniq Electric Limited 2019 | SCC + LKAS | Stock | 0mph | 32mph |
| Hyundai | Kona 2017-19 | SCC + LKAS | Stock | 22mph | 0mph |
| Hyundai | Ioniq Electric 2019-20 | SCC + LKAS | Stock | 0mph | 32mph |
| Hyundai | Kona 2020 | SCC + LKAS | Stock | 0mph | 0mph |
| Hyundai | Kona EV 2019 | SCC + LKAS | Stock | 0mph | 0mph |
| Hyundai | Palisade 2020 | All | Stock | 0mph | 0mph |
| Hyundai | Santa Fe 2019 | All | Stock | 0mph | 0mph |
| Hyundai | Sonata 2019 | All | Stock | 0mph | 0mph |
| Hyundai | Veloster 2019 | SCC + LKAS | Stock | 5mph | 0mph |
| Jeep | Grand Cherokee 2016-18 | Adaptive Cruise | Stock | 0mph | 9mph |
| Jeep | Grand Cherokee 2019-20 | Adaptive Cruise | Stock | 0mph | 39mph |
| Kia | Forte 2018-19 | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Optima 2017 | SCC + LKAS/LDWS | Stock | 0mph | 32mph |
| Kia | Optima 2017 | SCC + LKAS | Stock | 0mph | 32mph |
| Kia | Optima 2019 | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Sorento 2018 | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Stinger 2018 | SCC + LKAS | Stock | 0mph | 0mph |
| Nissan | Leaf 2018-19<sup>2</sup> | Propilot | Stock | 0mph | 0mph |
| Nissan | Rogue 2019<sup>2</sup> | Propilot | Stock | 0mph | 0mph |
| Nissan | X-Trail 2017<sup>2</sup> | Propilot | Stock | 0mph | 0mph |
| Nissan | Leaf 2018-19 | ProPILOT | Stock | 0mph | 0mph |
| Nissan | Rogue 2019 | ProPILOT | Stock | 0mph | 0mph |
| Nissan | X-Trail 2017 | ProPILOT | Stock | 0mph | 0mph |
| Subaru | Ascent 2019 | EyeSight | Stock | 0mph | 0mph |
| Subaru | Crosstrek 2018-19 | EyeSight | Stock | 0mph | 0mph |
| Subaru | Forester 2019 | EyeSight | Stock | 0mph | 0mph |
@@ -272,8 +268,23 @@ Safety and Testing
Testing on PC
------
For simplified development and experimentation, openpilot runs in the CARLA driving simulator, which allows you to develop openpilot without a car.
Steps:
1) Start the CARLA server on first terminal
```
bash -c "$(curl https://raw.githubusercontent.com/commaai/openpilot/master/tools/sim/start_carla.sh)"
```
2) Start openpilot on second terminal
```
bash -c "$(curl https://raw.githubusercontent.com/commaai/openpilot/master/tools/sim/start_openpilot_docker.sh)"
```
3) Press 1 to engage openpilot
See the full [README](tools/sim/README.md)
You should also take a look at the tools directory in master: lots of tools you can use to replay driving data, test, and develop openpilot from your PC.
Check out the tools directory in master: lots of tools you can use to replay driving data, test and develop openpilot from your pc.
Community and Contributing
------
+15
View File
@@ -1,3 +1,18 @@
Version 0.7.9 (2020-10-09)
========================
* Improved car battery power management
* Improved updater robustness
* Improved realtime performance
* Reduced UI and modeld lags
* Increased torque on 2020 Hyundai Sonata and Palisade
Version 0.7.8 (2020-08-19)
========================
* New driver monitoring model: improved face detection and better compatibility with sunglasses
* Download NEOS operating system updates in the background
* Improved updater reliability and responsiveness
* Hyundai Kona 2020, Veloster 2019, and Genesis G70 2018 support thanks to xps-genesis!
Version 0.7.7 (2020-07-20)
========================
* White panda is no longer supported, upgrade to comma two or black panda
+65 -12
View File
@@ -1,9 +1,13 @@
import Cython
import distutils
import os
import shutil
import subprocess
import sys
import platform
TICI = os.path.isfile('/TICI')
AddOption('--test',
action='store_true',
help='build test files')
@@ -12,10 +16,15 @@ AddOption('--asan',
action='store_true',
help='turn on ASAN')
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
# Rebuild cython extensions if python, distutils, or cython change
cython_dependencies = [Value(v) for v in (sys.version, distutils.__version__, Cython.__version__)]
Export('cython_dependencies')
real_arch = arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
if platform.system() == "Darwin":
arch = "Darwin"
if arch == "aarch64" and not os.path.isdir("/system"):
if arch == "aarch64" and TICI:
arch = "larch64"
webcam = bool(ARGUMENTS.get("use_webcam", 0))
@@ -38,7 +47,6 @@ if arch == "aarch64" or arch == "larch64":
libpath = [
"/usr/lib",
"/data/data/com.termux/files/usr/lib",
"/system/vendor/lib64",
"/system/comma/usr/lib",
"#phonelibs/nanovg",
@@ -56,11 +64,12 @@ if arch == "aarch64" or arch == "larch64":
else:
libpath += [
"#phonelibs/snpe/aarch64",
"#phonelibs/libyuv/lib"
"#phonelibs/libyuv/lib",
"/system/vendor/lib64"
]
cflags = ["-DQCOM", "-mcpu=cortex-a57"]
cxxflags = ["-DQCOM", "-mcpu=cortex-a57"]
rpath = ["/system/vendor/lib64"]
rpath = []
if QCOM_REPLAY:
cflags += ["-DQCOM_REPLAY"]
@@ -125,8 +134,11 @@ env = Environment(
"-O2",
"-Wunused",
"-Werror",
"-Wno-unknown-warning-option",
"-Wno-deprecated-register",
"-Wno-inconsistent-missing-override",
"-Wno-c99-designator",
"-Wno-reorder-init-list",
] + cflags + ccflags_asan,
CPPPATH=cpppath + [
@@ -137,7 +149,6 @@ env = Environment(
"#phonelibs/openmax/include",
"#phonelibs/json11",
"#phonelibs/curl/include",
#"#phonelibs/opencv/include", # use opencv4 instead
"#phonelibs/libgralloc/include",
"#phonelibs/android_frameworks_native/include",
"#phonelibs/android_hardware_libhardware/include",
@@ -150,6 +161,8 @@ env = Environment(
"#selfdrive/camerad/include",
"#selfdrive/loggerd/include",
"#selfdrive/modeld",
"#selfdrive/sensord",
"#selfdrive/ui",
"#cereal/messaging",
"#cereal",
"#opendbc/can",
@@ -170,6 +183,44 @@ env = Environment(
]
)
qt_env = None
if arch in ["x86_64", "Darwin", "larch64"]:
qt_env = env.Clone()
if arch == "Darwin":
qt_env['QTDIR'] = "/usr/local/opt/qt"
QT_BASE = "/usr/local/opt/qt/"
qt_dirs = [
QT_BASE + "include/",
QT_BASE + "include/QtWidgets",
QT_BASE + "include/QtGui",
QT_BASE + "include/QtCore",
QT_BASE + "include/QtDBus",
QT_BASE + "include/QtMultimedia",
]
qt_env["LINKFLAGS"] += ["-F" + QT_BASE + "lib"]
else:
qt_dirs = [
f"/usr/include/{real_arch}-linux-gnu/qt5",
f"/usr/include/{real_arch}-linux-gnu/qt5/QtWidgets",
f"/usr/include/{real_arch}-linux-gnu/qt5/QtGui",
f"/usr/include/{real_arch}-linux-gnu/qt5/QtCore",
f"/usr/include/{real_arch}-linux-gnu/qt5/QtDBus",
f"/usr/include/{real_arch}-linux-gnu/qt5/QtMultimedia",
f"/usr/include/{real_arch}-linux-gnu/qt5/QtGui/5.5.1/QtGui",
]
qt_env.Tool('qt')
qt_env['CPPPATH'] += qt_dirs
qt_flags = [
"-D_REENTRANT",
"-DQT_NO_DEBUG",
"-DQT_WIDGETS_LIB",
"-DQT_GUI_LIB",
"-DQT_CORE_LIB"
]
qt_env['CXXFLAGS'] += qt_flags
if os.environ.get('SCONS_CACHE'):
cache_dir = '/tmp/scons_cache'
@@ -208,7 +259,7 @@ def abspath(x):
# still needed for apks
zmq = 'zmq'
Export('env', 'arch', 'zmq', 'SHARED', 'webcam', 'QCOM_REPLAY')
Export('env', 'qt_env', 'arch', 'zmq', 'SHARED', 'webcam', 'QCOM_REPLAY')
# cereal and messaging are shared with the system
SConscript(['cereal/SConscript'])
@@ -249,16 +300,18 @@ SConscript(['selfdrive/controls/lib/longitudinal_mpc_model/SConscript'])
SConscript(['selfdrive/boardd/SConscript'])
SConscript(['selfdrive/proclogd/SConscript'])
SConscript(['selfdrive/clocksd/SConscript'])
SConscript(['selfdrive/ui/SConscript'])
SConscript(['selfdrive/loggerd/SConscript'])
SConscript(['selfdrive/locationd/SConscript'])
SConscript(['selfdrive/locationd/models/SConscript'])
SConscript(['selfdrive/sensord/SConscript'])
SConscript(['selfdrive/ui/SConscript'])
if arch == "aarch64":
if arch != "Darwin":
SConscript(['selfdrive/logcatd/SConscript'])
SConscript(['selfdrive/sensord/SConscript'])
SConscript(['selfdrive/clocksd/SConscript'])
else:
if arch == "x86_64":
SConscript(['tools/lib/index_log/SConscript'])
Binary file not shown.
+19 -20
View File
@@ -1,35 +1,34 @@
Import('env', 'arch', 'zmq')
Import('env', 'arch', 'zmq', 'cython_dependencies')
import shutil
gen_dir = Dir('gen')
messaging_dir = Dir('messaging')
# TODO: remove src-prefix and cereal from command string. can we set working directory?
env.Command(["gen/c/include/c++.capnp.h", "gen/c/include/java.capnp.h"], [], "mkdir -p " + gen_dir.path + "/c/include && touch $TARGETS")
env.Command(
['gen/cpp/car.capnp.c++', 'gen/cpp/log.capnp.c++', 'gen/cpp/car.capnp.h', 'gen/cpp/log.capnp.h'],
['car.capnp', 'log.capnp'],
'capnpc $SOURCES --src-prefix=cereal -o c++:' + gen_dir.path + '/cpp/')
import shutil
env.Command(['gen/cpp/car.capnp.c++', 'gen/cpp/log.capnp.c++', 'gen/cpp/car.capnp.h', 'gen/cpp/log.capnp.h'],
['car.capnp', 'log.capnp'],
'capnpc $SOURCES --src-prefix=cereal -o c++:' + gen_dir.path + '/cpp/')
if shutil.which('capnpc-java'):
env.Command(
['gen/java/Car.java', 'gen/java/Log.java'],
['car.capnp', 'log.capnp'],
'capnpc $SOURCES --src-prefix=cereal -o java:' + gen_dir.path + '/java/')
env.Command(['gen/java/Car.java', 'gen/java/Log.java'],
['car.capnp', 'log.capnp'],
'capnpc $SOURCES --src-prefix=cereal -o java:' + gen_dir.path + '/java/')
# TODO: remove non shared cereal and messaging
cereal_objects = env.SharedObject([
'gen/cpp/car.capnp.c++',
'gen/cpp/log.capnp.c++',
])
'gen/cpp/car.capnp.c++',
'gen/cpp/log.capnp.c++',
])
env.Library('cereal', cereal_objects)
env.SharedLibrary('cereal_shared', cereal_objects)
cereal_dir = Dir('.')
services_h = env.Command(
['services.h'],
['service_list.yaml', 'services.py'],
'python3 ' + cereal_dir.path + '/services.py > $TARGET')
services_h = env.Command(['services.h'],
['service_list.yaml', 'services.py'],
'python3 ' + cereal_dir.path + '/services.py > $TARGET')
messaging_objects = env.SharedObject([
'messaging/messaging.cc',
@@ -56,9 +55,9 @@ Depends('messaging/bridge.cc', services_h)
#env.Program('messaging/demo', ['messaging/demo.cc'], LIBS=[messaging_lib, 'zmq'])
env.Command(['messaging/messaging_pyx.so'],
[messaging_lib, 'messaging/messaging_pyx_setup.py', 'messaging/messaging_pyx.pyx', 'messaging/messaging.pxd'],
"cd " + messaging_dir.path + " && python3 messaging_pyx_setup.py build_ext --inplace")
env.Command(['messaging/messaging_pyx.so', 'messaging/messaging_pyx.cpp'],
cython_dependencies + [messaging_lib, 'messaging/messaging_pyx_setup.py', 'messaging/messaging_pyx.pyx', 'messaging/messaging.pxd'],
"cd " + messaging_dir.path + " && python3 messaging_pyx_setup.py build_ext --inplace")
if GetOption('test'):
+13 -10
View File
@@ -38,7 +38,6 @@ struct CarEvent @0x9b1657f34caf3ad3 {
pedalPressed @13;
cruiseDisabled @14;
radarCanError @15;
dataNeededDEPRECATED @16;
speedTooLow @17;
outOfSpace @18;
overheat @19;
@@ -49,29 +48,22 @@ struct CarEvent @0x9b1657f34caf3ad3 {
pcmDisable @24;
noTarget @25;
radarFault @26;
modelCommIssueDEPRECATED @27;
brakeHold @28;
parkBrake @29;
manualRestart @30;
lowSpeedLockout @31;
plannerError @32;
ipasOverrideDEPRECATED @33;
debugAlert @34;
steerTempUnavailableMute @35;
resumeRequired @36;
preDriverDistracted @37;
promptDriverDistracted @38;
driverDistracted @39;
geofenceDEPRECATED @40;
driverMonitorOnDEPRECATED @41;
driverMonitorOffDEPRECATED @42;
preDriverUnresponsive @43;
promptDriverUnresponsive @44;
driverUnresponsive @45;
belowSteerSpeed @46;
calibrationProgressDEPRECATED @47;
lowBattery @48;
invalidGiraffeHondaDEPRECATED @49;
vehicleModelInvalid @50;
controlsFailed @51;
sensorDataInvalid @52;
@@ -104,14 +96,24 @@ struct CarEvent @0x9b1657f34caf3ad3 {
fcw @79;
steerSaturated @80;
whitePandaUnsupported @81;
startupWhitePanda @82;
canErrorPersistentDEPRECATED @83;
belowEngageSpeed @84;
noGps @85;
focusRecoverActive @86;
wrongCruiseMode @87;
neosUpdateRequired @88;
modeldLagging @89;
deviceFalling @90;
dataNeededDEPRECATED @16;
modelCommIssueDEPRECATED @27;
ipasOverrideDEPRECATED @33;
geofenceDEPRECATED @40;
driverMonitorOnDEPRECATED @41;
driverMonitorOffDEPRECATED @42;
calibrationProgressDEPRECATED @47;
invalidGiraffeHondaDEPRECATED @49;
canErrorPersistentDEPRECATED @83;
startupWhitePandaDEPRECATED @82;
}
}
@@ -474,6 +476,7 @@ struct CarParams {
volkswagenPq @21;
subaruLegacy @22; # pre-Global platform
hyundaiLegacy @23;
hyundaiCommunity @24;
}
enum SteerControlType {
+77 -10
View File
@@ -186,6 +186,7 @@ struct SensorEventData {
gyroUncalibrated @12 :SensorVec;
proximity @13: Float32;
light @14: Float32;
temperature @15: Float32;
}
source @8 :SensorSource;
@@ -203,6 +204,8 @@ struct SensorEventData {
lsm6ds3 @5; # accelerometer (c2)
bmp280 @6; # barometer (c2)
mmc3416x @7; # magnetometer (c2)
bmx055 @8;
rpr0521 @9;
}
}
@@ -267,14 +270,15 @@ struct CanData {
}
struct ThermalData {
cpu0 @0 :UInt16;
cpu1 @1 :UInt16;
cpu2 @2 :UInt16;
cpu3 @3 :UInt16;
mem @4 :UInt16;
gpu @5 :UInt16;
bat @6 :UInt32;
pa0 @21 :UInt16;
# Deprecated
cpu0DEPRECATED @0 :UInt16;
cpu1DEPRECATED @1 :UInt16;
cpu2DEPRECATED @2 :UInt16;
cpu3DEPRECATED @3 :UInt16;
memDEPRECATED @4 :UInt16;
gpuDEPRECATED @5 :UInt16;
batDEPRECATED @6 :UInt32;
pa0DEPRECATED @21 :UInt16;
# not thermal
freeSpace @7 :Float32;
@@ -286,6 +290,7 @@ struct ThermalData {
networkType @22 :NetworkType;
offroadPowerUsage @23 :UInt32; # Power usage since going offroad in uWh
networkStrength @24 :NetworkStrength;
carBatteryCapacity @25 :UInt32; # Estimated remaining car battery capacity in uWh
fanSpeed @10 :UInt16;
started @11 :Bool;
@@ -298,6 +303,12 @@ struct ThermalData {
memUsedPercent @19 :Int8;
cpuPerc @20 :Int8;
cpu @26 :List(Float32);
gpu @27 :List(Float32);
mem @28 :Float32;
bat @29 :Float32;
ambient @30 :Float32;
enum ThermalStatus {
green @0; # all processes run
yellow @1; # critical processes run (kill uploader), engage still allowed
@@ -373,6 +384,8 @@ struct HealthData {
interruptRateTim3 @17;
registerDivergent @18;
interruptRateKlineInit @19;
interruptRateClockSource @20;
interruptRateTim9 @21;
# Update max fault type in boardd when adding faults
}
@@ -441,18 +454,22 @@ struct RadarState @0x9a185389d6fdd05f {
struct LiveCalibrationData {
# deprecated
warpMatrix @0 :List(Float32);
# camera_frame_from_model_frame
warpMatrix2 @5 :List(Float32);
warpMatrixBig @6 :List(Float32);
calStatus @1 :Int8;
calCycle @2 :Int32;
calPerc @3 :Int8;
validBlocks @9 :Int32;
# view_frame_from_road_frame
# ui's is inversed needs new
extrinsicMatrix @4 :List(Float32);
# the direction of travel vector in device frame
rpyCalib @7 :List(Float32);
rpyCalibSpread @8 :List(Float32);
}
struct LiveTracks {
@@ -598,7 +615,7 @@ struct ControlsState @0x97ff69c53601abf1 {
output @3 :Float32;
lqrOutput @4 :Float32;
saturated @5 :Bool;
}
}
}
struct LiveEventData {
@@ -671,6 +688,52 @@ struct ModelData {
}
}
struct ModelDataV2 {
frameId @0 :UInt32;
frameAge @1 :UInt32;
frameDropPerc @2 :Float32;
timestampEof @3 :UInt64;
position @4 :XYZTData;
orientation @5 :XYZTData;
velocity @6 :XYZTData;
orientationRate @7 :XYZTData;
laneLines @8 :List(XYZTData);
laneLineProbs @9 :List(Float32);
roadEdges @10 :List(XYZTData);
leads @11 :List(LeadDataV2);
meta @12 :MetaData;
struct XYZTData {
x @0 :List(Float32);
y @1 :List(Float32);
z @2 :List(Float32);
t @3 :List(Float32);
xStd @4 :List(Float32);
yStd @5 :List(Float32);
zStd @6 :List(Float32);
}
struct LeadDataV2 {
prob @0 :Float32;
t @1 :Float32;
xyva @2 :List(Float32);
xyvaStd @3 :List(Float32);
}
struct MetaData {
engagedProb @0 :Float32;
desirePrediction @1 :List(Float32);
brakeDisengageProb @2 :Float32;
gasDisengageProb @3 :Float32;
steerOverrideProb @4 :Float32;
desireState @5 :List(Float32);
}
}
struct CalibrationFeatures {
frameId @0 :UInt32;
@@ -864,6 +927,7 @@ struct LiveLocationKalman {
posenetOK @18 :Bool = true;
gpsOK @19 :Bool = true;
sensorsOK @21 :Bool = true;
deviceStable @22 :Bool = true;
enum Status {
uninitialized @0;
@@ -1901,7 +1965,6 @@ struct DMonitoringState {
isDistracted @2 :Bool;
awarenessStatus @3 :Float32;
isRHD @4 :Bool;
rhdChecked @5 :Bool;
posePitchOffset @6 :Float32;
posePitchValidCount @7 :UInt32;
poseYawOffset @8 :Float32;
@@ -1912,6 +1975,8 @@ struct DMonitoringState {
isLowStd @13 :Bool;
hiStdCount @14 :UInt32;
isPreview @15 :Bool;
rhdCheckedDEPRECATED @5 :Bool;
}
struct Boot {
@@ -2057,5 +2122,7 @@ struct Event {
dMonitoringState @71: DMonitoringState;
liveLocationKalman @72 :LiveLocationKalman;
sentinel @73 :Sentinel;
wideFrame @74: FrameData;
modelV2 @75 :ModelDataV2;
}
}
+37 -37
View File
@@ -3,6 +3,8 @@ from .messaging_pyx import Context, Poller, SubSocket, PubSocket # pylint: disa
from .messaging_pyx import MultiplePublishersError, MessagingError # pylint: disable=no-name-in-module, import-error
import capnp
from typing import Optional, List, Union
from cereal import log
from cereal.services import service_list
@@ -19,7 +21,7 @@ except ImportError:
context = Context()
def new_message(service=None, size=None):
def new_message(service: Optional[str] = None, size: Optional[int] = None) -> capnp.lib.capnp._DynamicStructBuilder:
dat = log.Event.new_message()
dat.logMonoTime = int(sec_since_boot() * 1e9)
dat.valid = True
@@ -30,15 +32,15 @@ def new_message(service=None, size=None):
dat.init(service, size)
return dat
def pub_sock(endpoint):
def pub_sock(endpoint: str) -> PubSocket:
sock = PubSocket()
sock.connect(context, endpoint)
return sock
def sub_sock(endpoint, poller=None, addr="127.0.0.1", conflate=False, timeout=None):
def sub_sock(endpoint: str, poller: Optional[Poller] = None, addr: str = "127.0.0.1",
conflate: bool = False, timeout: Optional[int] = None) -> SubSocket:
sock = SubSocket()
addr = addr.encode('utf8')
sock.connect(context, endpoint, addr, conflate)
sock.connect(context, endpoint, addr.encode('utf8'), conflate)
if timeout is not None:
sock.setTimeout(timeout)
@@ -48,9 +50,9 @@ def sub_sock(endpoint, poller=None, addr="127.0.0.1", conflate=False, timeout=No
return sock
def drain_sock_raw(sock, wait_for_one=False):
def drain_sock_raw(sock: SubSocket, wait_for_one: bool = False) -> List[bytes]:
"""Receive all message currently available on the queue"""
ret = []
ret: List[bytes] = []
while 1:
if wait_for_one and len(ret) == 0:
dat = sock.receive()
@@ -64,9 +66,9 @@ def drain_sock_raw(sock, wait_for_one=False):
return ret
def drain_sock(sock, wait_for_one=False):
def drain_sock(sock: SubSocket, wait_for_one: bool = False) -> List[capnp.lib.capnp._DynamicStructReader]:
"""Receive all message currently available on the queue"""
ret = []
ret: List[capnp.lib.capnp._DynamicStructReader] = []
while 1:
if wait_for_one and len(ret) == 0:
dat = sock.receive()
@@ -83,7 +85,7 @@ def drain_sock(sock, wait_for_one=False):
# TODO: print when we drop packets?
def recv_sock(sock, wait=False):
def recv_sock(sock: SubSocket, wait: bool = False) -> Union[None, capnp.lib.capnp._DynamicStructReader]:
"""Same as drain sock, but only returns latest message. Consider using conflate instead."""
dat = None
@@ -103,35 +105,28 @@ def recv_sock(sock, wait=False):
return dat
def recv_one(sock):
def recv_one(sock: SubSocket) -> Union[None, capnp.lib.capnp._DynamicStructReader]:
dat = sock.receive()
if dat is not None:
dat = log.Event.from_bytes(dat)
return dat
def recv_one_or_none(sock):
def recv_one_or_none(sock: SubSocket) -> Union[None, capnp.lib.capnp._DynamicStructReader]:
dat = sock.receive(non_blocking=True)
if dat is not None:
dat = log.Event.from_bytes(dat)
return dat
def recv_one_retry(sock):
def recv_one_retry(sock: SubSocket) -> capnp.lib.capnp._DynamicStructReader:
"""Keep receiving until we get a message"""
while True:
dat = sock.receive()
if dat is not None:
return log.Event.from_bytes(dat)
# TODO: This does not belong in messaging
def get_one_can(logcan):
while True:
can = recv_one_retry(logcan)
if len(can.can) > 0:
return can
class SubMaster():
def __init__(self, services, ignore_alive=None, addr="127.0.0.1"):
self.poller = Poller()
def __init__(self, services: List[str], poll: Optional[List[str]] = None,
ignore_alive: Optional[List[str]] = None, addr:str ="127.0.0.1"):
self.frame = -1
self.updated = {s: False for s in services}
self.rcv_time = {s: 0. for s in services}
@@ -140,8 +135,12 @@ class SubMaster():
self.sock = {}
self.freq = {}
self.data = {}
self.logMonoTime = {}
self.valid = {}
self.logMonoTime = {}
self.poller = Poller()
self.non_polled_services = [s for s in services if poll is not None and
len(poll) and s not in poll]
if ignore_alive is not None:
self.ignore_alive = ignore_alive
@@ -150,30 +149,33 @@ class SubMaster():
for s in services:
if addr is not None:
self.sock[s] = sub_sock(s, poller=self.poller, addr=addr, conflate=True)
p = self.poller if s not in self.non_polled_services else None
self.sock[s] = sub_sock(s, poller=p, addr=addr, conflate=True)
self.freq[s] = service_list[s].frequency
try:
data = new_message(s)
except capnp.lib.capnp.KjException: # pylint: disable=c-extension-no-member
# lists
data = new_message(s, 0)
data = new_message(s, 0) # lists
self.data[s] = getattr(data, s)
self.logMonoTime[s] = 0
self.valid[s] = data.valid
def __getitem__(self, s):
def __getitem__(self, s: str) -> capnp.lib.capnp._DynamicStructReader:
return self.data[s]
def update(self, timeout=1000):
def update(self, timeout: int = 1000) -> None:
msgs = []
for sock in self.poller.poll(timeout):
msgs.append(recv_one_or_none(sock))
# non-blocking receive for non-polled sockets
for s in self.non_polled_services:
msgs.append(recv_one_or_none(self.sock[s]))
self.update_msgs(sec_since_boot(), msgs)
def update_msgs(self, cur_time, msgs):
# TODO: add optional input that specify the service to wait for
def update_msgs(self, cur_time: float, msgs: List[capnp.lib.capnp._DynamicStructReader]) -> None:
self.frame += 1
self.updated = dict.fromkeys(self.updated, False)
for msg in msgs:
@@ -196,30 +198,28 @@ class SubMaster():
else:
self.alive[s] = True
def all_alive(self, service_list=None):
def all_alive(self, service_list=None) -> bool:
if service_list is None: # check all
service_list = self.alive.keys()
return all(self.alive[s] for s in service_list if s not in self.ignore_alive)
def all_valid(self, service_list=None):
def all_valid(self, service_list=None) -> bool:
if service_list is None: # check all
service_list = self.valid.keys()
return all(self.valid[s] for s in service_list)
def all_alive_and_valid(self, service_list=None):
def all_alive_and_valid(self, service_list=None) -> bool:
if service_list is None: # check all
service_list = self.alive.keys()
return self.all_alive(service_list=service_list) and self.all_valid(service_list=service_list)
class PubMaster():
def __init__(self, services):
def __init__(self, services: List[str]):
self.sock = {}
for s in services:
self.sock[s] = pub_sock(s)
def send(self, s, dat):
# accept either bytes or capnp builder
def send(self, s: str, dat: Union[bytes, capnp.lib.capnp._DynamicStructBuilder]) -> None:
if not isinstance(dat, bytes):
dat = dat.to_bytes()
self.sock[s].send(dat)
+14 -3
View File
@@ -15,6 +15,18 @@ void sig_handler(int signal) {
msgq_do_exit = 1;
}
static size_t get_size(std::string endpoint){
size_t sz = DEFAULT_SEGMENT_SIZE;
#if !defined(QCOM) && !defined(QCOM2)
if (endpoint == "frame" || endpoint == "frontFrame" || endpoint == "wideFrame"){
sz *= 10;
}
#endif
return sz;
}
MSGQContext::MSGQContext() {
}
@@ -49,13 +61,12 @@ MSGQMessage::~MSGQMessage() {
this->close();
}
int MSGQSubSocket::connect(Context *context, std::string endpoint, std::string address, bool conflate){
assert(context);
assert(address == "127.0.0.1");
q = new msgq_queue_t;
int r = msgq_new_queue(q, endpoint.c_str(), DEFAULT_SEGMENT_SIZE);
int r = msgq_new_queue(q, endpoint.c_str(), get_size(endpoint));
if (r != 0){
return r;
}
@@ -143,7 +154,7 @@ int MSGQPubSocket::connect(Context *context, std::string endpoint){
assert(context);
q = new msgq_queue_t;
int r = msgq_new_queue(q, endpoint.c_str(), DEFAULT_SEGMENT_SIZE);
int r = msgq_new_queue(q, endpoint.c_str(), get_size(endpoint));
if (r != 0){
return r;
}
+37 -8
View File
@@ -6,6 +6,10 @@
#include <capnp/serialize.h>
#include "../gen/cpp/log.capnp.h"
#ifdef __APPLE__
#define CLOCK_BOOTTIME CLOCK_MONOTONIC
#endif
#define MSG_MULTIPLE_PUBLISHERS 100
class Context {
@@ -59,34 +63,59 @@ public:
};
class SubMaster {
public:
public:
SubMaster(const std::initializer_list<const char *> &service_list,
const char *address = nullptr, const std::initializer_list<const char *> &ignore_alive = {});
int update(int timeout = 1000);
inline bool allAlive(const std::initializer_list<const char *> &service_list = {}) { return all_(service_list, false, true); }
inline bool allValid(const std::initializer_list<const char *> &service_list = {}) { return all_(service_list, true, false); }
inline bool allAliveAndValid(const std::initializer_list<const char *> &service_list = {}) { return all_(service_list, true, true); }
bool updated(const char *name) const;
void drain();
cereal::Event::Reader &operator[](const char *name);
~SubMaster();
private:
uint64_t frame = 0;
bool updated(const char *name) const;
uint64_t rcv_frame(const char *name) const;
cereal::Event::Reader &operator[](const char *name);
private:
bool all_(const std::initializer_list<const char *> &service_list, bool valid, bool alive);
Poller *poller_ = nullptr;
uint64_t frame_ = 0;
struct SubMessage;
std::map<SubSocket *, SubMessage *> messages_;
std::map<std::string, SubMessage *> services_;
};
class MessageBuilder : public capnp::MallocMessageBuilder {
public:
MessageBuilder() = default;
cereal::Event::Builder initEvent(bool valid = true) {
cereal::Event::Builder event = initRoot<cereal::Event>();
struct timespec t;
clock_gettime(CLOCK_BOOTTIME, &t);
uint64_t current_time = t.tv_sec * 1000000000ULL + t.tv_nsec;
event.setLogMonoTime(current_time);
event.setValid(valid);
return event;
}
kj::ArrayPtr<capnp::byte> toBytes() {
heapArray_ = capnp::messageToFlatArray(*this);
return heapArray_.asBytes();
}
private:
kj::Array<capnp::word> heapArray_;
};
class PubMaster {
public:
public:
PubMaster(const std::initializer_list<const char *> &service_list);
inline int send(const char *name, capnp::byte *data, size_t size) { return sockets_.at(name)->send((char *)data, size); }
int send(const char *name, capnp::MessageBuilder &msg);
int send(const char *name, MessageBuilder &msg);
~PubMaster();
private:
private:
std::map<std::string, PubSocket *> sockets_;
};
+6 -5
View File
@@ -6,6 +6,7 @@ from distutils.core import Extension, setup # pylint: disable=import-error,no-n
from Cython.Build import cythonize
from Cython.Distutils import build_ext
TICI = os.path.isfile('/TICI')
def get_ext_filename_without_platform_suffix(filename):
name, ext = os.path.splitext(filename)
@@ -30,16 +31,16 @@ class BuildExtWithoutPlatformSuffix(build_ext):
sourcefiles = ['messaging_pyx.pyx']
extra_compile_args = ["-std=c++14"]
extra_compile_args = ["-std=c++14", "-Wno-nullability-completeness"]
libraries = ['zmq']
ARCH = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() # pylint: disable=unexpected-keyword-arg
if ARCH == "aarch64" and os.path.isdir("/system"):
if ARCH == "aarch64" and not TICI:
# android
extra_compile_args += ["-Wno-deprecated-register"]
libraries += ['gnustl_shared']
setup(name='CAN parser',
setup(name='messaging',
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
ext_modules=cythonize(
Extension(
@@ -51,7 +52,7 @@ setup(name='CAN parser',
extra_objects=[
os.path.join(os.path.dirname(os.path.realpath(__file__)), '../', 'libmessaging.a'),
]
)
),
nthreads=4,
),
nthreads=4,
)
+17 -8
View File
@@ -21,6 +21,8 @@
#include <stdio.h>
#include "services.h"
#include "msgq.hpp"
void sigusr2_handler(int signal) {
@@ -81,11 +83,20 @@ void msgq_wait_for_subscriber(msgq_queue_t *q){
return;
}
bool service_exists(std::string path){
for (const auto& it : services) {
if (it.name == path) {
return true;
}
}
return false;
}
int msgq_new_queue(msgq_queue_t * q, const char * path, size_t size){
assert(size < 0xFFFFFFFF); // Buffer must be smaller than 2^32 bytes
if (!service_exists(std::string(path))){
std::cout << "Warning, " << std::string(path) << " is not in service list." << std::endl;
}
std::signal(SIGUSR2, sigusr2_handler);
const char * prefix = "/dev/shm/";
@@ -102,15 +113,15 @@ int msgq_new_queue(msgq_queue_t * q, const char * path, size_t size){
delete[] full_path;
int rc = ftruncate(fd, size + sizeof(msgq_header_t));
if (rc < 0)
if (rc < 0){
return -1;
}
char * mem = (char*)mmap(NULL, size + sizeof(msgq_header_t), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
close(fd);
if (mem == NULL)
if (mem == NULL){
return -1;
}
q->mmap_p = mem;
msgq_header_t *header = (msgq_header_t *)mem;
@@ -418,8 +429,6 @@ int msgq_msg_recv(msgq_msg_t * msg, msgq_queue_t * q){
int msgq_poll(msgq_pollitem_t * items, size_t nitems, int timeout){
assert(timeout >= 0);
int num = 0;
// Check if messages ready
+24 -16
View File
@@ -2,20 +2,20 @@
#include <time.h>
#include "messaging.hpp"
#include "services.h"
#ifdef __APPLE__
#define CLOCK_BOOTTIME CLOCK_MONOTONIC
#endif
static inline uint64_t nanos_since_boot() {
struct timespec t;
clock_gettime(CLOCK_BOOTTIME, &t);
return t.tv_sec * 1000000000ULL + t.tv_nsec;
}
static const service *get_service(const char *name) {
for (const auto &it : services) {
if (strcmp(it.name, name) == 0) return &it;
}
return nullptr;
}
static inline bool inList(const std::initializer_list<const char *> &list, const char *value) {
for (auto &v : list) {
if (strcmp(value, v) == 0) return true;
@@ -24,7 +24,7 @@ static inline bool inList(const std::initializer_list<const char *> &list, const
}
class MessageContext {
public:
public:
MessageContext() { ctx_ = Context::create(); }
~MessageContext() { delete ctx_; }
Context *ctx_;
@@ -53,18 +53,18 @@ SubMaster::SubMaster(const std::initializer_list<const char *> &service_list, co
assert(socket != 0);
poller_->registerSocket(socket);
SubMessage *m = new SubMessage{
.socket = socket,
.freq = serv->frequency,
.ignore_alive = inList(ignore_alive, name),
.allocated_msg_reader = malloc(sizeof(capnp::FlatArrayMessageReader)),
.buf = kj::heapArray<capnp::word>(1024)};
.socket = socket,
.freq = serv->frequency,
.ignore_alive = inList(ignore_alive, name),
.allocated_msg_reader = malloc(sizeof(capnp::FlatArrayMessageReader)),
.buf = kj::heapArray<capnp::word>(1024)};
messages_[socket] = m;
services_[name] = m;
}
}
int SubMaster::update(int timeout) {
if (++frame_ == UINT64_MAX) frame_ = 1;
if (++frame == UINT64_MAX) frame = 1;
for (auto &kv : messages_) kv.second->updated = false;
int updated = 0;
@@ -89,7 +89,7 @@ int SubMaster::update(int timeout) {
m->event = m->msg_reader->getRoot<cereal::Event>();
m->updated = true;
m->rcv_time = current_time;
m->rcv_frame = frame_;
m->rcv_frame = frame;
m->valid = m->event.getValid();
++updated;
@@ -126,8 +126,17 @@ void SubMaster::drain() {
}
}
bool SubMaster::updated(const char *name) const { return services_.at(name)->updated; }
cereal::Event::Reader &SubMaster::operator[](const char *name) { return services_.at(name)->event; };
bool SubMaster::updated(const char *name) const {
return services_.at(name)->updated;
}
uint64_t SubMaster::rcv_frame(const char *name) const {
return services_.at(name)->rcv_frame;
}
cereal::Event::Reader &SubMaster::operator[](const char *name) {
return services_.at(name)->event;
};
SubMaster::~SubMaster() {
delete poller_;
@@ -151,9 +160,8 @@ PubMaster::PubMaster(const std::initializer_list<const char *> &service_list) {
}
}
int PubMaster::send(const char *name, capnp::MessageBuilder &msg) {
auto words = capnp::messageToFlatArray(msg);
auto bytes = words.asBytes();
int PubMaster::send(const char *name, MessageBuilder &msg) {
auto bytes = msg.toBytes();
return send(name, bytes.begin(), bytes.size());
}
+4 -1
View File
@@ -63,7 +63,7 @@ orbOdometry: [8057, true, 0.]
orbFeatures: [8058, false, 0.]
orbKeyFrame: [8059, true, 0.]
uiLayoutState: [8060, true, 0.]
frontEncodeIdx: [8061, true, 5.]
frontEncodeIdx: [8061, true, 5.] # should be 20fps on tici
orbFeaturesSummary: [8062, true, 0.]
driverState: [8063, true, 5., 1]
liveParameters: [8064, true, 20., 2]
@@ -77,6 +77,9 @@ carParams: [8071, true, 0.02, 1]
frontFrame: [8072, true, 10.]
dMonitoringState: [8073, true, 5., 1]
offroadLayout: [8074, false, 0.]
wideEncodeIdx: [8075, true, 20.]
wideFrame: [8076, true, 20.]
modelV2: [8077, true, 20., 20]
testModel: [8040, false, 0.]
testLiveLocation: [8045, false, 0.]
+5 -5
View File
@@ -1,6 +1,6 @@
Import('env')
Import('env', 'cython_dependencies')
# parser
env.Command(['common_pyx.so'],
['common_pyx_setup.py', 'clock.pyx'],
"cd common && python3 common_pyx_setup.py build_ext --inplace")
# Build cython clock module
env.Command(['common_pyx.so', 'clock.cpp'],
cython_dependencies + ['common_pyx_setup.py', 'clock.pyx'],
"cd common && python3 common_pyx_setup.py build_ext --inplace")
-286
View File
@@ -1,286 +0,0 @@
import os
import binascii
import itertools
import re
import struct
import subprocess
import random
from cereal import log
NetworkType = log.ThermalData.NetworkType
NetworkStrength = log.ThermalData.NetworkStrength
ANDROID = os.path.isfile('/EON')
def get_sound_card_online():
return (os.path.isfile('/proc/asound/card0/state') and
open('/proc/asound/card0/state').read().strip() == 'ONLINE')
def getprop(key):
if not ANDROID:
return ""
return subprocess.check_output(["getprop", key], encoding='utf8').strip()
def get_imei(slot):
slot = str(slot)
if slot not in ("0", "1"):
raise ValueError("SIM slot must be 0 or 1")
ret = parse_service_call_string(service_call(["iphonesubinfo", "3" , "i32", str(slot)]))
if not ret:
# allow non android to be identified differently
ret = "%015d" % random.randint(0, 1 << 32)
return ret
def get_serial():
ret = getprop("ro.serialno")
if ret == "":
ret = "cccccccc"
return ret
def get_subscriber_info():
ret = parse_service_call_string(service_call(["iphonesubinfo", "7"]))
if ret is None or len(ret) < 8:
return ""
return ret
def reboot(reason=None):
if reason is None:
reason_args = ["null"]
else:
reason_args = ["s16", reason]
subprocess.check_output([
"service", "call", "power", "16", # IPowerManager.reboot
"i32", "0", # no confirmation,
*reason_args,
"i32", "1" # wait
])
def service_call(call):
if not ANDROID:
return None
ret = subprocess.check_output(["service", "call", *call], encoding='utf8').strip()
if 'Parcel' not in ret:
return None
return parse_service_call_bytes(ret)
def parse_service_call_unpack(r, fmt):
try:
return struct.unpack(fmt, r)[0]
except Exception:
return None
def parse_service_call_string(r):
try:
r = r[8:] # Cut off length field
r = r.decode('utf_16_be')
# All pairs of two characters seem to be swapped. Not sure why
result = ""
for a, b, in itertools.zip_longest(r[::2], r[1::2], fillvalue='\x00'):
result += b + a
result = result.replace('\x00', '')
return result
except Exception:
return None
def parse_service_call_bytes(ret):
try:
r = b""
for hex_part in re.findall(r'[ (]([0-9a-f]{8})', ret):
r += binascii.unhexlify(hex_part)
return r
except Exception:
return None
def get_network_type():
if not ANDROID:
return NetworkType.none
wifi_check = parse_service_call_string(service_call(["connectivity", "2"]))
if wifi_check is None:
return NetworkType.none
elif 'WIFI' in wifi_check:
return NetworkType.wifi
else:
cell_check = parse_service_call_unpack(service_call(['phone', '59']), ">q")
# from TelephonyManager.java
cell_networks = {
0: NetworkType.none,
1: NetworkType.cell2G,
2: NetworkType.cell2G,
3: NetworkType.cell3G,
4: NetworkType.cell2G,
5: NetworkType.cell3G,
6: NetworkType.cell3G,
7: NetworkType.cell3G,
8: NetworkType.cell3G,
9: NetworkType.cell3G,
10: NetworkType.cell3G,
11: NetworkType.cell2G,
12: NetworkType.cell3G,
13: NetworkType.cell4G,
14: NetworkType.cell4G,
15: NetworkType.cell3G,
16: NetworkType.cell2G,
17: NetworkType.cell3G,
18: NetworkType.cell4G,
19: NetworkType.cell4G
}
return cell_networks.get(cell_check, NetworkType.none)
def get_network_strength(network_type):
network_strength = NetworkStrength.unknown
# from SignalStrength.java
def get_lte_level(rsrp, rssnr):
INT_MAX = 2147483647
if rsrp == INT_MAX:
lvl_rsrp = NetworkStrength.unknown
elif rsrp >= -95:
lvl_rsrp = NetworkStrength.great
elif rsrp >= -105:
lvl_rsrp = NetworkStrength.good
elif rsrp >= -115:
lvl_rsrp = NetworkStrength.moderate
else:
lvl_rsrp = NetworkStrength.poor
if rssnr == INT_MAX:
lvl_rssnr = NetworkStrength.unknown
elif rssnr >= 45:
lvl_rssnr = NetworkStrength.great
elif rssnr >= 10:
lvl_rssnr = NetworkStrength.good
elif rssnr >= -30:
lvl_rssnr = NetworkStrength.moderate
else:
lvl_rssnr = NetworkStrength.poor
return max(lvl_rsrp, lvl_rssnr)
def get_tdscdma_level(tdscmadbm):
lvl = NetworkStrength.unknown
if tdscmadbm > -25:
lvl = NetworkStrength.unknown
elif tdscmadbm >= -49:
lvl = NetworkStrength.great
elif tdscmadbm >= -73:
lvl = NetworkStrength.good
elif tdscmadbm >= -97:
lvl = NetworkStrength.moderate
elif tdscmadbm >= -110:
lvl = NetworkStrength.poor
return lvl
def get_gsm_level(asu):
if asu <= 2 or asu == 99:
lvl = NetworkStrength.unknown
elif asu >= 12:
lvl = NetworkStrength.great
elif asu >= 8:
lvl = NetworkStrength.good
elif asu >= 5:
lvl = NetworkStrength.moderate
else:
lvl = NetworkStrength.poor
return lvl
def get_evdo_level(evdodbm, evdosnr):
lvl_evdodbm = NetworkStrength.unknown
lvl_evdosnr = NetworkStrength.unknown
if evdodbm >= -65:
lvl_evdodbm = NetworkStrength.great
elif evdodbm >= -75:
lvl_evdodbm = NetworkStrength.good
elif evdodbm >= -90:
lvl_evdodbm = NetworkStrength.moderate
elif evdodbm >= -105:
lvl_evdodbm = NetworkStrength.poor
if evdosnr >= 7:
lvl_evdosnr = NetworkStrength.great
elif evdosnr >= 5:
lvl_evdosnr = NetworkStrength.good
elif evdosnr >= 3:
lvl_evdosnr = NetworkStrength.moderate
elif evdosnr >= 1:
lvl_evdosnr = NetworkStrength.poor
return max(lvl_evdodbm, lvl_evdosnr)
def get_cdma_level(cdmadbm, cdmaecio):
lvl_cdmadbm = NetworkStrength.unknown
lvl_cdmaecio = NetworkStrength.unknown
if cdmadbm >= -75:
lvl_cdmadbm = NetworkStrength.great
elif cdmadbm >= -85:
lvl_cdmadbm = NetworkStrength.good
elif cdmadbm >= -95:
lvl_cdmadbm = NetworkStrength.moderate
elif cdmadbm >= -100:
lvl_cdmadbm = NetworkStrength.poor
if cdmaecio >= -90:
lvl_cdmaecio = NetworkStrength.great
elif cdmaecio >= -110:
lvl_cdmaecio = NetworkStrength.good
elif cdmaecio >= -130:
lvl_cdmaecio = NetworkStrength.moderate
elif cdmaecio >= -150:
lvl_cdmaecio = NetworkStrength.poor
return max(lvl_cdmadbm, lvl_cdmaecio)
if network_type == NetworkType.none:
return network_strength
if network_type == NetworkType.wifi:
out = subprocess.check_output('dumpsys connectivity', shell=True).decode('utf-8')
network_strength = NetworkStrength.unknown
for line in out.split('\n'):
signal_str = "SignalStrength: "
if signal_str in line:
lvl_idx_start = line.find(signal_str) + len(signal_str)
lvl_idx_end = line.find(']', lvl_idx_start)
lvl = int(line[lvl_idx_start : lvl_idx_end])
if lvl >= -50:
network_strength = NetworkStrength.great
elif lvl >= -60:
network_strength = NetworkStrength.good
elif lvl >= -70:
network_strength = NetworkStrength.moderate
else:
network_strength = NetworkStrength.poor
return network_strength
else:
# check cell strength
out = subprocess.check_output('dumpsys telephony.registry', shell=True).decode('utf-8')
for line in out.split('\n'):
if "mSignalStrength" in line:
arr = line.split(' ')
ns = 0
if ("gsm" in arr[14]):
rsrp = int(arr[9])
rssnr = int(arr[11])
ns = get_lte_level(rsrp, rssnr)
if ns == NetworkStrength.unknown:
tdscmadbm = int(arr[13])
ns = get_tdscdma_level(tdscmadbm)
if ns == NetworkStrength.unknown:
asu = int(arr[1])
ns = get_gsm_level(asu)
else:
cdmadbm = int(arr[3])
cdmaecio = int(arr[4])
evdodbm = int(arr[5])
evdosnr = int(arr[7])
lvl_cdma = get_cdma_level(cdmadbm, cdmaecio)
lvl_edmo = get_evdo_level(evdodbm, evdosnr)
if lvl_edmo == NetworkStrength.unknown:
ns = lvl_cdma
elif lvl_cdma == NetworkStrength.unknown:
ns = lvl_edmo
else:
ns = min(lvl_cdma, lvl_edmo)
network_strength = max(network_strength, ns)
return network_strength
+5 -5
View File
@@ -1,10 +1,10 @@
import os
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../"))
from common.android import ANDROID
if ANDROID:
PERSIST = "/persist"
PARAMS = "/data/params"
else:
from common.hardware import PC
if PC:
PERSIST = os.path.join(BASEDIR, "persist")
PARAMS = os.path.join(BASEDIR, "persist", "params")
else:
PERSIST = "/persist"
PARAMS = "/data/params"
+22
View File
@@ -0,0 +1,22 @@
GPIO_HUB_RST_N = 30
GPIO_UBLOX_RST_N = 32
GPIO_UBLOX_SAFEBOOT_N = 33
GPIO_UBLOX_PWR_EN = 34
GPIO_STM_RST_N = 124
GPIO_STM_BOOT0 = 134
def gpio_init(pin, output):
try:
with open(f"/sys/class/gpio/gpio{pin}/direction", 'wb') as f:
f.write(b"out" if output else b"in")
except Exception as e:
print(f"Failed to set gpio {pin} direction: {e}")
def gpio_set(pin, high):
try:
with open(f"/sys/class/gpio/gpio{pin}/value", 'wb') as f:
f.write(b"1" if high else b"0")
except Exception as e:
print(f"Failed to set gpio {pin} value: {e}")
+57
View File
@@ -0,0 +1,57 @@
import os
import random
from typing import cast
from cereal import log
from common.hardware_android import Android
from common.hardware_tici import Tici
from common.hardware_base import HardwareBase
EON = os.path.isfile('/EON')
TICI = os.path.isfile('/TICI')
PC = not (EON or TICI)
ANDROID = EON
NetworkType = log.ThermalData.NetworkType
NetworkStrength = log.ThermalData.NetworkStrength
class Pc(HardwareBase):
def get_sound_card_online(self):
return True
def get_imei(self, slot):
return "%015d" % random.randint(0, 1 << 32)
def get_serial(self):
return "cccccccc"
def get_subscriber_info(self):
return ""
def reboot(self, reason=None):
print("REBOOT!")
def get_network_type(self):
return NetworkType.wifi
def get_sim_info(self):
return {
'sim_id': '',
'mcc_mnc': None,
'network_type': ["Unknown"],
'sim_state': ["ABSENT"],
'data_connected': False
}
def get_network_strength(self, network_type):
return NetworkStrength.unknown
if EON:
HARDWARE = cast(HardwareBase, Android())
elif TICI:
HARDWARE = cast(HardwareBase, Tici())
else:
HARDWARE = cast(HardwareBase, Pc())
+302
View File
@@ -0,0 +1,302 @@
import binascii
import itertools
import os
import re
import struct
import subprocess
from cereal import log
from common.hardware_base import HardwareBase
NetworkType = log.ThermalData.NetworkType
NetworkStrength = log.ThermalData.NetworkStrength
def service_call(call):
try:
ret = subprocess.check_output(["service", "call", *call], encoding='utf8').strip()
if 'Parcel' not in ret:
return None
return parse_service_call_bytes(ret)
except subprocess.CalledProcessError:
return None
def parse_service_call_unpack(r, fmt):
try:
return struct.unpack(fmt, r)[0]
except Exception:
return None
def parse_service_call_string(r):
try:
r = r[8:] # Cut off length field
r = r.decode('utf_16_be')
# All pairs of two characters seem to be swapped. Not sure why
result = ""
for a, b, in itertools.zip_longest(r[::2], r[1::2], fillvalue='\x00'):
result += b + a
result = result.replace('\x00', '')
return result
except Exception:
return None
def parse_service_call_bytes(ret):
try:
r = b""
for hex_part in re.findall(r'[ (]([0-9a-f]{8})', ret):
r += binascii.unhexlify(hex_part)
return r
except Exception:
return None
def getprop(key):
return subprocess.check_output(["getprop", key], encoding='utf8').strip()
class Android(HardwareBase):
def get_sound_card_online(self):
return (os.path.isfile('/proc/asound/card0/state') and
open('/proc/asound/card0/state').read().strip() == 'ONLINE')
def get_imei(self, slot):
slot = str(slot)
if slot not in ("0", "1"):
raise ValueError("SIM slot must be 0 or 1")
return parse_service_call_string(service_call(["iphonesubinfo", "3", "i32", str(slot)]))
def get_serial(self):
ret = getprop("ro.serialno")
if ret == "":
ret = "cccccccc"
return ret
def get_subscriber_info(self):
ret = parse_service_call_string(service_call(["iphonesubinfo", "7"]))
if ret is None or len(ret) < 8:
return ""
return ret
def reboot(self, reason=None):
# e.g. reason="recovery" to go into recover mode
if reason is None:
reason_args = ["null"]
else:
reason_args = ["s16", reason]
subprocess.check_output([
"service", "call", "power", "16", # IPowerManager.reboot
"i32", "0", # no confirmation,
*reason_args,
"i32", "1" # wait
])
def get_sim_info(self):
# Used for athena
# TODO: build using methods from this class
sim_state = getprop("gsm.sim.state").split(",")
network_type = getprop("gsm.network.type").split(',')
mcc_mnc = getprop("gsm.sim.operator.numeric") or None
sim_id = parse_service_call_string(service_call(['iphonesubinfo', '11']))
cell_data_state = parse_service_call_unpack(service_call(['phone', '46']), ">q")
cell_data_connected = (cell_data_state == 2)
return {
'sim_id': sim_id,
'mcc_mnc': mcc_mnc,
'network_type': network_type,
'sim_state': sim_state,
'data_connected': cell_data_connected
}
def get_network_type(self):
wifi_check = parse_service_call_string(service_call(["connectivity", "2"]))
if wifi_check is None:
return NetworkType.none
elif 'WIFI' in wifi_check:
return NetworkType.wifi
else:
cell_check = parse_service_call_unpack(service_call(['phone', '59']), ">q")
# from TelephonyManager.java
cell_networks = {
0: NetworkType.none,
1: NetworkType.cell2G,
2: NetworkType.cell2G,
3: NetworkType.cell3G,
4: NetworkType.cell2G,
5: NetworkType.cell3G,
6: NetworkType.cell3G,
7: NetworkType.cell3G,
8: NetworkType.cell3G,
9: NetworkType.cell3G,
10: NetworkType.cell3G,
11: NetworkType.cell2G,
12: NetworkType.cell3G,
13: NetworkType.cell4G,
14: NetworkType.cell4G,
15: NetworkType.cell3G,
16: NetworkType.cell2G,
17: NetworkType.cell3G,
18: NetworkType.cell4G,
19: NetworkType.cell4G
}
return cell_networks.get(cell_check, NetworkType.none)
def get_network_strength(self, network_type):
network_strength = NetworkStrength.unknown
# from SignalStrength.java
def get_lte_level(rsrp, rssnr):
INT_MAX = 2147483647
if rsrp == INT_MAX:
lvl_rsrp = NetworkStrength.unknown
elif rsrp >= -95:
lvl_rsrp = NetworkStrength.great
elif rsrp >= -105:
lvl_rsrp = NetworkStrength.good
elif rsrp >= -115:
lvl_rsrp = NetworkStrength.moderate
else:
lvl_rsrp = NetworkStrength.poor
if rssnr == INT_MAX:
lvl_rssnr = NetworkStrength.unknown
elif rssnr >= 45:
lvl_rssnr = NetworkStrength.great
elif rssnr >= 10:
lvl_rssnr = NetworkStrength.good
elif rssnr >= -30:
lvl_rssnr = NetworkStrength.moderate
else:
lvl_rssnr = NetworkStrength.poor
return max(lvl_rsrp, lvl_rssnr)
def get_tdscdma_level(tdscmadbm):
lvl = NetworkStrength.unknown
if tdscmadbm > -25:
lvl = NetworkStrength.unknown
elif tdscmadbm >= -49:
lvl = NetworkStrength.great
elif tdscmadbm >= -73:
lvl = NetworkStrength.good
elif tdscmadbm >= -97:
lvl = NetworkStrength.moderate
elif tdscmadbm >= -110:
lvl = NetworkStrength.poor
return lvl
def get_gsm_level(asu):
if asu <= 2 or asu == 99:
lvl = NetworkStrength.unknown
elif asu >= 12:
lvl = NetworkStrength.great
elif asu >= 8:
lvl = NetworkStrength.good
elif asu >= 5:
lvl = NetworkStrength.moderate
else:
lvl = NetworkStrength.poor
return lvl
def get_evdo_level(evdodbm, evdosnr):
lvl_evdodbm = NetworkStrength.unknown
lvl_evdosnr = NetworkStrength.unknown
if evdodbm >= -65:
lvl_evdodbm = NetworkStrength.great
elif evdodbm >= -75:
lvl_evdodbm = NetworkStrength.good
elif evdodbm >= -90:
lvl_evdodbm = NetworkStrength.moderate
elif evdodbm >= -105:
lvl_evdodbm = NetworkStrength.poor
if evdosnr >= 7:
lvl_evdosnr = NetworkStrength.great
elif evdosnr >= 5:
lvl_evdosnr = NetworkStrength.good
elif evdosnr >= 3:
lvl_evdosnr = NetworkStrength.moderate
elif evdosnr >= 1:
lvl_evdosnr = NetworkStrength.poor
return max(lvl_evdodbm, lvl_evdosnr)
def get_cdma_level(cdmadbm, cdmaecio):
lvl_cdmadbm = NetworkStrength.unknown
lvl_cdmaecio = NetworkStrength.unknown
if cdmadbm >= -75:
lvl_cdmadbm = NetworkStrength.great
elif cdmadbm >= -85:
lvl_cdmadbm = NetworkStrength.good
elif cdmadbm >= -95:
lvl_cdmadbm = NetworkStrength.moderate
elif cdmadbm >= -100:
lvl_cdmadbm = NetworkStrength.poor
if cdmaecio >= -90:
lvl_cdmaecio = NetworkStrength.great
elif cdmaecio >= -110:
lvl_cdmaecio = NetworkStrength.good
elif cdmaecio >= -130:
lvl_cdmaecio = NetworkStrength.moderate
elif cdmaecio >= -150:
lvl_cdmaecio = NetworkStrength.poor
return max(lvl_cdmadbm, lvl_cdmaecio)
if network_type == NetworkType.none:
return network_strength
if network_type == NetworkType.wifi:
out = subprocess.check_output('dumpsys connectivity', shell=True).decode('utf-8')
network_strength = NetworkStrength.unknown
for line in out.split('\n'):
signal_str = "SignalStrength: "
if signal_str in line:
lvl_idx_start = line.find(signal_str) + len(signal_str)
lvl_idx_end = line.find(']', lvl_idx_start)
lvl = int(line[lvl_idx_start : lvl_idx_end])
if lvl >= -50:
network_strength = NetworkStrength.great
elif lvl >= -60:
network_strength = NetworkStrength.good
elif lvl >= -70:
network_strength = NetworkStrength.moderate
else:
network_strength = NetworkStrength.poor
return network_strength
else:
# check cell strength
out = subprocess.check_output('dumpsys telephony.registry', shell=True).decode('utf-8')
for line in out.split('\n'):
if "mSignalStrength" in line:
arr = line.split(' ')
ns = 0
if ("gsm" in arr[14]):
rsrp = int(arr[9])
rssnr = int(arr[11])
ns = get_lte_level(rsrp, rssnr)
if ns == NetworkStrength.unknown:
tdscmadbm = int(arr[13])
ns = get_tdscdma_level(tdscmadbm)
if ns == NetworkStrength.unknown:
asu = int(arr[1])
ns = get_gsm_level(asu)
else:
cdmadbm = int(arr[3])
cdmaecio = int(arr[4])
evdodbm = int(arr[5])
evdosnr = int(arr[7])
lvl_cdma = get_cdma_level(cdmadbm, cdmaecio)
lvl_edmo = get_evdo_level(evdodbm, evdosnr)
if lvl_edmo == NetworkStrength.unknown:
ns = lvl_cdma
elif lvl_cdma == NetworkStrength.unknown:
ns = lvl_edmo
else:
ns = min(lvl_cdma, lvl_edmo)
network_strength = max(network_strength, ns)
return network_strength
+41
View File
@@ -0,0 +1,41 @@
from abc import abstractmethod
class HardwareBase:
@staticmethod
def get_cmdline():
with open('/proc/cmdline') as f:
cmdline = f.read()
return {kv[0]: kv[1] for kv in [s.split('=') for s in cmdline.split(' ')] if len(kv) == 2}
@abstractmethod
def get_sound_card_online(self):
pass
@abstractmethod
def get_imei(self, slot):
pass
@abstractmethod
def get_serial(self):
pass
@abstractmethod
def get_subscriber_info(self):
pass
@abstractmethod
def reboot(self, reason=None):
pass
@abstractmethod
def get_network_type(self):
pass
@abstractmethod
def get_sim_info(self):
pass
@abstractmethod
def get_network_strength(self, network_type):
pass
+58
View File
@@ -0,0 +1,58 @@
import serial
from common.hardware_base import HardwareBase
from cereal import log
NetworkType = log.ThermalData.NetworkType
NetworkStrength = log.ThermalData.NetworkStrength
def run_at_command(cmd, timeout=0.1):
with serial.Serial("/dev/ttyUSB2", timeout=timeout) as ser:
ser.write(cmd + b"\r\n")
ser.readline() # Modem echos request
return ser.readline().decode().rstrip()
class Tici(HardwareBase):
def get_sound_card_online(self):
return True
def get_imei(self, slot):
if slot != 0:
return ""
for _ in range(10):
try:
imei = run_at_command(b"AT+CGSN")
if len(imei) == 15:
return imei
except serial.SerialException:
pass
raise RuntimeError("Error getting IMEI")
def get_serial(self):
return self.get_cmdline()['androidboot.serialno']
def get_subscriber_info(self):
return ""
def reboot(self, reason=None):
print("REBOOT!")
def get_network_type(self):
return NetworkType.wifi
def get_sim_info(self):
return {
'sim_id': '',
'mcc_mnc': None,
'network_type': ["Unknown"],
'sim_state': ["ABSENT"],
'data_connected': False
}
def get_network_strength(self, network_type):
return NetworkStrength.unknown
+3 -3
View File
@@ -1,6 +1,6 @@
Import('env')
Import('env', 'cython_dependencies')
env.Command(['simple_kalman_impl.so'],
['simple_kalman_impl.pyx', 'simple_kalman_impl.pxd', 'simple_kalman_setup.py'],
"cd common/kalman && python3 simple_kalman_setup.py build_ext --inplace")
cython_dependencies + ['simple_kalman_impl.pyx', 'simple_kalman_impl.pxd', 'simple_kalman_setup.py'],
"cd common/kalman && python3 simple_kalman_setup.py build_ext --inplace")
+1 -1
View File
@@ -8,7 +8,7 @@ class KF1D:
def __init__(self, x0, A, C, K):
self.x = x0
self.A = A
self.C = C
self.C = np.atleast_2d(C)
self.K = K
self.A_K = self.A - np.dot(self.K, self.C)
+10 -10
View File
@@ -21,10 +21,10 @@ class TestSimpleKalman(unittest.TestCase):
K0_0 = 0.12287673
K1_0 = 0.29666309
self.kf_old = KF1D_old(x0=np.matrix([[x0_0], [x1_0]]),
A=np.matrix([[A0_0, A0_1], [A1_0, A1_1]]),
C=np.matrix([C0_0, C0_1]),
K=np.matrix([[K0_0], [K1_0]]))
self.kf_old = KF1D_old(x0=np.array([[x0_0], [x1_0]]),
A=np.array([[A0_0, A0_1], [A1_0, A1_1]]),
C=np.array([C0_0, C0_1]),
K=np.array([[K0_0], [K1_0]]))
self.kf = KF1D(x0=[[x0_0], [x1_0]],
A=[[A0_0, A0_1], [A1_0, A1_1]],
@@ -47,8 +47,8 @@ class TestSimpleKalman(unittest.TestCase):
x = self.kf.update(v_wheel)
# Compare the output x, verify that the error is less than 1e-4
self.assertAlmostEqual(x_old[0], x[0])
self.assertAlmostEqual(x_old[1], x[1])
np.testing.assert_almost_equal(x_old[0], x[0])
np.testing.assert_almost_equal(x_old[1], x[1])
def test_new_is_faster(self):
setup = """
@@ -69,10 +69,10 @@ C0_1 = 0.0
K0_0 = 0.12287673
K1_0 = 0.29666309
kf_old = KF1D_old(x0=np.matrix([[x0_0], [x1_0]]),
A=np.matrix([[A0_0, A0_1], [A1_0, A1_1]]),
C=np.matrix([C0_0, C0_1]),
K=np.matrix([[K0_0], [K1_0]]))
kf_old = KF1D_old(x0=np.array([[x0_0], [x1_0]]),
A=np.array([[A0_0, A0_1], [A1_0, A1_1]]),
C=np.array([C0_0, C0_1]),
K=np.array([[K0_0], [K1_0]]))
kf = KF1D(x0=[[x0_0], [x1_0]],
A=[[A0_0, A0_1], [A1_0, A1_1]],
+15 -16
View File
@@ -53,12 +53,12 @@ keys = {
"AccessToken": [TxType.CLEAR_ON_MANAGER_START],
"AthenadPid": [TxType.PERSISTENT],
"CalibrationParams": [TxType.PERSISTENT],
"CarBatteryCapacity": [TxType.PERSISTENT],
"CarParams": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"CarParamsCache": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"CarVin": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"CommunityFeaturesToggle": [TxType.PERSISTENT],
"CompletedTrainingVersion": [TxType.PERSISTENT],
"ControlsParams": [TxType.PERSISTENT],
"DisablePowerDown": [TxType.PERSISTENT],
"DisableUpdates": [TxType.PERSISTENT],
"DoUninstall": [TxType.CLEAR_ON_MANAGER_START],
@@ -71,7 +71,6 @@ keys = {
"HasCompletedSetup": [TxType.PERSISTENT],
"IsDriverViewEnabled": [TxType.CLEAR_ON_MANAGER_START],
"IsLdwEnabled": [TxType.PERSISTENT],
"IsGeofenceEnabled": [TxType.PERSISTENT],
"IsMetric": [TxType.PERSISTENT],
"IsOffroad": [TxType.CLEAR_ON_MANAGER_START],
"IsRHD": [TxType.PERSISTENT],
@@ -80,10 +79,8 @@ keys = {
"IsUploadRawEnabled": [TxType.PERSISTENT],
"LastAthenaPingTime": [TxType.PERSISTENT],
"LastUpdateTime": [TxType.PERSISTENT],
"LimitSetSpeed": [TxType.PERSISTENT],
"LimitSetSpeedNeural": [TxType.PERSISTENT],
"LastUpdateException": [TxType.PERSISTENT],
"LiveParameters": [TxType.PERSISTENT],
"LongitudinalControl": [TxType.PERSISTENT],
"OpenpilotEnabledToggle": [TxType.PERSISTENT],
"LaneChangeEnabled": [TxType.PERSISTENT],
"PandaFirmware": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
@@ -93,7 +90,6 @@ keys = {
"RecordFront": [TxType.PERSISTENT],
"ReleaseNotes": [TxType.PERSISTENT],
"ShouldDoUpdate": [TxType.CLEAR_ON_MANAGER_START],
"SpeedLimitOffset": [TxType.PERSISTENT],
"SubscriberInfo": [TxType.PERSISTENT],
"TermsVersion": [TxType.PERSISTENT],
"TrainingVersion": [TxType.PERSISTENT],
@@ -108,6 +104,7 @@ keys = {
"Offroad_InvalidTime": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_IsTakingSnapshot": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_NeosUpdate": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_UpdateFailed": [TxType.CLEAR_ON_MANAGER_START],
}
@@ -120,14 +117,15 @@ def fsync_dir(path):
class FileLock():
def __init__(self, path, create):
def __init__(self, path, create, lock_ex):
self._path = path
self._create = create
self._fd = None
self._lock_ex = lock_ex
def acquire(self):
self._fd = os.open(self._path, os.O_CREAT if self._create else 0)
fcntl.flock(self._fd, fcntl.LOCK_EX)
fcntl.flock(self._fd, fcntl.LOCK_EX if self._lock_ex else fcntl.LOCK_SH)
def release(self):
if self._fd is not None:
@@ -155,8 +153,8 @@ class DBAccessor():
except KeyError:
return None
def _get_lock(self, create):
lock = FileLock(os.path.join(self._path, ".lock"), create)
def _get_lock(self, create, lock_ex):
lock = FileLock(os.path.join(self._path, ".lock"), create, lock_ex)
lock.acquire()
return lock
@@ -188,7 +186,7 @@ class DBAccessor():
class DBReader(DBAccessor):
def __enter__(self):
try:
lock = self._get_lock(False)
lock = self._get_lock(False, False)
except OSError as e:
# Do not create lock if it does not exist.
if e.errno == errno.ENOENT:
@@ -226,7 +224,7 @@ class DBWriter(DBAccessor):
try:
os.chmod(self._path, 0o777)
self._lock = self._get_lock(True)
self._lock = self._get_lock(True, True)
self._vals = self._read_values_locked()
except Exception:
os.umask(self._prev_umask)
@@ -315,18 +313,19 @@ def write_db(params_path, key, value):
value = value.encode('utf8')
prev_umask = os.umask(0)
lock = FileLock(params_path + "/.lock", True)
lock = FileLock(params_path + "/.lock", True, True)
lock.acquire()
try:
tmp_path = tempfile.mktemp(prefix=".tmp", dir=params_path)
with open(tmp_path, "wb") as f:
tmp_path = tempfile.NamedTemporaryFile(mode="wb", prefix=".tmp", dir=params_path, delete=False)
with tmp_path as f:
f.write(value)
f.flush()
os.fsync(f.fileno())
os.chmod(tmp_path.name, 0o666)
path = "%s/d/%s" % (params_path, key)
os.rename(tmp_path, path)
os.rename(tmp_path.name, path)
fsync_dir(os.path.dirname(path))
finally:
os.umask(prev_umask)
+15 -28
View File
@@ -1,12 +1,10 @@
"""Utilities for reading real time clocks and keeping soft real time constraints."""
import gc
import os
import time
import platform
import subprocess
import multiprocessing
from cffi import FFI
from common.android import ANDROID
from common.hardware import PC
from common.common_pyx import sec_since_boot # pylint: disable=no-name-in-module, import-error
@@ -17,37 +15,26 @@ DT_DMON = 0.1 # driver monitoring
DT_TRML = 0.5 # thermald and manager
ffi = FFI()
ffi.cdef("long syscall(long number, ...);")
libc = ffi.dlopen(None)
def _get_tid():
if platform.machine() == "x86_64":
NR_gettid = 186
elif platform.machine() == "aarch64":
NR_gettid = 178
else:
raise NotImplementedError
return libc.syscall(NR_gettid)
class Priority:
MIN_REALTIME = 52 # highest android process priority is 51
CTRL_LOW = MIN_REALTIME
CTRL_HIGH = MIN_REALTIME + 1
def set_realtime_priority(level):
if os.getuid() != 0:
print("not setting priority, not root")
return
if not PC:
os.sched_setscheduler(0, os.SCHED_FIFO, os.sched_param(level))
return subprocess.call(['chrt', '-f', '-p', str(level), str(_get_tid())])
def set_core_affinity(core):
if os.getuid() != 0:
print("not setting affinity, not root")
return
if not PC:
os.sched_setaffinity(0, [core,])
if ANDROID:
return subprocess.call(['taskset', '-p', str(core), str(_get_tid())])
else:
return -1
def config_rt_process(core, priority):
gc.disable()
set_realtime_priority(priority)
set_core_affinity(core)
class Ratekeeper():
+11 -25
View File
@@ -4,14 +4,17 @@ from common.basedir import BASEDIR
class Spinner():
def __init__(self):
try:
self.spinner_proc = subprocess.Popen(["./spinner"],
stdin=subprocess.PIPE,
cwd=os.path.join(BASEDIR, "selfdrive", "ui", "spinner"),
close_fds=True)
except OSError:
self.spinner_proc = None
def __init__(self, noop=False):
# spinner is currently only implemented for android
self.spinner_proc = None
if not noop:
try:
self.spinner_proc = subprocess.Popen(["./spinner"],
stdin=subprocess.PIPE,
cwd=os.path.join(BASEDIR, "selfdrive", "ui", "spinner"),
close_fds=True)
except OSError:
self.spinner_proc = None
def __enter__(self):
return self
@@ -40,23 +43,6 @@ class Spinner():
self.close()
class FakeSpinner(Spinner):
def __init__(self): # pylint: disable=super-init-not-called
pass
def __enter__(self):
return self
def update(self, _):
pass
def close(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
pass
if __name__ == "__main__":
import time
with Spinner() as s:
+17 -37
View File
@@ -5,21 +5,23 @@ import subprocess
from common.basedir import BASEDIR
class TextWindow():
def __init__(self, s):
try:
self.text_proc = subprocess.Popen(["./text", s],
stdin=subprocess.PIPE,
cwd=os.path.join(BASEDIR, "selfdrive", "ui", "text"),
close_fds=True)
except OSError:
self.text_proc = None
class TextWindow:
def __init__(self, s, noop=False):
# text window is only implemented for android currently
self.text_proc = None
if not noop:
try:
self.text_proc = subprocess.Popen(["./text", s],
stdin=subprocess.PIPE,
cwd=os.path.join(BASEDIR, "selfdrive", "ui", "text"),
close_fds=True)
except OSError:
self.text_proc = None
def get_status(self):
if self.text_proc is not None:
self.text_proc.poll()
return self.text_proc.returncode
return None
def __enter__(self):
@@ -31,10 +33,11 @@ class TextWindow():
self.text_proc = None
def wait_for_exit(self):
while True:
if self.get_status() == 1:
return
time.sleep(0.1)
if self.text_proc is not None:
while True:
if self.get_status() == 1:
return
time.sleep(0.1)
def __del__(self):
self.close()
@@ -43,29 +46,6 @@ class TextWindow():
self.close()
class FakeTextWindow(TextWindow):
def __init__(self, s): # pylint: disable=super-init-not-called
pass
def get_status(self):
return 1
def wait_for_exit(self):
return
def __enter__(self):
return self
def update(self, _):
pass
def close(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
pass
if __name__ == "__main__":
text = """Traceback (most recent call last):
File "./controlsd.py", line 608, in <module>
+5 -6
View File
@@ -1,9 +1,8 @@
Import('env')
Import('env', 'cython_dependencies')
d = Dir('.')
env.Command(
['transformations.so'],
['transformations.pxd', 'transformations.pyx',
'coordinates.cc', 'orientation.cc', 'coordinates.hpp', 'orientation.hpp'],
'cd ' + d.path + ' && python3 setup.py build_ext --inplace')
env.Command(['transformations.so'],
cython_dependencies + ['transformations.pxd', 'transformations.pyx',
'coordinates.cc', 'orientation.cc', 'coordinates.hpp', 'orientation.hpp'],
'cd ' + d.path + ' && python3 setup.py build_ext --inplace')
+7
View File
@@ -52,6 +52,13 @@ def get_view_frame_from_road_frame(roll, pitch, yaw, height):
return np.hstack((view_from_road, [[0], [height], [0]]))
# aka 'extrinsic_matrix'
def get_view_frame_from_calib_frame(roll, pitch, yaw, height):
device_from_calib= orient.rot_from_euler([roll, pitch, yaw])
view_from_calib = view_frame_from_device_frame.dot(device_from_calib)
return np.hstack((view_from_calib, [[0], [height], [0]]))
def vp_from_ke(m):
"""
Computes the vanishing point from the product of the intrinsic and extrinsic
+3 -3
View File
@@ -10,9 +10,9 @@
#define RAD2DEG(x) ((x) * 180.0 / M_PI)
double a = 6378137;
double b = 6356752.3142;
double esq = 6.69437999014 * 0.001;
double a = 6378137; // lgtm [cpp/short-global-name]
double b = 6356752.3142; // lgtm [cpp/short-global-name]
double esq = 6.69437999014 * 0.001; // lgtm [cpp/short-global-name]
double e1sq = 6.73949674228 * 0.001;
+4
View File
@@ -2,6 +2,7 @@ import numpy as np
from common.transformations.camera import (FULL_FRAME_SIZE, eon_focal_length,
get_view_frame_from_road_frame,
get_view_frame_from_calib_frame,
vp_from_ke)
# segnet
@@ -73,6 +74,9 @@ bigmodel_frame_from_road_frame = np.dot(bigmodel_intrinsics,
medmodel_frame_from_road_frame = np.dot(medmodel_intrinsics,
get_view_frame_from_road_frame(0, 0, 0, model_height))
medmodel_frame_from_calib_frame = np.dot(medmodel_intrinsics,
get_view_frame_from_calib_frame(0, 0, 0, 0))
model_frame_from_bigmodel_frame = np.dot(model_intrinsics, np.linalg.inv(bigmodel_intrinsics))
medmodel_frame_from_bigmodel_frame = np.dot(medmodel_intrinsics, np.linalg.inv(bigmodel_intrinsics))
-1
View File
@@ -46,7 +46,6 @@ quats_from_rotations = rot2quat
quat_from_rot = rot2quat
rotations_from_quats = quat2rot
rot_from_quat = quat2rot
rot_from_quat = quat2rot
euler_from_rot = rot2euler
euler_from_quat = quat2euler
rot_from_euler = euler2rot
Binary file not shown.
+153 -124
View File
@@ -10,6 +10,7 @@
#include <string>
#include <sstream>
#include <fstream>
#include <iostream>
#include <mutex>
#include <thread>
@@ -33,10 +34,10 @@
#define USER_AGENT "NEOSUpdater-0.2"
#define MANIFEST_URL_EON_STAGING "https://github.com/commaai/eon-neos/raw/master/update.staging.json"
#define MANIFEST_URL_EON_LOCAL "http://192.168.5.1:8000/neosupdate/update.local.json"
#define MANIFEST_URL_EON "https://github.com/commaai/eon-neos/raw/master/update.json"
const char *manifest_url = MANIFEST_URL_EON;
#define MANIFEST_URL_NEOS_STAGING "https://github.com/commaai/eon-neos/raw/master/update.staging.json"
#define MANIFEST_URL_NEOS_LOCAL "http://192.168.5.1:8000/neosupdate/update.local.json"
#define MANIFEST_URL_NEOS "https://github.com/commaai/eon-neos/raw/master/update.json"
const char *manifest_url = MANIFEST_URL_NEOS;
#define RECOVERY_DEV "/dev/block/bootdevice/by-name/recovery"
#define RECOVERY_COMMAND "/cache/recovery/command"
@@ -96,7 +97,7 @@ std::string download_string(CURL *curl, std::string url) {
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 0);
curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
curl_easy_setopt(curl, CURLOPT_RESUME_FROM, 0);
@@ -149,6 +150,32 @@ static void start_settings_activity(const char* name) {
system(launch_cmd);
}
bool is_settings_active() {
FILE *fp;
char sys_output[4096];
fp = popen("/bin/dumpsys window windows", "r");
if (fp == NULL) {
return false;
}
bool active = false;
while (fgets(sys_output, sizeof(sys_output), fp) != NULL) {
if (strstr(sys_output, "mCurrentFocus=null") != NULL) {
break;
}
if (strstr(sys_output, "mCurrentFocus=Window") != NULL) {
active = true;
break;
}
}
pclose(fp);
return active;
}
struct Updater {
bool do_exit = false;
@@ -166,7 +193,6 @@ struct Updater {
std::mutex lock;
// i hate state machines give me coroutines already
enum UpdateState {
CONFIRMATION,
LOW_BATTERY,
@@ -190,9 +216,15 @@ struct Updater {
int b_x, b_w, b_y, b_h;
int balt_x;
// download stage writes these for the installation stage
int recovery_len;
std::string recovery_hash;
std::string recovery_fn;
std::string ota_fn;
CURL *curl = NULL;
Updater() {
void ui_init() {
touch_init(&touch);
fb = framebuffer_init("updater", 0x00001000, false,
@@ -218,7 +250,6 @@ struct Updater {
b_h = 220;
state = CONFIRMATION;
}
int download_file_xferinfo(curl_off_t dltotal, curl_off_t dlno,
@@ -251,7 +282,7 @@ struct Updater {
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 0);
curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
curl_easy_setopt(curl, CURLOPT_RESUME_FROM, resume_from);
@@ -319,32 +350,113 @@ struct Updater {
state = RUNNING;
}
std::string stage_download(std::string url, std::string hash, std::string name) {
std::string download(std::string url, std::string hash, std::string name) {
std::string out_fn = UPDATE_DIR "/" + util::base_name(url);
set_progress("Downloading " + name + "...");
bool r = download_file(url, out_fn);
if (!r) {
set_error("failed to download " + name);
return "";
// start or resume downloading if hash doesn't match
std::string fn_hash = sha256_file(out_fn);
if (hash.compare(fn_hash) != 0) {
set_progress("Downloading " + name + "...");
bool r = download_file(url, out_fn);
if (!r) {
set_error("failed to download " + name);
unlink(out_fn.c_str());
return "";
}
fn_hash = sha256_file(out_fn);
}
set_progress("Verifying " + name + "...");
std::string fn_hash = sha256_file(out_fn);
printf("got %s hash: %s\n", name.c_str(), hash.c_str());
if (fn_hash != hash) {
set_error(name + " was corrupt");
unlink(out_fn.c_str());
return "";
}
return out_fn;
}
void run_stages() {
bool download_stage() {
curl = curl_easy_init();
assert(curl);
// ** quick checks before download **
if (!check_space()) {
set_error("2GB of free space required to update");
return false;
}
mkdir(UPDATE_DIR, 0777);
set_progress("Finding latest version...");
std::string manifest_s = download_string(curl, manifest_url);
printf("manifest: %s\n", manifest_s.c_str());
std::string err;
auto manifest = json11::Json::parse(manifest_s, err);
if (manifest.is_null() || !err.empty()) {
set_error("failed to load update manifest");
return false;
}
std::string ota_url = manifest["ota_url"].string_value();
std::string ota_hash = manifest["ota_hash"].string_value();
std::string recovery_url = manifest["recovery_url"].string_value();
recovery_hash = manifest["recovery_hash"].string_value();
recovery_len = manifest["recovery_len"].int_value();
// std::string installer_url = manifest["installer_url"].string_value();
// std::string installer_hash = manifest["installer_hash"].string_value();
if (ota_url.empty() || ota_hash.empty()) {
set_error("invalid update manifest");
return false;
}
// std::string installer_fn = download(installer_url, installer_hash, "installer");
// if (installer_fn.empty()) {
// //error'd
// return;
// }
// ** handle recovery download **
if (recovery_url.empty() || recovery_hash.empty() || recovery_len == 0) {
set_progress("Skipping recovery flash...");
} else {
// only download the recovery if it differs from what's flashed
set_progress("Checking recovery...");
std::string existing_recovery_hash = sha256_file(RECOVERY_DEV, recovery_len);
printf("existing recovery hash: %s\n", existing_recovery_hash.c_str());
if (existing_recovery_hash != recovery_hash) {
recovery_fn = download(recovery_url, recovery_hash, "recovery");
if (recovery_fn.empty()) {
// error'd
return false;
}
}
}
// ** handle ota download **
ota_fn = download(ota_url, ota_hash, "update");
if (ota_fn.empty()) {
//error'd
return false;
}
// download sucessful
return true;
}
// thread that handles downloading and installing the update
void run_stages() {
printf("run_stages start\n");
// ** download update **
if (!check_battery()) {
set_battery_low();
int battery_cap = battery_capacity();
@@ -356,77 +468,12 @@ struct Updater {
set_running();
}
if (!check_space()) {
set_error("2GB of free space required to update");
bool sucess = download_stage();
if (!sucess) {
return;
}
mkdir(UPDATE_DIR, 0777);
const int EON = (access("/EON", F_OK) != -1);
set_progress("Finding latest version...");
std::string manifest_s;
if (EON) {
manifest_s = download_string(curl, manifest_url);
} else {
// don't update NEO
exit(0);
}
printf("manifest: %s\n", manifest_s.c_str());
std::string err;
auto manifest = json11::Json::parse(manifest_s, err);
if (manifest.is_null() || !err.empty()) {
set_error("failed to load update manifest");
return;
}
std::string ota_url = manifest["ota_url"].string_value();
std::string ota_hash = manifest["ota_hash"].string_value();
std::string recovery_url = manifest["recovery_url"].string_value();
std::string recovery_hash = manifest["recovery_hash"].string_value();
int recovery_len = manifest["recovery_len"].int_value();
// std::string installer_url = manifest["installer_url"].string_value();
// std::string installer_hash = manifest["installer_hash"].string_value();
if (ota_url.empty() || ota_hash.empty()) {
set_error("invalid update manifest");
return;
}
// std::string installer_fn = stage_download(installer_url, installer_hash, "installer");
// if (installer_fn.empty()) {
// //error'd
// return;
// }
std::string recovery_fn;
if (recovery_url.empty() || recovery_hash.empty() || recovery_len == 0) {
set_progress("Skipping recovery flash...");
} else {
// only download the recovery if it differs from what's flashed
set_progress("Checking recovery...");
std::string existing_recovery_hash = sha256_file(RECOVERY_DEV, recovery_len);
printf("existing recovery hash: %s\n", existing_recovery_hash.c_str());
if (existing_recovery_hash != recovery_hash) {
recovery_fn = stage_download(recovery_url, recovery_hash, "recovery");
if (recovery_fn.empty()) {
// error'd
return;
}
}
}
std::string ota_fn = stage_download(ota_url, ota_hash, "update");
if (ota_fn.empty()) {
//error'd
return;
}
// ** install update **
if (!check_battery()) {
set_battery_low();
@@ -601,7 +648,7 @@ struct Updater {
int powerprompt_y = 312;
nvgFontFace(vg, "opensans_regular");
nvgFontSize(vg, 64.0f);
nvgText(vg, fb_w/2, 740, "Ensure EON is connected to power.", NULL);
nvgText(vg, fb_w/2, 740, "Ensure your device remains connected to a power source.", NULL);
NVGpaint paint = nvgBoxGradient(
vg, progress_x + 1, progress_y + 1,
@@ -657,9 +704,7 @@ struct Updater {
void ui_update() {
std::lock_guard<std::mutex> guard(lock);
switch (state) {
case ERROR:
case CONFIRMATION: {
if (state == ERROR || state == CONFIRMATION) {
int touch_x = -1, touch_y = -1;
int res = touch_poll(&touch, &touch_x, &touch_y, 0);
if (res == 1 && !is_settings_active()) {
@@ -678,13 +723,11 @@ struct Updater {
}
}
}
default:
break;
}
}
void go() {
ui_init();
while (!do_exit) {
ui_update();
@@ -718,51 +761,37 @@ struct Updater {
update_thread_handle.join();
}
// reboot
system("service call power 16 i32 0 i32 0 i32 1");
}
bool is_settings_active() {
FILE *fp;
char sys_output[4096];
fp = popen("/bin/dumpsys window windows", "r");
if (fp == NULL) {
return false;
}
bool active = false;
while (fgets(sys_output, sizeof(sys_output), fp) != NULL) {
if (strstr(sys_output, "mCurrentFocus=null") != NULL) {
break;
}
if (strstr(sys_output, "mCurrentFocus=Window") != NULL) {
active = true;
break;
}
}
pclose(fp);
return active;
}
};
}
int main(int argc, char *argv[]) {
bool background_cache = false;
if (argc > 1) {
if (strcmp(argv[1], "local") == 0) {
manifest_url = MANIFEST_URL_EON_LOCAL;
manifest_url = MANIFEST_URL_NEOS_LOCAL;
} else if (strcmp(argv[1], "staging") == 0) {
manifest_url = MANIFEST_URL_EON_STAGING;
manifest_url = MANIFEST_URL_NEOS_STAGING;
} else if (strcmp(argv[1], "bgcache") == 0) {
manifest_url = argv[2];
background_cache = true;
} else {
manifest_url = argv[1];
}
}
printf("updating from %s\n", manifest_url);
Updater updater;
updater.go();
return 0;
int err = 0;
if (background_cache) {
err = !updater.download_stage();
} else {
updater.go();
}
return err;
}
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/bash
export PASSIVE="0"
exec ./launch_chffrplus.sh
+63 -65
View File
@@ -1,25 +1,74 @@
#!/usr/bin/bash
export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
export NUMEXPR_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
export VECLIB_MAXIMUM_THREADS=1
if [ -z "$BASEDIR" ]; then
BASEDIR="/data/openpilot"
fi
if [ -z "$PASSIVE" ]; then
export PASSIVE="1"
fi
source "$BASEDIR/launch_env.sh"
STAGING_ROOT="/data/safe_staging"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
function two_init {
# Restrict Android and other system processes to the first two cores
echo 0-1 > /dev/cpuset/background/cpus
echo 0-1 > /dev/cpuset/system-background/cpus
echo 0-1 > /dev/cpuset/foreground/boost/cpus
echo 0-1 > /dev/cpuset/foreground/cpus
echo 0-1 > /dev/cpuset/android/cpus
# openpilot gets all the cores
echo 0-3 > /dev/cpuset/app/cpus
# Collect RIL and other possibly long-running I/O interrupts onto CPU 1
echo 1 > /proc/irq/78/smp_affinity_list # qcom,smd-modem (LTE radio)
echo 1 > /proc/irq/33/smp_affinity_list # ufshcd (flash storage)
echo 1 > /proc/irq/35/smp_affinity_list # wifi (wlan_pci)
# USB traffic needs realtime handling on cpu 3
[ -d "/proc/irq/733" ] && echo 3 > /proc/irq/733/smp_affinity_list # USB for LeEco
[ -d "/proc/irq/736" ] && echo 3 > /proc/irq/736/smp_affinity_list # USB for OP3T
# Check for NEOS update
if [ $(< /VERSION) != "$REQUIRED_NEOS_VERSION" ]; then
if [ -f "$DIR/scripts/continue.sh" ]; then
cp "$DIR/scripts/continue.sh" "/data/data/com.termux/files/continue.sh"
fi
if [ ! -f "$BASEDIR/prebuilt" ]; then
# Clean old build products, but preserve the scons cache
cd $DIR
scons --clean
git clean -xdf
git submodule foreach --recursive git clean -xdf
fi
"$DIR/installer/updater/updater" "file://$DIR/installer/updater/update.json"
else
if [[ $(uname -v) == "#1 SMP PREEMPT Wed Jun 10 12:40:53 PDT 2020" ]]; then
"$DIR/installer/updater/updater" "file://$DIR/installer/updater/update_kernel.json"
fi
fi
# One-time fix for a subset of OP3T with gyro orientation offsets.
# Remove and regenerate qcom sensor registry. Only done on OP3T mainboards.
# Performed exactly once. The old registry is preserved just-in-case, and
# doubles as a flag denoting we've already done the reset.
if ! $(grep -q "letv" /proc/cmdline) && [ ! -f "/persist/comma/op3t-sns-reg-backup" ]; then
echo "Performing OP3T sensor registry reset"
mv /persist/sensors/sns.reg /persist/comma/op3t-sns-reg-backup &&
rm -f /persist/sensors/sensors_settings /persist/sensors/error_log /persist/sensors/gyro_sensitity_cal &&
echo "restart" > /sys/kernel/debug/msm_subsys/slpi &&
sleep 5 # Give Android sensor subsystem a moment to recover
fi
}
function launch {
# Wifi scan
wpa_cli IFNAME=wlan0 SCAN
# Remove orphaned git lock if it exists on boot
[ -f "$DIR/.git/index.lock" ] && rm -f $DIR/.git/index.lock
# Check to see if there's a valid overlay-based update available. Conditions
# are as follows:
#
@@ -49,6 +98,7 @@ function launch {
git submodule foreach --recursive git reset --hard
echo "Restarting launch script ${LAUNCHER_LOCATION}"
unset REQUIRED_NEOS_VERSION
exec "${LAUNCHER_LOCATION}"
else
echo "openpilot backup found, not updating"
@@ -58,61 +108,9 @@ function launch {
fi
fi
# Android and other system processes are not permitted to run on CPU 3
# NEOS installed app processes can run anywhere
echo 0-2 > /dev/cpuset/background/cpus
echo 0-2 > /dev/cpuset/system-background/cpus
[ -d "/dev/cpuset/foreground/boost/cpus" ] && echo 0-2 > /dev/cpuset/foreground/boost/cpus # Not present in < NEOS 15
echo 0-2 > /dev/cpuset/foreground/cpus
echo 0-2 > /dev/cpuset/android/cpus
echo 0-3 > /dev/cpuset/app/cpus
# Collect RIL and other possibly long-running I/O interrupts onto CPU 1
echo 1 > /proc/irq/78/smp_affinity_list # qcom,smd-modem (LTE radio)
echo 1 > /proc/irq/33/smp_affinity_list # ufshcd (flash storage)
echo 1 > /proc/irq/35/smp_affinity_list # wifi (wlan_pci)
# USB traffic needs realtime handling on cpu 3
[ -d "/proc/irq/733" ] && echo 3 > /proc/irq/733/smp_affinity_list # USB for LeEco
[ -d "/proc/irq/736" ] && echo 3 > /proc/irq/736/smp_affinity_list # USB for OP3T
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
# Remove old NEOS update file
# TODO: move this code to the updater
if [ -d /data/neoupdate ]; then
rm -rf /data/neoupdate
fi
# Check for NEOS update
if [ $(< /VERSION) != "14" ]; then
if [ -f "$DIR/scripts/continue.sh" ]; then
cp "$DIR/scripts/continue.sh" "/data/data/com.termux/files/continue.sh"
fi
if [ ! -f "$BASEDIR/prebuilt" ]; then
echo "Clearing build products and resetting scons state prior to NEOS update"
cd $BASEDIR && scons --clean
rm -rf /tmp/scons_cache
rm -r $BASEDIR/.sconsign.dblite
fi
"$DIR/installer/updater/updater" "file://$DIR/installer/updater/update.json"
else
if [[ $(uname -v) == "#1 SMP PREEMPT Wed Jun 10 12:40:53 PDT 2020" ]]; then
"$DIR/installer/updater/updater" "file://$DIR/installer/updater/update_kernel.json"
fi
fi
# One-time fix for a subset of OP3T with gyro orientation offsets.
# Remove and regenerate qcom sensor registry. Only done on OP3T mainboards.
# Performed exactly once. The old registry is preserved just-in-case, and
# doubles as a flag denoting we've already done the reset.
# TODO: we should really grow per-platform detect and setup routines
if ! $(grep -q "letv" /proc/cmdline) && [ ! -f "/persist/comma/op3t-sns-reg-backup" ]; then
echo "Performing OP3T sensor registry reset"
mv /persist/sensors/sns.reg /persist/comma/op3t-sns-reg-backup &&
rm -f /persist/sensors/sensors_settings /persist/sensors/error_log /persist/sensors/gyro_sensitity_cal &&
echo "restart" > /sys/kernel/debug/msm_subsys/slpi &&
sleep 5 # Give Android sensor subsystem a moment to recover
# comma two init
if [ -f /EON ]; then
two_init
fi
# handle pythonpath
Executable
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/bash
export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
export NUMEXPR_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
export VECLIB_MAXIMUM_THREADS=1
if [ -z "$REQUIRED_NEOS_VERSION" ]; then
export REQUIRED_NEOS_VERSION="14"
fi
if [ -z "$PASSIVE" ]; then
export PASSIVE="1"
fi
export STAGING_ROOT="/data/safe_staging"
Binary file not shown.
-1
View File
@@ -14,4 +14,3 @@ can/packer_pyx.cpp
can/parser_pyx.cpp
can/packer_pyx.html
can/parser_pyx.html
can/packer_impl.cpp
+4 -5
View File
@@ -1,4 +1,4 @@
Import('env', 'cereal')
Import('env', 'cereal', 'cython_dependencies')
import os
from opendbc.can.process_dbc import process
@@ -17,7 +17,6 @@ for x in sorted(os.listdir('../')):
libdbc = env.SharedLibrary('libdbc', ["dbc.cc", "parser.cc", "packer.cc", "common.cc"]+dbcs, LIBS=["capnp", "kj"])
# Build packer and parser
env.Command(['packer_pyx.so', 'parser_pyx.so'],
[libdbc, cereal, 'common_pyx_setup.py', 'packer_pyx.pyx', 'parser_pyx.pyx', 'common.pxd'],
"cd opendbc/can && python3 common_pyx_setup.py build_ext --inplace")
env.Command(['packer_pyx.so', 'packer_pyx.cpp', 'parser_pyx.so', 'parser_pyx.cpp'],
cython_dependencies + [libdbc, cereal, 'common_pyx_setup.py', 'common.pxd', 'packer_pyx.pyx', 'parser_pyx.pyx', 'packer.cc', 'parser.cc'],
"cd opendbc/can && python3 common_pyx_setup.py build_ext --inplace")
+3 -3
View File
@@ -34,7 +34,7 @@ class BuildExtWithoutPlatformSuffix(build_ext):
return get_ext_filename_without_platform_suffix(filename)
extra_compile_args = ["-std=c++14"]
extra_compile_args = ["-std=c++14", "-Wno-nullability-completeness"]
ARCH = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() # pylint: disable=unexpected-keyword-arg
if ARCH == "aarch64":
extra_compile_args += ["-Wno-deprecated-register"]
@@ -63,9 +63,9 @@ setup(name='CAN parser',
include_dirs=include_dirs,
extra_link_args=extra_link_args,
),
nthreads=4,
annotate=ANNOTATE
),
nthreads=4,
)
if platform.system() == "Darwin":
@@ -85,9 +85,9 @@ setup(name='CAN packer',
include_dirs=include_dirs,
extra_link_args=extra_link_args,
),
nthreads=4,
annotate=ANNOTATE
),
nthreads=4,
)
if platform.system() == "Darwin":
+5 -3
View File
@@ -20,9 +20,11 @@ cdef class CANPacker:
map[int, int] address_to_size
def __init__(self, dbc_name):
self.packer = new cpp_CANPacker(dbc_name)
self.dbc = dbc_lookup(dbc_name)
if not self.dbc:
raise RuntimeError("Can't lookup" + dbc_name)
self.packer = new cpp_CANPacker(dbc_name)
num_msgs = self.dbc[0].num_msgs
for i in range(num_msgs):
msg = self.dbc[0].msgs[i]
@@ -37,7 +39,7 @@ cdef class CANPacker:
for name, value in values.iteritems():
n = name.encode('utf8')
names.append(n) # TODO: find better way to keep reference to temp string arround
names.append(n) # TODO: find better way to keep reference to temp string around
spv.name = n
spv.value = value
+1 -1
View File
@@ -187,7 +187,7 @@ void CANParser::UpdateCans(uint64_t sec, const capnp::List<cereal::CanData>::Rea
continue;
}
if (cmsg.getDat().size() > 8) continue; //shouldnt ever happen
if (cmsg.getDat().size() > 8) continue; //shouldn't ever happen
uint8_t dat[8] = {0};
memcpy(dat, cmsg.getDat().begin(), cmsg.getDat().size());
+2 -2
View File
@@ -1,2 +1,2 @@
from opendbc.can.parser_pyx import CANParser # pylint: disable=no-name-in-module, import-error
assert CANParser
from opendbc.can.parser_pyx import CANParser, CANDefine # pylint: disable=no-name-in-module, import-error
assert CANParser, CANDefine
+9 -10
View File
@@ -3,24 +3,20 @@
from libcpp.string cimport string
from libcpp.vector cimport vector
from libcpp cimport bool
from libcpp.unordered_set cimport unordered_set
from libc.stdint cimport uint32_t, uint64_t, uint16_t
from libcpp.map cimport map
from collections import defaultdict
from libcpp cimport bool
from common cimport CANParser as cpp_CANParser
from common cimport SignalParseOptions, MessageParseOptions, dbc_lookup, SignalValue, DBC
from libcpp cimport bool
import os
import numbers
from collections import defaultdict
cdef int CAN_INVALID_CNT = 5
cdef class CANParser:
cdef:
cpp_CANParser *can
@@ -30,7 +26,7 @@ cdef class CANParser:
vector[SignalValue] can_values
bool test_mode_enabled
cdef public:
cdef readonly:
string dbc_name
dict vl
dict ts
@@ -40,10 +36,11 @@ cdef class CANParser:
def __init__(self, dbc_name, signals, checks=None, bus=0):
if checks is None:
checks = []
self.can_valid = True
self.dbc_name = dbc_name
self.dbc = dbc_lookup(dbc_name)
if not self.dbc:
raise RuntimeError("Can't lookup" + dbc_name)
self.vl = {}
self.ts = {}
@@ -113,7 +110,7 @@ cdef class CANParser:
for cv in can_values:
# Cast char * directly to unicde
# Cast char * directly to unicode
name = <unicode>self.address_to_msg_name[cv.address].c_str()
cv_name = <unicode>cv.name
@@ -151,7 +148,9 @@ cdef class CANDefine():
def __init__(self, dbc_name):
self.dbc_name = dbc_name
self.dbc = dbc_lookup(dbc_name)
if not self.dbc:
raise RuntimeError("Can't lookup" + dbc_name)
num_vals = self.dbc[0].num_vals
address_to_msg_name = {}
+2 -2
View File
@@ -81,7 +81,7 @@ def process(in_fn, out_fn):
if sig.start_bit % 8 != checksum_start_bit:
sys.exit("%s: CHECKSUM starts at wrong bit" % dbc_msg_name)
if little_endian != sig.is_little_endian:
sys.exit("%s: CHECKSUM has wrong endianess" % dbc_msg_name)
sys.exit("%s: CHECKSUM has wrong endianness" % dbc_msg_name)
# counter rules
if sig.name == "COUNTER":
if counter_size is not None and sig.size != counter_size:
@@ -90,7 +90,7 @@ def process(in_fn, out_fn):
print(counter_start_bit, sig.start_bit)
sys.exit("%s: COUNTER starts at wrong bit" % dbc_msg_name)
if little_endian != sig.is_little_endian:
sys.exit("%s: COUNTER has wrong endianess" % dbc_msg_name)
sys.exit("%s: COUNTER has wrong endianness" % dbc_msg_name)
# pedal rules
if address in [0x200, 0x201]:
if sig.name == "COUNTER_PEDAL" and sig.size != 4:
+1 -1
View File
@@ -409,7 +409,7 @@ CM_ SG_ 571 CHECKSUM "standard checksum";
CM_ SG_ 825 BEEP_339 "sent every 0.5s. 0050 is no beep. To beep send 4355 or 4155. Used by ParkSense warning.";
CM_ SG_ 270 ELECTRIC_MOTOR "0x7fff indicates electric motor not in use";
CM_ SG_ 291 ENERGY_GAIN_LOSS "unsure what this actually is";
CM_ SG_ 291 ENERGY_SMOOTHER_CURVE "unusre what it is, but smoother";
CM_ SG_ 291 ENERGY_SMOOTHER_CURVE "unsure what it is, but smoother";
CM_ SG_ 308 ACCEL_134 "only set when human presses accel pedal";
CM_ SG_ 532 NOISY_SLOWLY_DECREASING "perhaps battery but do not know";
CM_ SG_ 816 TRACTION_OFF "set when traction off button is enabled";
+1 -1
View File
@@ -37,7 +37,7 @@ BU_: K109_FCM B233B_LRR NEO VIS_FO VIS2_FO K124_ASCM Vector__XXX EOCM_F_FO EOCM2
VAL_TABLE_ RangeMode 1 "Active" 0 "Inactive" ;
VAL_TABLE_ TrkConf 3 "Confident" 2 "Speculative" 1 "Highly speculative" 0 "Invalid" ;
VAL_TABLE_ TrkMeasStatus 3 "Measured current cycle" 2 "Latent track not detected" 1 "New object" 0 "No object" ;
VAL_TABLE_ TrkDynProp 4 "Moving in opposite direction" 3 "Moving in same direction" 2 "Has moved but currenty stopped" 1 "Has never moved," 0 "Unkown" ;
VAL_TABLE_ TrkDynProp 4 "Moving in opposite direction" 3 "Moving in same direction" 2 "Has moved but currently stopped" 1 "Has never moved," 0 "Unknown" ;
VAL_TABLE_ FrntVsnInPthVehBrkNwSt 10 "Active" 5 "Inactive" ;
VAL_TABLE_ FrntVsnClostPedBrkNwSt 10 "Active" 5 "Inactive" ;
VAL_TABLE_ LaneSnsLLnPosValid 1 "Invalid" 0 "Valid" ;
@@ -0,0 +1,13 @@
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
CM_ "honda_crv_ex_2017_body.dbc starts here"
BO_ 318291879 BSM_STATUS_RIGHT: 8 XXX
SG_ BSM_ALERT : 4|1@0+ (1,0) [0|1] "" XXX
SG_ BSM_MODE : 6|2@0+ (1,0) [0|3] "" XXX
BO_ 318291615 BSM_STATUS_LEFT: 8 XXX
SG_ BSM_ALERT : 4|1@0+ (1,0) [0|1] "" XXX
SG_ BSM_MODE : 6|2@0+ (1,0) [0|3] "" XXX
VAL_ 318291879 BSM_MODE 2 "blind_spot" 1 "cross_traffic" 0 "off";
VAL_ 318291615 BSM_MODE 2 "blind_spot" 1 "cross_traffic" 0 "off";
+178 -23
View File
@@ -191,8 +191,12 @@ BO_ 916 TCS13: 8 ESC
SG_ BrakeLight : 11|1@1+ (1.0,0.0) [0.0|1.0] "" CLU,EMS,SCC
SG_ DCEnable : 12|1@1+ (1.0,0.0) [0.0|1.0] "" EMS,SCC
SG_ AliveCounterTCS : 13|3@1+ (1.0,0.0) [0.0|7.0] "" EMS,SCC
SG_ ACCReqLim : 22|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,SCC
SG_ TQI_ACC : 24|8@1+ (0.390625,0.0) [0.0|99.609375] "%" EMS
SG_ Pre_TCS_CTL : 16|1@1+ (1.0,0.0) [0.0|1.0] "" Vector__XXX
SG_ EBA_ACK : 17|1@1+ (1.0,0.0) [0.0|1.0] "" Vector__XXX
SG_ FCA_ACK : 18|1@1+ (1.0,0.0) [0.0|1.0] "" Vector__XXX
SG_ DF_BF_STAT : 19|2@1+ (1.0,0.0) [0.0|3.0] "" BCW
SG_ SCCReqLim : 21|2@1+ (1.0,0.0) [0.0|3.0] "" SCC
SG_ TQI_SCC : 23|9@1+ (0.390625,0.0) [0.0|199.609375] "%" Vector__XXX
SG_ ACCEL_REF_ACC : 32|11@1+ (0.01,-10.23) [-10.23|10.24] "m/s^2" EMS,SCC
SG_ ACCEnable : 43|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,SCC
SG_ DriverOverride : 45|2@1+ (1.0,0.0) [0.0|3.0] "" EMS,SCC
@@ -448,6 +452,7 @@ BO_ 897 MDPS11: 8 MDPS
SG_ CF_Mdps_LKAS_FUNC : 58|1@1+ (1.0,0.0) [0.0|1.0] "flag" LDWS_LKAS
SG_ CF_Mdps_CurrMode : 59|2@1+ (1.0,0.0) [0.0|3.0] "" LDWS_LKAS
SG_ CF_Mdps_Type : 61|2@1+ (1.0,0.0) [0.0|2.0] "" LDWS_LKAS,SPAS
SG_ CF_MDPS_VSM_FUNC : 56|1@0+ (1.0,0.0) [0.0|1.0] "" XXX
BO_ 896 DI_BOX13: 8 DI_BOX
SG_ CF_DiBox_HPreInjVConfStat : 0|8@1+ (1.0,0.0) [0.0|255.0] "" EMS
@@ -961,7 +966,7 @@ BO_ 64 DATC14: 8 DATC
SG_ DATC_ADSDisp : 28|2@1+ (1.0,0.0) [0.0|3.0] "" CLU
BO_ 832 LKAS11: 8 LDWS_LKAS
SG_ CF_Lkas_Bca_R : 0|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,IBOX,PSB
SG_ CF_Lkas_LdwsActivemode : 0|2@1+ (1,0) [0|3] "" CLU,IBOX,PSB
SG_ CF_Lkas_LdwsSysState : 2|4@1+ (1.0,0.0) [0.0|15.0] "" CLU,IBOX,PSB
SG_ CF_Lkas_SysWarning : 6|4@1+ (1.0,0.0) [0.0|15.0] "" BCM,CLU
SG_ CF_Lkas_LdwsLHWarning : 10|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU,PSB
@@ -978,11 +983,11 @@ BO_ 832 LKAS11: 8 LDWS_LKAS
SG_ CF_Lkas_FcwSysState : 40|3@1+ (1.0,0.0) [0.0|7.0] "" CLU
SG_ CF_Lkas_FcwCollisionWarning : 43|2@1+ (1.0,0.0) [0.0|3.0] "" CLU
SG_ CF_Lkas_FusionState : 45|2@1+ (1.0,0.0) [0.0|3.0] "" SCC
SG_ CF_Lkas_Unknown1 : 47|1@1+ (1.0,0.0) [0.0|1.0] "" XXX
SG_ CF_Lkas_Chksum : 48|8@1+ (1.0,0.0) [0.0|255.0] "" MDPS
SG_ CF_Lkas_FcwOpt_USM : 56|3@1+ (1.0,0.0) [0.0|7.0] "" CLU
SG_ CF_Lkas_LdwsOpt_USM : 59|3@1+ (1.0,0.0) [0.0|7.0] "" CLU,MDPS
SG_ CF_Lkas_Unknown1 : 47|1@1+ (1,0) [0|3] "" XXX
SG_ CF_Lkas_Unknown2 : 63|2@0+ (1,0) [0|3] "" XXX
SG_ CF_Lkas_Unknown2 : 62|2@1+ (1.0,0.0) [0.0|1.0] "" XXX
BO_ 1342 LKAS12: 6 LDWS_LKAS
SG_ CF_Lkas_TsrSlifOpt : 10|2@1+ (1.0,0.0) [0.0|3.0] "" CLU
@@ -1037,6 +1042,7 @@ BO_ 1322 CLU15: 8 CLU
SG_ CF_Clu_HudFontSizeSet : 31|2@1+ (1.0,0.0) [0.0|3.0] "" HUD
SG_ CF_Clu_LanguageInfo : 33|5@1+ (1.0,0.0) [0.0|31.0] "" BCM,PGS
SG_ CF_Clu_ClusterSound : 38|1@1- (1.0,0.0) [0.0|0.0] "" BCM,CGW,FATC
SG_ CF_Clu_VehicleSpeed2 : 48|8@1+ (1,0) [0|255] "" XXX
BO_ 1066 _4WD13: 6 _4WD
SG_ _4WD_CURRENT : 0|8@1+ (0.390625,0.0) [-50.0|50.0] "A" TCU
@@ -1250,14 +1256,6 @@ BO_ 790 EMS11: 8 EMS
SG_ VS : 48|8@1+ (1.0,0.0) [0.0|254.0] "km/h" _4WD,AAF,ACU,AHLS,BCM,CLU,DATC,ECS,EPB,IBOX,LCA,LDWS_LKAS,LVR,MDPS,ODS,SCC,SMK,SPAS,TCU,TPMS
SG_ RATIO_TQI_BAS_MAX_STND : 56|8@1+ (0.0078,0.0) [0.0|2.0] "" _4WD,IBOX,TCU
BO_ 881 E_EMS11: 8 XXX
SG_ Cruise_Limit_Status : 13|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Limit_Target : 23|8@1+ (1,0) [0|15] "" XXX
SG_ Gear_Change : 12|1@0+ (1,0) [0|31] "" XXX
SG_ IG_Reactive_Stat : 8|3@1+ (1,0) [0|3] "" XXX
SG_ Brake_Pedal_Pos : 0|8@1+ (1,0) [0|127] "" XXX
SG_ Accel_Pedal_Pos : 31|8@1+ (1,0) [0|7] "" XXX
BO_ 1301 CLU14: 8 CLU
SG_ CF_Clu_ADrUNValueSet : 0|3@1+ (1.0,0.0) [0.0|7.0] "" BCM
SG_ CF_Clu_ADrLNValueSet : 3|3@1+ (1.0,0.0) [0.0|7.0] "" BCM
@@ -1380,6 +1378,7 @@ BO_ 1290 SCC13: 8 SCC
SG_ SCCDrvModeRValue : 0|3@1+ (1,0) [0|7] "" CLU
SG_ SCC_Equip : 3|1@1+ (1,0) [0|1] "" ESC
SG_ AebDrvSetStatus : 4|3@1+ (1,0) [0|7] "" CLU,ESC
SG_ Lead_Veh_Dep_Alert_USM : 13|2@0+ (1,0) [0|3] "" XXX
BO_ 1287 TCS15: 4 ESC
SG_ ABS_W_LAMP : 0|1@1+ (1.0,0.0) [0.0|1.0] "" _4WD,CLU,CUBIS,IBOX
@@ -1451,6 +1450,18 @@ BO_ 909 FCA11: 8 FCA
SG_ Supplemental_Counter : 35|4@1+ (1,0) [0|15] "" XXX
SG_ PAINT1_Status : 16|2@1+ (1,0) [0|1] "" XXX
BO_ 1156 HDA11_MFC: 8 XXX
SG_ Counter : 5|4@0+ (1,0) [0|15] "" XXX
SG_ NEW_SIGNAL_1 : 1|2@0+ (1,0) [0|255] "" XXX
SG_ NEW_SIGNAL_2 : 7|2@0+ (1,0) [0|3] "" XXX
SG_ NEW_SIGNAL_3 : 15|8@0+ (1,0) [0|255] "" XXX
SG_ NEW_SIGNAL_4 : 16|2@1+ (1,0) [0|3] "" XXX
SG_ NEW_SIGNAL_5 : 18|14@1+ (1,0) [0|63] "" XXX
SG_ NEW_SIGNAL_6 : 33|2@0+ (1,0) [0|1] "" XXX
SG_ NEW_SIGNAL_7 : 34|14@1+ (1,0) [0|16383] "" XXX
SG_ NEW_SIGNAL_8 : 49|2@0+ (1,0) [0|1] "" XXX
SG_ NEW_SIGNAL_9 : 50|14@1- (1,-4095) [0|16383] "" XXX
BO_ 1155 FCA12: 8 FCA
SG_ FCA_USM : 0|3@1+ (1,0) [0|7] "" CGW,CLU,ESC
SG_ FCA_DrvSetState : 3|3@1+ (1,0) [0|7] "" CGW
@@ -1459,22 +1470,166 @@ BO_ 1186 FRT_RADAR11: 2 FCA
SG_ CF_FCA_Equip_Front_Radar : 0|3@1+ (1,0) [0|7] "" LDWS_LKAS,LDW_LKA,ESC
BO_ 905 SCC14: 8 SCC
SG_ ComfortBandLower : 6|6@1+ (1,0) [0|0] "" Vector__XXX
SG_ ComfortBandUpper : 0|6@1+ (1,0) [0|0] "" Vector__XXX
SG_ JerkLowerLimit : 19|7@1+ (1,0) [0|0] "" Vector__XXX
SG_ JerkUpperLimit : 12|7@1+ (0.1,0) [0|0] "" Vector__XXX
SG_ ComfortBandUpper : 0|6@1+ (0.0986,-4.14) [0|1.26] "m/s^2" ESC
SG_ ComfortBandLower : 6|6@1+ (0.0986,-4.14) [0|1.26] "m/s^2" ESC
SG_ JerkUpperLimit : 12|7@1+ (1,0) [0|12.7] "m/s^3" ESC
SG_ JerkLowerLimit : 19|7@1+ (0.1,0) [0|12.7] "m/s^3" ESC
SG_ ACCMode : 32|3@1+ (1,0) [0|7] "" CLU,HUD,LDWS_LKAS,ESC
SG_ ObjGap : 56|8@1+ (1,0) [0|255] "" CLU,HUD,ESC
BO_ 882 ELECT_GEAR: 8 XXX
SG_ Elect_Gear_Shifter : 16|3@1+ (1,0) [0|7] "" CLU
BO_ 1157 LFAHDA_MFC: 4 XXX
SG_ LFA_USM : 28|2@1+ (1,0) [0|3] "" XXX
SG_ LFA_SysWarning : 16|2@1+ (1,0) [0|3] "" XXX
SG_ ACTIVE2 : 4|2@0+ (1,0) [0|3] "" XXX
SG_ HDA_USM : 0|2@1+ (1,0) [0|3] "" XXX
SG_ ACTIVE2 : 4|2@0+ (1,0) [0|3] "" XXX
SG_ LFA_SysWarning : 16|2@1+ (1,0) [0|3] "" XXX
SG_ ACTIVE : 25|1@1+ (1,0) [0|3] "" XXX
SG_ LFA_USM : 28|2@1+ (1,0) [0|3] "" XXX
BO_ 913 BCM_PO_11: 8 Vector__XXX
SG_ BCM_Door_Dri_Status : 5|1@0+ (1,0) [0|1] "" PT_ESC_ABS
SG_ BCM_Shift_R_MT_SW_Status : 39|2@0+ (1,0) [0|3] "" PT_ESC_ABS
BO_ 1426 LABEL11: 8 XXX
SG_ CC_React : 34|1@1+ (1,0) [0|1] "" XXX
BO_ 910 WHL_SPD12_FS: 5 iBAU
SG_ CRC : 0|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ WHL_SPD12_AliveCounter : 8|4@1+ (1,0) [0|15] "" Vector__XXX
SG_ WHL_SPD_FL : 12|14@1+ (0.03125,0) [0|511.96875] "km/h" Vector__XXX
SG_ WHL_SPD_FR : 26|14@1+ (0.03125,0) [0|511.96875] "km/h" Vector__XXX
BO_ 911 WHL_SPD13_FS: 5 iBAU
SG_ CRC : 0|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ WHL_SPD13_AliveCounter : 8|4@1+ (1,0) [0|15] "" Vector__XXX
SG_ WHL_SPD_RL : 12|14@1+ (0.03125,0) [0|511.96875] "km/h" Vector__XXX
SG_ WHL_SPD_RR : 26|14@1+ (0.03125,0) [0|511.96875] "km/h" Vector__XXX
BO_ 865 ADAS_PRK_11: 8 ADAS_PRK
SG_ CF_PCA_BrkReq : 24|1@1+ (1,0) [0|0] "" Vector__XXX
SG_ CF_PCA_DclTrgtVal : 28|4@1+ (0.04,0) [0|0] "g" Vector__XXX
SG_ PCA_ALIVE_CNT : 40|4@1+ (1,0) [0|0] "" Vector__XXX
SG_ PCA_CHECK_SUM : 48|8@1+ (1,0) [0|0] "" Vector__XXX
BO_ 882 ELECT_GEAR: 8 XXX
SG_ Elect_Gear_Shifter : 16|4@1+ (1,0) [0|7] "" CLU
BO_ 881 E_EMS11: 8 XXX
SG_ Brake_Pedal_Pos : 0|8@1+ (1,0) [0|127] "" XXX
SG_ IG_Reactive_Stat : 8|3@1+ (1,0) [0|3] "" XXX
SG_ Gear_Change : 12|1@0+ (1,0) [0|31] "" XXX
SG_ Cruise_Limit_Status : 13|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Limit_Target : 23|8@1+ (1,0) [0|15] "" XXX
SG_ Accel_Pedal_Pos : 31|8@1+ (1,0) [0|7] "" XXX
BO_ 1355 EV_PC6: 8 CGW
SG_ CF_Vcu_SbwWarnMsg : 16|3@1+ (1,0) [0|7] "" Vector__XXX
BO_ 1430 EV_PC2: 8 CGW
SG_ CR_Ldc_ActVol_LS_V : 32|8@1+ (0.1,0) [0|0] "V" Vector__XXX
BO_ 1535 EV_PC10: 8 CGW
SG_ CF_Vcu_EpbRequest : 37|1@1+ (1,0) [0|0] "" Vector__XXX
BO_ 908 RSPA11: 8 RSPA
SG_ CF_RSPA_State : 0|4@1+ (1,0) [0|15] "" XXX
SG_ CF_RSPA_Act : 4|2@1+ (1,0) [0|3] "" XXX
SG_ CF_RSPA_DecCmd : 6|2@1+ (1,0) [0|3] "" XXX
SG_ CF_RSPA_Trgt_Spd : 8|10@1+ (0.01,0) [0|10.23] "km/h" XXX
SG_ CF_RSPA_StopReq : 18|1@1+ (1,0) [0|2] "" XXX
SG_ CR_RSPA_EPB_Req : 22|2@1+ (1,0) [0|3] "" XXX
SG_ CF_RSPA_ACC_ACT : 50|1@1+ (1,0) [0|2] "" XXX
SG_ CF_RSPA_AliveCounter : 52|4@1+ (1,0) [0|15] "" XXX
SG_ CF_RSPA_CRC : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 914 S_MDPS11: 8 XXX
SG_ CF_Mdps_Stat : 0|4@1+ (1,0) [0|15] "" XXX
SG_ CR_Mdps_DrvTq : 8|12@1+ (1,0) [0|15] "" XXX
SG_ CR_Mdps_StrAng : 24|16@1- (1,0) [0|65535] "" XXX
SG_ CF_Mdps_AliveCnt : 47|8@0+ (1,0) [0|255] "" XXX
SG_ CF_Mdps_Chksum : 63|8@0+ (1,0) [0|255] "" XXX
BO_ 357 S_MDPS12: 8 XXX
SG_ NEW_SIGNAL_1 : 0|12@1+ (1,0) [0|4095] "" XXX
SG_ NEW_SIGNAL_2 : 12|12@1+ (1,0) [0|4095] "" XXX
SG_ Counter : 48|4@1+ (1,0) [0|15] "" XXX
SG_ Checksum : 63|8@0+ (1,0) [0|255] "" XXX
BO_ 352 AHB1: 8 iBAU
SG_ CF_Ahb_SLmp : 0|2@1+ (1,0) [0|3] "" CLU
SG_ CF_Ahb_Def : 2|2@1+ (1,0) [0|3] "" CGW
SG_ CF_Ahb_Act : 4|2@1+ (1,0) [0|3] "" Vector__XXX
SG_ CF_Ahb_Diag : 6|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ CF_Ahb_WLmp : 7|1@1+ (1,0) [0|1] "" CLU
SG_ CR_Ahb_StDep_mm : 8|16@1- (0.1,0) [-3276.8|3276.7] "mm" Vector__XXX
SG_ CF_Ahb_SnsFail : 24|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ CF_Ahb_PedalCalStat : 25|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ CF_Ahb_Bzzr : 26|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ CF_Ahb_ChkSum : 56|8@1+ (1,0) [0|255] "" Vector__XXX
BO_ 1191 4a7MFC: 8 XXX
SG_ PAINT1 : 0|1@0+ (1,0) [0|1] "" XXX
BO_ 1162 BCA11: 8 BCW
SG_ CF_BCA_State : 16|3@1+ (1,0) [0|7] "" CLU,iBAU
SG_ CF_BCA_Warning : 19|2@1+ (1,0) [0|3] "" CLU,iBAU
SG_ AliveCounter : 21|4@1+ (1,0) [0|15] "" CLU,iBAU
SG_ RCCA_Brake_Command : 29|1@1+ (1,0) [0|1] "" iBAU
SG_ Check_Sum : 56|8@1+ (1,0) [0|16] "" iBAU
BO_ 1136 P_STS: 6 CGW
SG_ HCU1_STS : 6|2@1+ (1,0) [0|3] "" BCW,EPB,FCA,MDPS,SCC,iBAU
SG_ HCU5_STS : 8|2@1+ (1,0) [0|3] "" EPB,FCA,MDPS,iBAU
BO_ 304 YRS11: 8 ACU
SG_ CR_Yrs_Yr : 0|16@1+ (0.005,-163.84) [-163.84|163.83] "deg/s" CGW,iBAU
SG_ CR_Yrs_LatAc : 16|16@1+ (0.000127465,-4.17677312) [-4.17677312|4.17651819] "g" iBAU
SG_ CF_Yrs_YrStat : 32|4@1+ (1,0) [0|15] "" iBAU
SG_ CF_Yrs_LatAcStat : 36|4@1+ (1,0) [0|15] "" iBAU
SG_ CF_Yrs_MCUStat : 40|4@1+ (1,0) [0|15] "" iBAU
SG_ CR_Yrs_MsgCnt1 : 48|4@1+ (1,0) [0|15] "" iBAU
SG_ CR_Yrs_Crc1 : 56|8@1+ (1,0) [0|255] "" iBAU
BO_ 320 YRS12: 8 ACU
SG_ CF_Yrs_LongAcStat : 16|4@1+ (1,0) [0|15] "" iBAU
SG_ CF_IMU_ResetStat : 20|4@1+ (1,0) [0|15] "" iBAU
SG_ YRS_Temp : 24|8@1+ (1,-68) [-68|187] "" iBAU
SG_ YRS_TempStat : 32|4@1+ (1,0) [0|15] "" iBAU
SG_ CF_Yrs_Type : 36|4@1+ (1,0) [0|15] "" iBAU
SG_ CR_Yrs_MsgCnt2 : 48|4@1+ (1,0) [0|15] "" iBAU
SG_ CR_Yrs_Crc2 : 56|8@1+ (1,0) [0|255] "" iBAU
SG_ CR_Yrs_LongAc : 0|16@1+ (0.000127465,-4.17677312) [-4.17677312|4.17651819] "g" CGW,iBAU
BO_ 1173 YRS13: 8 ACU
SG_ YRS_SeralNo : 16|48@1+ (1,0) [0|281474976710655] "" iBAU
BO_ 870 366_EMS: 8 EMS
SG_ N : 7|16@0+ (1,0.25) [0|16383.75] "rpm" XXX
SG_ EMS_Related : 23|16@0+ (1,0) [0|65535] "" XXX
SG_ TQFR : 39|8@0+ (0.390625,0) [0|99.6094] "%" XXX
SG_ VS : 40|8@1+ (1,0) [0|255] "km/h" MDPS
SG_ SWI_IGK : 48|1@0+ (1,0) [0|1] "" XXX
BO_ 854 356: 8 XXX
SG_ PAINT1 : 32|1@0+ (1,0) [0|1] "" XXX
SG_ PAINT2 : 34|2@0+ (1,0) [0|1] "" XXX
SG_ PAINT3 : 36|2@0+ (1,0) [0|3] "" XXX
SG_ PAINT4 : 38|1@0+ (1,0) [0|1] "" XXX
BO_ 1042 ICM_412h: 8 ICM
SG_ T_Outside_input : 0|9@0+ (0.01,0) [0|5] "V" Vector__XXX
SG_ WarningSoundOutput_1Group : 5|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ WarningSoundOutput_2Group : 6|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ WarningSoundOutput_3Group : 7|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ TRIP_A_DT_Display_clock : 22|7@0+ (1,0) [0|99] "clock" Vector__XXX
SG_ TRIP_A_DT_Display_minute : 29|6@0+ (1,0) [0|59] "minute" Vector__XXX
SG_ TRIP_B_DT_Display_clock : 38|7@0+ (1,0) [0|99] "clock" Vector__XXX
SG_ TRIP_B_DT_Display_minute : 45|6@0+ (1,0) [0|59] "minute" Vector__XXX
SG_ PopupMessageOutput_1Level : 48|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ PopupMessageOutput_2Level : 49|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ PopupMessageOutput_3Level : 50|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ PopupMessageOutput_4Level : 51|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ PopupMessageOutput_5Level : 52|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ PopupMessageOutput_6Level : 53|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ PopupMessageOutput_7Level : 54|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ PopupMessageOutput_8Level : 55|1@0+ (1,0) [0|1] "" Vector__XXX
VAL_ 909 CF_VSM_Warn 2 "FCW" 3 "AEB";
+1 -1
View File
@@ -311,7 +311,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
+1 -1
View File
@@ -311,7 +311,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
+1 -1
View File
@@ -311,7 +311,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
+1 -1
View File
@@ -311,7 +311,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
@@ -311,7 +311,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
+258
View File
@@ -0,0 +1,258 @@
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
CM_ "Imported file _subaru_preglobal_2015.dbc starts here"
VERSION ""
NS_ :
NS_DESC_
CM_
BA_DEF_
BA_
VAL_
CAT_DEF_
CAT_
FILTER
BA_DEF_DEF_
EV_DATA_
ENVVAR_DATA_
SGTYPE_
SGTYPE_VAL_
BA_DEF_SGTYPE_
BA_SGTYPE_
SIG_TYPE_REF_
VAL_TABLE_
SIG_GROUP_
SIG_VALTYPE_
SIGTYPE_VALTYPE_
BO_TX_BU_
BA_DEF_REL_
BA_REL_
BA_DEF_DEF_REL_
BU_SG_REL_
BU_EV_REL_
BU_BO_REL_
SG_MUL_VAL_
BS_:
BU_: XXX X
BO_ 2 Steering: 8 XXX
SG_ Steering_Angle : 7|16@0- (0.1,0) [-500|500] "degree" XXX
SG_ Counter : 27|3@0+ (1,0) [0|7] "" XXX
SG_ Checksum : 39|8@0+ (1,0) [0|255] "" XXX
BO_ 208 G_Sensor: 8 XXX
SG_ Steering_Angle : 0|16@1- (-0.1,0) [-500|500] "" XXX
SG_ Lateral : 16|16@1- (-0.0035,1) [-255|255] "" XXX
SG_ Longitudinal : 48|16@1- (-0.00035,0) [-255|255] "" XXX
BO_ 209 Brake_Pedal: 8 XXX
SG_ Speed : 0|16@1+ (0.05625,0) [0|255] "KPH" XXX
SG_ Brake_Pedal : 16|8@1+ (1,0) [0|255] "" XXX
BO_ 210 Brake_2: 8 XXX
SG_ Brake_Light : 35|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_Related : 36|1@1+ (1,0) [0|1] "" XXX
SG_ Right_Brake : 48|8@1+ (1,0) [0|255] "" XXX
SG_ Left_Brake : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 211 Brake_Type: 8 XXX
SG_ Brake_Light : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Speed_Counter : 32|8@1+ (1,0) [0|255] "" XXX
SG_ Brake_Cruise_On : 42|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_Pedal_On : 46|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 48|8@1+ (1,0) [0|255] "" XXX
BO_ 212 Wheel_Speeds: 8 XXX
SG_ FL : 0|16@1+ (0.0592,0) [0|255] "KPH" XXX
SG_ FR : 16|16@1+ (0.0592,0) [0|255] "KPH" XXX
SG_ RL : 32|16@1+ (0.0592,0) [0|255] "KPH" XXX
SG_ RR : 48|16@1+ (0.0592,0) [0|255] "KPH" XXX
BO_ 320 Throttle: 8 XXX
SG_ Throttle_Pedal : 0|8@1+ (0.392157,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Not_Full_Throttle : 14|1@1+ (1,0) [0|1] "" XXX
SG_ Engine_RPM : 16|14@1+ (1,0) [0|32767] "" XXX
SG_ Off_Throttle : 30|1@1+ (1,0) [0|1] "" XXX
SG_ Throttle_Cruise : 32|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Combo : 40|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Body : 48|8@1+ (1,0) [0|255] "" XXX
SG_ Off_Throttle_2 : 56|1@1+ (1,0) [0|1] "" XXX
BO_ 321 Engine: 8 XXX
SG_ Engine_Torque : 0|15@1+ (1,0) [0|255] "" XXX
SG_ Engine_Stop : 15|1@1+ (1,0) [0|1] "" XXX
SG_ Wheel_Torque : 16|12@1+ (1,0) [0|4095] "" XXX
SG_ Engine_RPM : 32|12@1+ (1,0) [0|8191] "" XXX
BO_ 324 CruiseControl: 8 XXX
SG_ OnOffButton : 2|1@1+ (1,0) [0|1] "" XXX
SG_ SET_BUTTON : 3|1@1+ (1,0) [0|1] "" XXX
SG_ RES_BUTTON : 4|1@1+ (1,0) [0|1] "" XXX
SG_ Button : 13|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_On : 48|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 49|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_Pedal_On : 51|1@1+ (1,0) [0|1] "" XXX
BO_ 328 Transmission: 8 XXX
SG_ Manual_Gear : 4|4@1+ (1,0) [0|15] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Transmission_Engine : 16|15@1+ (1,0) [0|65535] "" XXX
SG_ Gear : 48|4@1+ (1,0) [0|15] "" XXX
SG_ Gear_2 : 52|4@1+ (1,0) [0|15] "" XXX
SG_ Paddle_Shift : 60|2@1+ (1,0) [0|3] "" XXX
BO_ 329 CVT_Ratio: 8 XXX
BO_ 336 Brake_Pressure: 8 XXX
SG_ Brake_Pressure_Right : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Brake_Pressure_Left : 8|8@1+ (1,0) [0|255] "" XXX
BO_ 338 Stalk: 8 XXX
SG_ Counter : 12|4@1+ (1,0) [0|15] "" XXX
SG_ Brake_Light : 52|1@1+ (1,0) [0|1] "" XXX
SG_ Runlights : 58|1@1+ (1,0) [0|1] "" XXX
SG_ Headlights : 59|1@1+ (1,0) [0|1] "" XXX
SG_ Highbeam : 60|1@1+ (1,0) [0|1] "" XXX
SG_ Wiper : 62|1@1+ (1,0) [0|1] "" XXX
BO_ 352 ES_Brake: 8 XXX
SG_ Brake_Pressure : 0|16@1+ (1,0) [0|255] "" XXX
SG_ Brake_Light : 20|1@1+ (1,0) [0|1] "" XXX
SG_ ES_Error : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_On : 22|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 23|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 48|3@1+ (1,0) [0|7] "" XXX
SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 353 ES_CruiseThrottle: 8 XXX
SG_ Throttle_Cruise : 0|12@1+ (1,0) [0|4095] "" XXX
SG_ Signal1 : 12|4@1+ (1,0) [0|15] "" XXX
SG_ Cruise_Activated : 16|1@1+ (1,0) [0|1] "" XXX
SG_ Signal2 : 17|3@1+ (1,0) [0|7] "" XXX
SG_ Brake_On : 20|1@1+ (1,0) [0|1] "" XXX
SG_ DistanceSwap : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Standstill : 22|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 23|1@1+ (1,0) [0|1] "" XXX
SG_ CloseDistance : 24|8@1+ (0.0196,0) [0|255] "m" XXX
SG_ Signal4 : 32|9@1+ (1,0) [0|255] "" XXX
SG_ Standstill_2 : 41|1@1+ (1,0) [0|1] "" XXX
SG_ ES_Error : 42|1@1+ (1,0) [0|1] "" XXX
SG_ Signal5 : 43|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 44|3@1+ (1,0) [0|7] "" XXX
SG_ Signal6 : 47|1@1+ (1,0) [0|1] "" XXX
SG_ Button : 48|3@1+ (1,0) [0|7] "" XXX
SG_ Signal7 : 51|5@1+ (1,0) [0|31] "" XXX
SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 354 ES_RPM: 8 XXX
SG_ Brake : 8|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 9|1@1+ (1,0) [0|1] "" XXX
SG_ RPM : 16|16@1+ (1,0) [0|65535] "" XXX
SG_ Checksum : 32|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 48|3@1+ (1,0) [0|7] "" XXX
BO_ 356 ES_LKAS: 8 XXX
SG_ Counter : 0|3@1+ (1,0) [0|7] "" XXX
SG_ LKAS_Command : 8|13@1- (-1,0) [-4096|4096] "" XXX
SG_ LKAS_Active : 24|1@1+ (1,0) [0|1] "" XXX
SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 359 ES_LDW: 8 XXX
SG_ All_depart_2015 : 0|1@1+ (1,0) [0|1] "" XXX
SG_ Right_Line_2017 : 24|1@1+ (1,0) [0|1] "" XXX
SG_ Left_Line_2017 : 25|1@1+ (1,0) [0|1] "" XXX
SG_ Sig1All_Depart : 28|1@1+ (1,0) [0|1] "" XXX
SG_ Sig2All_Depart : 31|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_Inactive_2017 : 36|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_Active : 37|1@1+ (1,0) [0|1] "" XXX
SG_ Sig1Right_Depart : 48|1@1+ (1,0) [0|1] "" XXX
SG_ Sig1Right_Depart_Front : 49|1@1+ (1,0) [0|1] "" XXX
SG_ Sig2Right_Depart : 50|1@1+ (1,0) [0|1] "" XXX
SG_ Left_Depart_Front : 51|1@1+ (1,0) [0|1] "" XXX
SG_ Sig3All_Depart : 52|1@1+ (1,0) [0|1] "" XXX
BO_ 604 BSD_RCTA: 8 XXX
SG_ Counter : 0|3@1+ (1,0) [0|7] "" XXX
SG_ State : 5|1@1+ (1,0) [0|1] "" XXX
SG_ R_ADJACENT : 32|1@1+ (1,0) [0|1] "" XXX
SG_ L_ADJACENT : 33|1@1+ (1,0) [0|1] "" XXX
SG_ R_APPROACHING : 42|1@1+ (1,0) [0|1] "" XXX
SG_ L_APPROACHING : 43|1@1+ (1,0) [0|1] "" XXX
SG_ R_RCTA : 46|1@1+ (1,0) [0|1] "" XXX
SG_ L_RCTA : 47|1@1+ (1,0) [0|1] "" XXX
BO_ 642 Dashlights: 8 XXX
SG_ Counter : 12|4@1+ (1,0) [0|15] "" XXX
SG_ SEATBELT_FL : 40|1@1+ (1,0) [0|1] "" XXX
SG_ LEFT_BLINKER : 44|1@1+ (1,0) [0|1] "" XXX
SG_ RIGHT_BLINKER : 45|1@1+ (1,0) [0|1] "" XXX
BO_ 880 Steering_Torque_2: 8 XXX
SG_ Steering_Voltage_Flat : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Steer_Torque_Sensor : 29|11@1- (-1,0) [-1000|1000] "" XXX
SG_ Counter : 40|4@1+ (1,0) [0|15] "" XXX
BO_ 884 BodyInfo: 8 XXX
SG_ DOOR_OPEN_FR : 24|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 25|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 26|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RR : 27|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_Hatch : 28|1@1+ (1,0) [0|1] "" XXX
BO_ 864 Engine_Temp: 8 XXX
SG_ Oil_Temp : 16|8@1+ (1,-40) [0|255] "" XXX
SG_ Coolant_Temp : 24|8@1+ (1,-40) [0|255] "" XXX
SG_ Cruise_Activated : 45|1@1+ (1,0) [0|1] "" XXX
SG_ Saved_Speed : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 866 Fuel: 8 XXX
BO_ 1745 Dash_State: 8 XXX
SG_ Units : 15|1@1+ (1,0) [0|1] "" XXX
CM_ SG_ 320 Off_Throttle_2 "Less sensitive";
CM_ SG_ 320 Throttle_Body "Throttle related";
CM_ SG_ 328 Gear "15 = P, 14 = R, 0 = N, 1-6=gear";
CM_ SG_ 328 Gear_2 "15 = P, 14 = R, 0 = N, 1-6=gear";
CM_ SG_ 353 Button "1 = main, 2 = set shallow, 3 = set deep, 4 = resume shallow, 5 resume deep";
CM_ SG_ 354 RPM "20hz version of Transmission_Engine under Transmission";
CM_ SG_ 359 Sig1Right_Depart "right depart, hill steep and seatbelt disengage";
CM_ SG_ 359 LKAS_Inactive_2017 "1 when not steering, 0 when lkas steering";
CM_ SG_ 359 Sig1Right_Depart_Front "object in front, right depart, hill steep and seatbelt disengage alert ";
CM_ SG_ 359 Left_Depart_Front "warning after acceleration into car in front and left depart";
CM_ SG_ 359 Sig1All_Depart "Left and right depart";
CM_ SG_ 359 Sig2All_Depart "Left and right depart";
CM_ SG_ 359 All_depart_2015 "always 1 on 2017";
CM_ SG_ 604 R_APPROACHING "Faster car approaching in far right lane";
CM_ SG_ 604 L_APPROACHING "Faster car approaching in far left lane";
CM_ SG_ 604 R_RCTA "Rear cross traffic alert, only when in R gear";
CM_ SG_ 604 L_RCTA "Rear cross traffic alert, only when in R gear";
CM_ SG_ 642 Counter "Affected by signals";
CM_ SG_ 642 SEATBELT_FL "Driver seatbelt";
CM_ SG_ 880 Steering_Voltage_Flat "receives later than 371";
VAL_ 328 Gear 0 "N" 1 "D" 2 "D" 3 "D" 4 "D" 5 "D" 6 "D" 14 "R" 15 "P";
VAL_ 1745 Units 0 "Metric" 1 "Imperial";
CM_ "subaru_forester_2017.dbc starts here"
BO_ 355 ES_DashStatus: 8 XXX
SG_ Not_Ready_Startup : 4|2@1+ (1,0) [0|3] "" XXX
SG_ Cruise_On : 16|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Set_Speed : 24|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 40|3@1+ (1,0) [0|7] "" XXX
SG_ Cruise_Activated : 54|1@1+ (1,0) [0|1] "" XXX
BO_ 881 Steering_Torque: 8 XXX
SG_ Steering_Motor_Flat : 0|10@1+ (32,0) [0|1000] "" XXX
SG_ Steer_Torque_Output : 16|11@1- (-32,0) [-1000|1000] "" XXX
SG_ LKA_Lockout : 27|1@1+ (1,0) [0|1] "" XXX
SG_ Steer_Torque_Sensor : 29|11@1- (-1,0) [-1000|1000] "" XXX
SG_ Steering_Angle : 40|16@1- (-0.033,0) [-600|600] "" XXX
-209
View File
@@ -1,209 +0,0 @@
VERSION ""
NS_ :
NS_DESC_
CM_
BA_DEF_
BA_
VAL_
CAT_DEF_
CAT_
FILTER
BA_DEF_DEF_
EV_DATA_
ENVVAR_DATA_
SGTYPE_
SGTYPE_VAL_
BA_DEF_SGTYPE_
BA_SGTYPE_
SIG_TYPE_REF_
VAL_TABLE_
SIG_GROUP_
SIG_VALTYPE_
SIGTYPE_VALTYPE_
BO_TX_BU_
BA_DEF_REL_
BA_REL_
BA_DEF_DEF_REL_
BU_SG_REL_
BU_EV_REL_
BU_BO_REL_
SG_MUL_VAL_
BS_:
BU_: XXX X
BO_ 2 Steering: 8 XXX
SG_ Steering_Angle : 7|16@0- (0.1,0) [0|65535] "" XXX
SG_ Counter : 25|3@1+ (1,0) [0|7] "" XXX
SG_ CHECKSUM : 32|8@1+ (1,0) [0|255] "" XXX
BO_ 64 Throttle: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|255] "" XXX
SG_ Engine_RPM : 16|12@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Pedal : 32|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Cruise : 40|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Combo : 48|8@1+ (1,0) [0|255] "" XXX
SG_ Off_Accel : 60|4@1+ (1,0) [0|7] "" XXX
BO_ 72 Transmission: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Gear : 24|8@1+ (1,0) [0|255] "" XXX
BO_ 326 Cruise_Buttons: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Signal1 : 12|30@1+ (1,0) [0|1073741823] "" XXX
SG_ Main : 42|1@1+ (1,0) [0|1] "" XXX
SG_ set : 43|1@1+ (1,0) [0|1] "" XXX
SG_ Resume : 44|1@1+ (1,0) [0|1] "" XXX
SG_ Signal2 : 45|19@1+ (1,0) [0|524287] "" XXX
BO_ 315 G_Sensor: 8 XXX
SG_ Lateral : 48|8@1- (-0.1,0) [0|255] "m/s2" XXX
SG_ Longitudinal : 56|8@1- (-0.1,0) [0|255] "m/s2" XXX
BO_ 314 Wheel_Speeds: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ FR : 12|13@1+ (0.057,0) [0|255] "kph" XXX
SG_ RR : 25|13@1+ (0.057,0) [0|255] "kph" XXX
SG_ FL : 51|13@1+ (0.057,0) [0|255] "kph" XXX
SG_ RL : 38|13@1+ (0.057,0) [0|255] "kph" XXX
BO_ 281 Steering_Torque: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|3] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Steer_Error_1 : 12|1@0+ (1,0) [0|1] "" XXX
SG_ Steer_Torque_Sensor : 16|11@1- (-1,0) [0|3] "" XXX
SG_ Steer_Error_2 : 28|1@1+ (1,0) [0|1] "" XXX
SG_ Steer_Warning : 29|1@1+ (1,0) [0|1] "" XXX
SG_ Steering_Angle : 32|16@1- (-0.0217,0) [0|255] "" X
SG_ Steer_Torque_Output : 48|11@1- (-1,0) [0|31] "" XXX
BO_ 312 Brake_Pressure_L_R: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|31] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|3] "" XXX
SG_ Brake_1 : 48|8@1+ (1,0) [0|255] "" XXX
SG_ Brake_2 : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 313 Brake_Pedal: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Brake_Pedal_On : 34|1@1+ (1,0) [0|7] "" XXX
SG_ Brake_Pedal : 36|12@1+ (1,0) [0|65535] "" XXX
BO_ 290 ES_LKAS: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ SET_1 : 12|1@0+ (1,0) [0|3] "" XXX
SG_ LKAS_Output : 16|13@1- (-1,0) [0|3] "" XXX
SG_ LKAS_Request : 29|1@0+ (1,0) [0|3] "" XXX
BO_ 544 ES_Brake: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Brake_Pressure : 16|16@1+ (1,0) [0|255] "" XXX
SG_ __Status : 36|4@1+ (1,0) [0|63] "" XXX
BO_ 545 ES_Distance: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Signal1 : 12|20@1+ (1,0) [0|15] "" XXX
SG_ Signal2 : 32|24@1+ (1,0) [0|15] "" XXX
SG_ Main : 56|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 57|7@1+ (1,0) [0|1] "" XXX
BO_ 546 ES_Status: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ RPM : 16|12@1+ (1,0) [0|255] "" XXX
SG_ Cruise_Activated : 29|1@0+ (1,0) [0|3] "" XXX
SG_ Cruise_Brake : 30|1@1+ (1,0) [0|3] "" XXX
BO_ 576 CruiseControl: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Cruise_On : 40|1@1+ (1,0) [0|3] "" XXX
SG_ Cruise_Activated : 41|1@1+ (1,0) [0|3] "" XXX
BO_ 552 BSD_RCTA: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ R_ADJACENT : 48|1@1+ (1,0) [0|1] "" XXX
SG_ L_ADJACENT : 49|1@1+ (1,0) [0|1] "" XXX
SG_ R_APPROACHING : 58|1@1+ (1,0) [0|1] "" XXX
SG_ L_APPROACHING : 59|1@1+ (1,0) [0|1] "" XXX
BO_ 912 Dashlights: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ SEATBELT_FL : 48|1@1+ (1,0) [0|1] "" XXX
SG_ LEFT_BLINKER : 50|1@1+ (1,0) [0|3] "" XXX
SG_ RIGHT_BLINKER : 51|1@1+ (1,0) [0|1] "" XXX
BO_ 940 BodyInfo: 8 XXX
SG_ DOOR_OPEN_FL : 32|1@1+ (1,0) [0|255] "" XXX
SG_ DOOR_OPEN_FR : 33|1@1+ (1,0) [0|3] "" XXX
SG_ DOOR_OPEN_RL : 34|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RR : 35|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_TRUNK : 36|1@0+ (1,0) [0|1] "" XXX
SG_ DASH_BTN_LIGHTS : 56|1@0+ (1,0) [0|1] "" XXX
SG_ Lowbeam : 57|1@1+ (1,0) [0|3] "" XXX
SG_ Highbeam : 58|1@1+ (1,0) [0|1] "" XXX
SG_ FOG_LIGHTS2 : 60|1@1+ (1,0) [0|1] "" XXX
SG_ WIPERS : 62|1@0+ (1,0) [0|1] "" XXX
BO_ 801 ES_DashStatus: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|7] "" XXX
SG_ Cruise_Distance : 28|3@1+ (1,0) [0|3] "" XXX
SG_ Cruise_Disengaged : 35|1@1+ (1,0) [0|3] "" XXX
SG_ Cruise_Activated : 36|1@1+ (1,0) [0|3] "" XXX
SG_ Cruise_Set_Speed : 40|8@1+ (1,0) [0|255] "" XXX
SG_ Cruise_Fault : 48|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_Pedal : 51|1@1+ (1,0) [0|3] "" XXX
SG_ Car_Follow : 52|1@1+ (1,0) [0|3] "" XXX
SG_ Far_Distance : 56|4@1+ (1,0) [0|15] "" XXX
SG_ Cruise_State : 60|4@1+ (1,0) [0|15] "" XXX
BO_ 802 ES_LKAS_State: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Keep_Hands_On_Wheel : 12|1@1+ (1,0) [0|1] "" XXX
SG_ Empty_Box : 13|1@1+ (1,0) [0|1] "" XXX
SG_ Signal1 : 14|3@1+ (1,0) [0|7] "" XXX
SG_ LKAS_ACTIVE : 17|1@1+ (1,0) [0|3] "" XXX
SG_ Signal2 : 18|5@1+ (1,0) [0|7] "" XXX
SG_ Backward_Speed_Limit_Menu : 23|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_ENABLE_3 : 24|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 25|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_ENABLE_2 : 26|1@1+ (1,0) [0|1] "" XXX
SG_ Signal4 : 27|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_Left_Line_Visible : 28|1@1+ (1,0) [0|1] "" XXX
SG_ Signal6 : 29|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_Right_Line_Visible : 30|1@1+ (1,0) [0|1] "" XXX
SG_ Signal7 : 31|1@1+ (1,0) [0|1] "" XXX
SG_ FCW_Cont_Beep : 32|1@1+ (1,0) [0|1] "" XXX
SG_ FCW_Repeated_Beep : 33|1@1+ (1,0) [0|1] "" XXX
SG_ Throttle_Management_Activated : 34|1@1+ (1,0) [0|1] "" XXX
SG_ Traffic_light_Ahead : 35|1@1+ (1,0) [0|1] "" XXX
SG_ Right_Depart : 36|1@1+ (1,0) [0|3] "" XXX
SG_ Signal5 : 37|27@1+ (1,0) [0|1] "" XXX
BO_ 1677 Dash_State: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Units : 29|3@1+ (1,0) [0|7] "" XXX
CM_ SG_ 801 Cruise_State "0 = Normal, 3 = Hold";
CM_ SG_ 802 Traffic_light_Ahead "Crosstrek 2018 = car in front has moved";
CM_ SG_ 940 FOG_LIGHTS2 "yellow fog light in the dash";
CM_ SG_ 940 Highbeam "01 = low beam, 11 = high beam";
CM_ SG_ 1677 Units "1 = imperial, 6 = metric";
VAL_ 72 Gear 2 "N" 3 "R" 4 "P" 121 "D" 137 "1" 145 "2" 153 "3" 161 "4" 169 "5" 177 "6";
+306
View File
@@ -0,0 +1,306 @@
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
CM_ "Imported file _subaru_global.dbc starts here"
VERSION ""
NS_ :
NS_DESC_
CM_
BA_DEF_
BA_
VAL_
CAT_DEF_
CAT_
FILTER
BA_DEF_DEF_
EV_DATA_
ENVVAR_DATA_
SGTYPE_
SGTYPE_VAL_
BA_DEF_SGTYPE_
BA_SGTYPE_
SIG_TYPE_REF_
VAL_TABLE_
SIG_GROUP_
SIG_VALTYPE_
SIGTYPE_VALTYPE_
BO_TX_BU_
BA_DEF_REL_
BA_REL_
BA_DEF_DEF_REL_
BU_SG_REL_
BU_EV_REL_
BU_BO_REL_
SG_MUL_VAL_
BS_:
BU_: XXX X
BO_ 2 Steering: 8 XXX
SG_ Steering_Angle : 7|16@0- (0.1,0) [0|65535] "" XXX
SG_ Counter : 25|3@1+ (1,0) [0|7] "" XXX
SG_ CHECKSUM : 32|8@1+ (1,0) [0|255] "" XXX
BO_ 64 Throttle: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Engine_RPM : 16|12@1+ (1,0) [0|4095] "" XXX
SG_ Throttle_Pedal : 32|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Cruise : 40|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Combo : 48|8@1+ (1,0) [0|255] "" XXX
SG_ Signal1 : 56|4@1+ (1,0) [0|15] "" XXX
SG_ Off_Accel : 60|4@1+ (1,0) [0|15] "" XXX
BO_ 316 Brake_Status: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Signal1 : 12|46@1+ (1,0) [0|1] "" XXX
SG_ ES_Brake : 58|1@1+ (1,0) [0|1] "" XXX
SG_ Signal2 : 59|3@1+ (1,0) [0|1] "" XXX
SG_ Brake : 62|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 63|1@1+ (1,0) [0|1] "" XXX
BO_ 326 Cruise_Buttons: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Signal1 : 12|30@1+ (1,0) [0|1073741823] "" XXX
SG_ Main : 42|1@1+ (1,0) [0|1] "" XXX
SG_ Set : 43|1@1+ (1,0) [0|1] "" XXX
SG_ Resume : 44|1@1+ (1,0) [0|1] "" XXX
SG_ Signal2 : 45|19@1+ (1,0) [0|524287] "" XXX
BO_ 315 G_Sensor: 8 XXX
SG_ Lateral : 48|8@1- (-0.1,0) [0|255] "m/s2" XXX
SG_ Longitudinal : 56|8@1- (-0.1,0) [0|255] "m/s2" XXX
BO_ 314 Wheel_Speeds: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ FR : 12|13@1+ (0.057,0) [0|255] "kph" XXX
SG_ RR : 25|13@1+ (0.057,0) [0|255] "kph" XXX
SG_ FL : 51|13@1+ (0.057,0) [0|255] "kph" XXX
SG_ RL : 38|13@1+ (0.057,0) [0|255] "kph" XXX
BO_ 280 STOP_START: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ State : 63|1@1+ (1,0) [0|1] "" XXX
BO_ 281 Steering_Torque: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Steer_Error_1 : 12|1@0+ (1,0) [0|1] "" XXX
SG_ Steer_Torque_Sensor : 16|11@1- (-1,0) [-1000|1000] "" XXX
SG_ Steer_Error_2 : 28|1@1+ (1,0) [0|1] "" XXX
SG_ Steer_Warning : 29|1@1+ (1,0) [0|1] "" XXX
SG_ Steering_Angle : 32|16@1- (-0.0217,0) [-600|600] "" X
SG_ Steer_Torque_Output : 48|11@1- (-1,0) [-1000|1000] "" XXX
BO_ 312 Brake_Pressure_L_R: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Brake_1 : 48|8@1+ (1,0) [0|255] "" XXX
SG_ Brake_2 : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 313 Brake_Pedal: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Signal1 : 12|4@1+ (1,0) [0|15] "" XXX
SG_ Speed : 16|12@1+ (0.05625,0) [0|255] "kph" XXX
SG_ Signal2 : 28|6@1+ (1,0) [0|63] "" XXX
SG_ Brake_Lights : 34|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 35|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_Pedal : 36|12@1+ (1,0) [0|4095] "" XXX
SG_ Signal4 : 48|16@1+ (1,0) [0|65535] "" XXX
BO_ 290 ES_LKAS: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ SET_1 : 12|1@0+ (1,0) [0|1] "" XXX
SG_ LKAS_Output : 16|13@1- (-1,0) [-8191|8191] "" XXX
SG_ LKAS_Request : 29|1@0+ (1,0) [0|1] "" XXX
BO_ 544 ES_Brake: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Signal1 : 12|4@1+ (1,0) [0|15] "" XXX
SG_ Brake_Pressure : 16|16@1+ (1,0) [0|65535] "" XXX
SG_ Signal2 : 32|4@1+ (1,0) [0|15] "" XXX
SG_ Cruise_Brake_Lights : 36|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Brake_Fault : 37|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Brake_Active : 38|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 39|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 40|24@1+ (1,0) [0|16777215] "" XXX
BO_ 577 Cruise_Status: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Cruise_On : 54|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 55|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Active : 57|4@1+ (1,0) [0|15] "" XXX
BO_ 552 BSD_RCTA: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ R_ADJACENT : 48|1@1+ (1,0) [0|1] "" XXX
SG_ L_ADJACENT : 49|1@1+ (1,0) [0|1] "" XXX
SG_ R_APPROACHING : 58|1@1+ (1,0) [0|1] "" XXX
SG_ L_APPROACHING : 59|1@1+ (1,0) [0|1] "" XXX
BO_ 912 Dashlights: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ ICY_ROAD : 32|2@1+ (1,0) [0|3] "" XXX
SG_ SEATBELT_FL : 48|1@1+ (1,0) [0|1] "" XXX
SG_ LEFT_BLINKER : 50|1@1+ (1,0) [0|1] "" XXX
SG_ RIGHT_BLINKER : 51|1@1+ (1,0) [0|1] "" XXX
BO_ 940 BodyInfo: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ DOOR_OPEN_FL : 32|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FR : 33|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 34|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RR : 35|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_TRUNK : 36|1@0+ (1,0) [0|1] "" XXX
SG_ DASH_BTN_LIGHTS : 56|1@0+ (1,0) [0|1] "" XXX
SG_ Lowbeam : 57|1@1+ (1,0) [0|1] "" XXX
SG_ Highbeam : 58|1@1+ (1,0) [0|1] "" XXX
SG_ FOG_LIGHTS2 : 60|1@1+ (1,0) [0|1] "" XXX
SG_ WIPERS : 62|1@0+ (1,0) [0|1] "" XXX
SG_ BRAKE : 54|1@1+ (1,0) [0|1] "" XXX
BO_ 801 ES_DashStatus: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ PCB_Off : 12|1@1+ (1,0) [0|1] "" XXX
SG_ LDW_Off : 13|1@1+ (1,0) [0|1] "" XXX
SG_ Signal1 : 14|10@1+ (1,0) [0|1023] "" XXX
SG_ Cruise_Soft_Disable : 24|1@1+ (1,0) [0|1] "" XXX
SG_ Signal2 : 25|3@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Distance : 28|3@1+ (1,0) [0|7] "" XXX
SG_ Signal3 : 31|1@1+ (1,0) [0|1] "" XXX
SG_ Conventional_Cruise : 32|1@1+ (1,0) [0|1] "" XXX
SG_ Signal4 : 33|2@1+ (1,0) [0|3] "" XXX
SG_ Cruise_Disengaged : 35|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 36|1@1+ (1,0) [0|1] "" XXX
SG_ Signal5 : 37|3@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Set_Speed : 40|8@1+ (1,0) [0|255] "" XXX
SG_ Cruise_Fault : 48|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_On : 49|1@1+ (1,0) [0|1] "" XXX
SG_ Signal6 : 50|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_Lights : 51|1@1+ (1,0) [0|1] "" XXX
SG_ Car_Follow : 52|1@1+ (1,0) [0|1] "" XXX
SG_ Signal7 : 53|3@1+ (1,0) [0|1] "" XXX
SG_ Far_Distance : 56|4@1+ (1,0) [0|15] "" XXX
SG_ Cruise_State : 60|4@1+ (1,0) [0|15] "" XXX
BO_ 802 ES_LKAS_State: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Keep_Hands_On_Wheel : 12|1@1+ (1,0) [0|1] "" XXX
SG_ Empty_Box : 13|1@1+ (1,0) [0|1] "" XXX
SG_ Signal1 : 14|3@1+ (1,0) [0|7] "" XXX
SG_ LKAS_ACTIVE : 17|1@1+ (1,0) [0|1] "" XXX
SG_ Signal2 : 18|5@1+ (1,0) [0|31] "" XXX
SG_ Backward_Speed_Limit_Menu : 23|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_ENABLE_3 : 24|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_Left_Line_Light_Blink : 25|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_ENABLE_2 : 26|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_Right_Line_Light_Blink : 27|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_Left_Line_Visible : 28|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_Left_Line_Green : 29|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_Right_Line_Visible : 30|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_Right_Line_Green : 31|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_Alert : 32|4@1+ (1,0) [0|15] "" XXX
SG_ Signal3 : 36|28@1+ (1,0) [0|1] "" XXX
BO_ 722 AC_State: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ AC_Mode : 37|3@1+ (1,0) [0|1] "" XXX
SG_ AC_ON : 24|2@1+ (1,0) [0|1] "" XXX
BO_ 1677 Dash_State: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Units : 29|3@1+ (1,0) [0|7] "" XXX
CM_ SG_ 64 Throttle_Combo "Throttle Cruise + Pedal";
CM_ SG_ 313 Brake_Lights "Driver or Cruise Brake on";
CM_ SG_ 544 Cruise_Brake_Lights "1 = switch on brake lights";
CM_ SG_ 801 PCB_Off "Pre-Collision Braking off";
CM_ SG_ 801 Brake_Lights "Driver or Cruise brake on";
CM_ SG_ 801 Cruise_State "0 = Normal, 1 = Hold+User Brake, 2 = Ready, 3 = Hold";
CM_ SG_ 801 Far_Distance "1=0-5m, 2=5-10m, 3=10-15m, 4=15-20m, 5=20-25m, 6=25-30m, 7=30-35m, 8=35-40m, 9=40-45m, 10=45-50m, 11=50-55m, 12=55-60m, 13=60-65m, 14=65-70m, 15=75m+";
CM_ SG_ 801 Cruise_Soft_Disable "Eyesight soft disable (eg direct sunlight)";
CM_ SG_ 802 LKAS_Alert "1 = FCW_Cont_Beep, 2 = FCW_Repeated_Beep, 3 = Throttle_Management_Activated_Warning, 4 = Throttle_Management_Activated_Alert, 8 = Traffic_Light_Ahead, 9 = Apply_Brake_to_Hold Position, 11 = LDW_Right, 12 = LDW_Left, 13 = Stay_Alert, 14 = Lead_Vehicle_Start_Alert";
CM_ SG_ 912 ICY_ROAD "1 = DASHLIGHT ON, 2 = WARNING, 3 = OFF";
CM_ SG_ 940 Highbeam "01 = low beam, 11 = high beam";
CM_ SG_ 940 FOG_LIGHTS2 "yellow fog light in the dash";
CM_ SG_ 1677 Units "AU/EU: 1 = imperial, 3 = metric US: 3 = imperial, 4 = metric";
CM_ "subaru_global_2017.dbc starts here"
BO_ 72 Transmission: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Gear : 24|8@1+ (1,0) [0|255] "" XXX
SG_ RPM : 40|16@1+ (1,0) [0|65535] "" XXX
BO_ 73 CVT: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ CVT_Gear : 24|8@1+ (1,0) [0|255] "" XXX
BO_ 545 ES_Distance: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Signal1 : 12|3@1+ (1,0) [0|7] "" XXX
SG_ Cruise_Fault : 15|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Throttle : 16|12@1+ (1,0) [0|4095] "" XXX
SG_ Signal2 : 28|4@1+ (1,0) [0|15] "" XXX
SG_ Car_Follow : 32|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 33|3@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Brake_Active : 36|1@1+ (1,0) [0|1] "" XXX
SG_ Distance_Swap : 37|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_EPB : 38|1@1+ (1,0) [0|1] "" XXX
SG_ Signal4 : 39|1@0+ (1,0) [0|1] "" XXX
SG_ Close_Distance : 40|8@1+ (1,0) [0|1] "" XXX
SG_ Signal5 : 48|8@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Cancel : 56|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Set : 57|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Resume : 58|1@1+ (1,0) [0|1] "" XXX
SG_ Signal6 : 59|5@1+ (1,0) [0|1] "" XXX
BO_ 546 ES_Status: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Signal1 : 12|3@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Fault : 15|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_RPM : 16|12@1+ (1,0) [0|4095] "" XXX
SG_ Signal2 : 28|1@0+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 29|1@0+ (1,0) [0|1] "" XXX
SG_ Brake_Lights : 30|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Hold : 31|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 32|32@1+ (1,0) [0|1] "" XXX
BO_ 576 CruiseControl: 8 XXX
SG_ CHECKSUM : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Signal1 : 12|28@1+ (1,0) [0|268435455] "" XXX
SG_ Cruise_On : 40|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 41|1@1+ (1,0) [0|1] "" XXX
SG_ Signal2 : 42|22@1+ (1,0) [0|4194303] "" XXX
CM_ SG_ 545 Cruise_Throttle "RPM-like output signal";
CM_ SG_ 545 Cruise_EPB "1 = Electric Parking Brake set";
CM_ SG_ 545 Distance_Swap "Switch from Close to Far distance";
CM_ SG_ 546 Cruise_RPM "ES RPM output for ECM and TCM";
CM_ SG_ 546 Signal3 "0 when cruise_activated = 1";
VAL_ 72 Gear 2 "N" 3 "R" 4 "P" 121 "D" 137 "1" 145 "2" 153 "3" 161 "4" 169 "5" 177 "6";
+273
View File
@@ -0,0 +1,273 @@
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
CM_ "Imported file _subaru_preglobal_2015.dbc starts here"
VERSION ""
NS_ :
NS_DESC_
CM_
BA_DEF_
BA_
VAL_
CAT_DEF_
CAT_
FILTER
BA_DEF_DEF_
EV_DATA_
ENVVAR_DATA_
SGTYPE_
SGTYPE_VAL_
BA_DEF_SGTYPE_
BA_SGTYPE_
SIG_TYPE_REF_
VAL_TABLE_
SIG_GROUP_
SIG_VALTYPE_
SIGTYPE_VALTYPE_
BO_TX_BU_
BA_DEF_REL_
BA_REL_
BA_DEF_DEF_REL_
BU_SG_REL_
BU_EV_REL_
BU_BO_REL_
SG_MUL_VAL_
BS_:
BU_: XXX X
BO_ 2 Steering: 8 XXX
SG_ Steering_Angle : 7|16@0- (0.1,0) [-500|500] "degree" XXX
SG_ Counter : 27|3@0+ (1,0) [0|7] "" XXX
SG_ Checksum : 39|8@0+ (1,0) [0|255] "" XXX
BO_ 208 G_Sensor: 8 XXX
SG_ Steering_Angle : 0|16@1- (-0.1,0) [-500|500] "" XXX
SG_ Lateral : 16|16@1- (-0.0035,1) [-255|255] "" XXX
SG_ Longitudinal : 48|16@1- (-0.00035,0) [-255|255] "" XXX
BO_ 209 Brake_Pedal: 8 XXX
SG_ Speed : 0|16@1+ (0.05625,0) [0|255] "KPH" XXX
SG_ Brake_Pedal : 16|8@1+ (1,0) [0|255] "" XXX
BO_ 210 Brake_2: 8 XXX
SG_ Brake_Light : 35|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_Related : 36|1@1+ (1,0) [0|1] "" XXX
SG_ Right_Brake : 48|8@1+ (1,0) [0|255] "" XXX
SG_ Left_Brake : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 211 Brake_Type: 8 XXX
SG_ Brake_Light : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Speed_Counter : 32|8@1+ (1,0) [0|255] "" XXX
SG_ Brake_Cruise_On : 42|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_Pedal_On : 46|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 48|8@1+ (1,0) [0|255] "" XXX
BO_ 212 Wheel_Speeds: 8 XXX
SG_ FL : 0|16@1+ (0.0592,0) [0|255] "KPH" XXX
SG_ FR : 16|16@1+ (0.0592,0) [0|255] "KPH" XXX
SG_ RL : 32|16@1+ (0.0592,0) [0|255] "KPH" XXX
SG_ RR : 48|16@1+ (0.0592,0) [0|255] "KPH" XXX
BO_ 320 Throttle: 8 XXX
SG_ Throttle_Pedal : 0|8@1+ (0.392157,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Not_Full_Throttle : 14|1@1+ (1,0) [0|1] "" XXX
SG_ Engine_RPM : 16|14@1+ (1,0) [0|32767] "" XXX
SG_ Off_Throttle : 30|1@1+ (1,0) [0|1] "" XXX
SG_ Throttle_Cruise : 32|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Combo : 40|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Body : 48|8@1+ (1,0) [0|255] "" XXX
SG_ Off_Throttle_2 : 56|1@1+ (1,0) [0|1] "" XXX
BO_ 321 Engine: 8 XXX
SG_ Engine_Torque : 0|15@1+ (1,0) [0|255] "" XXX
SG_ Engine_Stop : 15|1@1+ (1,0) [0|1] "" XXX
SG_ Wheel_Torque : 16|12@1+ (1,0) [0|4095] "" XXX
SG_ Engine_RPM : 32|12@1+ (1,0) [0|8191] "" XXX
BO_ 324 CruiseControl: 8 XXX
SG_ OnOffButton : 2|1@1+ (1,0) [0|1] "" XXX
SG_ SET_BUTTON : 3|1@1+ (1,0) [0|1] "" XXX
SG_ RES_BUTTON : 4|1@1+ (1,0) [0|1] "" XXX
SG_ Button : 13|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_On : 48|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 49|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_Pedal_On : 51|1@1+ (1,0) [0|1] "" XXX
BO_ 328 Transmission: 8 XXX
SG_ Manual_Gear : 4|4@1+ (1,0) [0|15] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Transmission_Engine : 16|15@1+ (1,0) [0|65535] "" XXX
SG_ Gear : 48|4@1+ (1,0) [0|15] "" XXX
SG_ Gear_2 : 52|4@1+ (1,0) [0|15] "" XXX
SG_ Paddle_Shift : 60|2@1+ (1,0) [0|3] "" XXX
BO_ 329 CVT_Ratio: 8 XXX
BO_ 336 Brake_Pressure: 8 XXX
SG_ Brake_Pressure_Right : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Brake_Pressure_Left : 8|8@1+ (1,0) [0|255] "" XXX
BO_ 338 Stalk: 8 XXX
SG_ Counter : 12|4@1+ (1,0) [0|15] "" XXX
SG_ Brake_Light : 52|1@1+ (1,0) [0|1] "" XXX
SG_ Runlights : 58|1@1+ (1,0) [0|1] "" XXX
SG_ Headlights : 59|1@1+ (1,0) [0|1] "" XXX
SG_ Highbeam : 60|1@1+ (1,0) [0|1] "" XXX
SG_ Wiper : 62|1@1+ (1,0) [0|1] "" XXX
BO_ 352 ES_Brake: 8 XXX
SG_ Brake_Pressure : 0|16@1+ (1,0) [0|255] "" XXX
SG_ Brake_Light : 20|1@1+ (1,0) [0|1] "" XXX
SG_ ES_Error : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_On : 22|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 23|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 48|3@1+ (1,0) [0|7] "" XXX
SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 353 ES_CruiseThrottle: 8 XXX
SG_ Throttle_Cruise : 0|12@1+ (1,0) [0|4095] "" XXX
SG_ Signal1 : 12|4@1+ (1,0) [0|15] "" XXX
SG_ Cruise_Activated : 16|1@1+ (1,0) [0|1] "" XXX
SG_ Signal2 : 17|3@1+ (1,0) [0|7] "" XXX
SG_ Brake_On : 20|1@1+ (1,0) [0|1] "" XXX
SG_ DistanceSwap : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Standstill : 22|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 23|1@1+ (1,0) [0|1] "" XXX
SG_ CloseDistance : 24|8@1+ (0.0196,0) [0|255] "m" XXX
SG_ Signal4 : 32|9@1+ (1,0) [0|255] "" XXX
SG_ Standstill_2 : 41|1@1+ (1,0) [0|1] "" XXX
SG_ ES_Error : 42|1@1+ (1,0) [0|1] "" XXX
SG_ Signal5 : 43|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 44|3@1+ (1,0) [0|7] "" XXX
SG_ Signal6 : 47|1@1+ (1,0) [0|1] "" XXX
SG_ Button : 48|3@1+ (1,0) [0|7] "" XXX
SG_ Signal7 : 51|5@1+ (1,0) [0|31] "" XXX
SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 354 ES_RPM: 8 XXX
SG_ Brake : 8|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 9|1@1+ (1,0) [0|1] "" XXX
SG_ RPM : 16|16@1+ (1,0) [0|65535] "" XXX
SG_ Checksum : 32|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 48|3@1+ (1,0) [0|7] "" XXX
BO_ 356 ES_LKAS: 8 XXX
SG_ Counter : 0|3@1+ (1,0) [0|7] "" XXX
SG_ LKAS_Command : 8|13@1- (-1,0) [-4096|4096] "" XXX
SG_ LKAS_Active : 24|1@1+ (1,0) [0|1] "" XXX
SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 359 ES_LDW: 8 XXX
SG_ All_depart_2015 : 0|1@1+ (1,0) [0|1] "" XXX
SG_ Right_Line_2017 : 24|1@1+ (1,0) [0|1] "" XXX
SG_ Left_Line_2017 : 25|1@1+ (1,0) [0|1] "" XXX
SG_ Sig1All_Depart : 28|1@1+ (1,0) [0|1] "" XXX
SG_ Sig2All_Depart : 31|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_Inactive_2017 : 36|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_Active : 37|1@1+ (1,0) [0|1] "" XXX
SG_ Sig1Right_Depart : 48|1@1+ (1,0) [0|1] "" XXX
SG_ Sig1Right_Depart_Front : 49|1@1+ (1,0) [0|1] "" XXX
SG_ Sig2Right_Depart : 50|1@1+ (1,0) [0|1] "" XXX
SG_ Left_Depart_Front : 51|1@1+ (1,0) [0|1] "" XXX
SG_ Sig3All_Depart : 52|1@1+ (1,0) [0|1] "" XXX
BO_ 604 BSD_RCTA: 8 XXX
SG_ Counter : 0|3@1+ (1,0) [0|7] "" XXX
SG_ State : 5|1@1+ (1,0) [0|1] "" XXX
SG_ R_ADJACENT : 32|1@1+ (1,0) [0|1] "" XXX
SG_ L_ADJACENT : 33|1@1+ (1,0) [0|1] "" XXX
SG_ R_APPROACHING : 42|1@1+ (1,0) [0|1] "" XXX
SG_ L_APPROACHING : 43|1@1+ (1,0) [0|1] "" XXX
SG_ R_RCTA : 46|1@1+ (1,0) [0|1] "" XXX
SG_ L_RCTA : 47|1@1+ (1,0) [0|1] "" XXX
BO_ 642 Dashlights: 8 XXX
SG_ Counter : 12|4@1+ (1,0) [0|15] "" XXX
SG_ SEATBELT_FL : 40|1@1+ (1,0) [0|1] "" XXX
SG_ LEFT_BLINKER : 44|1@1+ (1,0) [0|1] "" XXX
SG_ RIGHT_BLINKER : 45|1@1+ (1,0) [0|1] "" XXX
BO_ 880 Steering_Torque_2: 8 XXX
SG_ Steering_Voltage_Flat : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Steer_Torque_Sensor : 29|11@1- (-1,0) [-1000|1000] "" XXX
SG_ Counter : 40|4@1+ (1,0) [0|15] "" XXX
BO_ 884 BodyInfo: 8 XXX
SG_ DOOR_OPEN_FR : 24|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 25|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 26|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RR : 27|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_Hatch : 28|1@1+ (1,0) [0|1] "" XXX
BO_ 864 Engine_Temp: 8 XXX
SG_ Oil_Temp : 16|8@1+ (1,-40) [0|255] "" XXX
SG_ Coolant_Temp : 24|8@1+ (1,-40) [0|255] "" XXX
SG_ Cruise_Activated : 45|1@1+ (1,0) [0|1] "" XXX
SG_ Saved_Speed : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 866 Fuel: 8 XXX
BO_ 1745 Dash_State: 8 XXX
SG_ Units : 15|1@1+ (1,0) [0|1] "" XXX
CM_ SG_ 320 Off_Throttle_2 "Less sensitive";
CM_ SG_ 320 Throttle_Body "Throttle related";
CM_ SG_ 328 Gear "15 = P, 14 = R, 0 = N, 1-6=gear";
CM_ SG_ 328 Gear_2 "15 = P, 14 = R, 0 = N, 1-6=gear";
CM_ SG_ 353 Button "1 = main, 2 = set shallow, 3 = set deep, 4 = resume shallow, 5 resume deep";
CM_ SG_ 354 RPM "20hz version of Transmission_Engine under Transmission";
CM_ SG_ 359 Sig1Right_Depart "right depart, hill steep and seatbelt disengage";
CM_ SG_ 359 LKAS_Inactive_2017 "1 when not steering, 0 when lkas steering";
CM_ SG_ 359 Sig1Right_Depart_Front "object in front, right depart, hill steep and seatbelt disengage alert ";
CM_ SG_ 359 Left_Depart_Front "warning after acceleration into car in front and left depart";
CM_ SG_ 359 Sig1All_Depart "Left and right depart";
CM_ SG_ 359 Sig2All_Depart "Left and right depart";
CM_ SG_ 359 All_depart_2015 "always 1 on 2017";
CM_ SG_ 604 R_APPROACHING "Faster car approaching in far right lane";
CM_ SG_ 604 L_APPROACHING "Faster car approaching in far left lane";
CM_ SG_ 604 R_RCTA "Rear cross traffic alert, only when in R gear";
CM_ SG_ 604 L_RCTA "Rear cross traffic alert, only when in R gear";
CM_ SG_ 642 Counter "Affected by signals";
CM_ SG_ 642 SEATBELT_FL "Driver seatbelt";
CM_ SG_ 880 Steering_Voltage_Flat "receives later than 371";
VAL_ 328 Gear 0 "N" 1 "D" 2 "D" 3 "D" 4 "D" 5 "D" 6 "D" 14 "R" 15 "P";
VAL_ 1745 Units 0 "Metric" 1 "Imperial";
CM_ "subaru_outback_2015.dbc starts here"
BO_ 358 ES_DashStatus: 8 XXX
SG_ Not_Ready_Startup : 0|3@1+ (1,0) [0|7] "" XXX
SG_ Seatbelt_Disengage : 12|2@1+ (1,0) [0|3] "" XXX
SG_ Disengage_Alert : 14|2@1+ (1,0) [0|3] "" XXX
SG_ Cruise_On : 16|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 17|1@1+ (1,0) [0|1] "" XXX
SG_ Signal1 : 18|1@1+ (1,0) [0|1] "" XXX
SG_ WHEELS_MOVING_2015 : 19|1@1+ (1,0) [0|1] "" XXX
SG_ Driver_Input : 20|1@1+ (1,0) [0|1] "" XXX
SG_ Distance_Bars : 21|3@1+ (1,0) [0|7] "" XXX
SG_ Cruise_Set_Speed : 24|8@1+ (1,0) [0|255] "" XXX
SG_ ES_Error : 32|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_On_2 : 34|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 37|3@1+ (1,0) [0|7] "" XXX
SG_ Steep_Hill_Disengage : 44|1@1+ (1,0) [0|3] "" XXX
SG_ Lead_Car : 46|1@1+ (1,0) [0|1] "" XXX
SG_ Obstacle_Distance : 48|4@1+ (5,0) [0|15] "m" XXX
BO_ 881 Steering_Torque: 8 XXX
SG_ Steering_Motor_Flat : 0|10@1+ (32,0) [0|1000] "" XXX
SG_ Steer_Torque_Output : 16|11@1- (-32,0) [-1000|1000] "" XXX
SG_ LKA_Lockout : 27|1@1+ (1,0) [0|1] "" XXX
SG_ Steer_Torque_Sensor : 29|11@1- (1,0) [-1000|1000] "" XXX
SG_ Steering_Angle : 40|16@1- (-0.033,0) [-600|600] "" XXX
CM_ SG_ 358 Disengage_Alert "seatbelt and steep hill disengage";
CM_ SG_ 358 ES_Error "No engagement until restart";
CM_ SG_ 358 Lead_Car "front car detected";
+273
View File
@@ -0,0 +1,273 @@
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
CM_ "Imported file _subaru_preglobal_2015.dbc starts here"
VERSION ""
NS_ :
NS_DESC_
CM_
BA_DEF_
BA_
VAL_
CAT_DEF_
CAT_
FILTER
BA_DEF_DEF_
EV_DATA_
ENVVAR_DATA_
SGTYPE_
SGTYPE_VAL_
BA_DEF_SGTYPE_
BA_SGTYPE_
SIG_TYPE_REF_
VAL_TABLE_
SIG_GROUP_
SIG_VALTYPE_
SIGTYPE_VALTYPE_
BO_TX_BU_
BA_DEF_REL_
BA_REL_
BA_DEF_DEF_REL_
BU_SG_REL_
BU_EV_REL_
BU_BO_REL_
SG_MUL_VAL_
BS_:
BU_: XXX X
BO_ 2 Steering: 8 XXX
SG_ Steering_Angle : 7|16@0- (0.1,0) [-500|500] "degree" XXX
SG_ Counter : 27|3@0+ (1,0) [0|7] "" XXX
SG_ Checksum : 39|8@0+ (1,0) [0|255] "" XXX
BO_ 208 G_Sensor: 8 XXX
SG_ Steering_Angle : 0|16@1- (-0.1,0) [-500|500] "" XXX
SG_ Lateral : 16|16@1- (-0.0035,1) [-255|255] "" XXX
SG_ Longitudinal : 48|16@1- (-0.00035,0) [-255|255] "" XXX
BO_ 209 Brake_Pedal: 8 XXX
SG_ Speed : 0|16@1+ (0.05625,0) [0|255] "KPH" XXX
SG_ Brake_Pedal : 16|8@1+ (1,0) [0|255] "" XXX
BO_ 210 Brake_2: 8 XXX
SG_ Brake_Light : 35|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_Related : 36|1@1+ (1,0) [0|1] "" XXX
SG_ Right_Brake : 48|8@1+ (1,0) [0|255] "" XXX
SG_ Left_Brake : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 211 Brake_Type: 8 XXX
SG_ Brake_Light : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Speed_Counter : 32|8@1+ (1,0) [0|255] "" XXX
SG_ Brake_Cruise_On : 42|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_Pedal_On : 46|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 48|8@1+ (1,0) [0|255] "" XXX
BO_ 212 Wheel_Speeds: 8 XXX
SG_ FL : 0|16@1+ (0.0592,0) [0|255] "KPH" XXX
SG_ FR : 16|16@1+ (0.0592,0) [0|255] "KPH" XXX
SG_ RL : 32|16@1+ (0.0592,0) [0|255] "KPH" XXX
SG_ RR : 48|16@1+ (0.0592,0) [0|255] "KPH" XXX
BO_ 320 Throttle: 8 XXX
SG_ Throttle_Pedal : 0|8@1+ (0.392157,0) [0|255] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Not_Full_Throttle : 14|1@1+ (1,0) [0|1] "" XXX
SG_ Engine_RPM : 16|14@1+ (1,0) [0|32767] "" XXX
SG_ Off_Throttle : 30|1@1+ (1,0) [0|1] "" XXX
SG_ Throttle_Cruise : 32|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Combo : 40|8@1+ (1,0) [0|255] "" XXX
SG_ Throttle_Body : 48|8@1+ (1,0) [0|255] "" XXX
SG_ Off_Throttle_2 : 56|1@1+ (1,0) [0|1] "" XXX
BO_ 321 Engine: 8 XXX
SG_ Engine_Torque : 0|15@1+ (1,0) [0|255] "" XXX
SG_ Engine_Stop : 15|1@1+ (1,0) [0|1] "" XXX
SG_ Wheel_Torque : 16|12@1+ (1,0) [0|4095] "" XXX
SG_ Engine_RPM : 32|12@1+ (1,0) [0|8191] "" XXX
BO_ 324 CruiseControl: 8 XXX
SG_ OnOffButton : 2|1@1+ (1,0) [0|1] "" XXX
SG_ SET_BUTTON : 3|1@1+ (1,0) [0|1] "" XXX
SG_ RES_BUTTON : 4|1@1+ (1,0) [0|1] "" XXX
SG_ Button : 13|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_On : 48|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 49|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_Pedal_On : 51|1@1+ (1,0) [0|1] "" XXX
BO_ 328 Transmission: 8 XXX
SG_ Manual_Gear : 4|4@1+ (1,0) [0|15] "" XXX
SG_ Counter : 8|4@1+ (1,0) [0|15] "" XXX
SG_ Transmission_Engine : 16|15@1+ (1,0) [0|65535] "" XXX
SG_ Gear : 48|4@1+ (1,0) [0|15] "" XXX
SG_ Gear_2 : 52|4@1+ (1,0) [0|15] "" XXX
SG_ Paddle_Shift : 60|2@1+ (1,0) [0|3] "" XXX
BO_ 329 CVT_Ratio: 8 XXX
BO_ 336 Brake_Pressure: 8 XXX
SG_ Brake_Pressure_Right : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Brake_Pressure_Left : 8|8@1+ (1,0) [0|255] "" XXX
BO_ 338 Stalk: 8 XXX
SG_ Counter : 12|4@1+ (1,0) [0|15] "" XXX
SG_ Brake_Light : 52|1@1+ (1,0) [0|1] "" XXX
SG_ Runlights : 58|1@1+ (1,0) [0|1] "" XXX
SG_ Headlights : 59|1@1+ (1,0) [0|1] "" XXX
SG_ Highbeam : 60|1@1+ (1,0) [0|1] "" XXX
SG_ Wiper : 62|1@1+ (1,0) [0|1] "" XXX
BO_ 352 ES_Brake: 8 XXX
SG_ Brake_Pressure : 0|16@1+ (1,0) [0|255] "" XXX
SG_ Brake_Light : 20|1@1+ (1,0) [0|1] "" XXX
SG_ ES_Error : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Brake_On : 22|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 23|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 48|3@1+ (1,0) [0|7] "" XXX
SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 353 ES_CruiseThrottle: 8 XXX
SG_ Throttle_Cruise : 0|12@1+ (1,0) [0|4095] "" XXX
SG_ Signal1 : 12|4@1+ (1,0) [0|15] "" XXX
SG_ Cruise_Activated : 16|1@1+ (1,0) [0|1] "" XXX
SG_ Signal2 : 17|3@1+ (1,0) [0|7] "" XXX
SG_ Brake_On : 20|1@1+ (1,0) [0|1] "" XXX
SG_ DistanceSwap : 21|1@1+ (1,0) [0|1] "" XXX
SG_ Standstill : 22|1@1+ (1,0) [0|1] "" XXX
SG_ Signal3 : 23|1@1+ (1,0) [0|1] "" XXX
SG_ CloseDistance : 24|8@1+ (0.0196,0) [0|255] "m" XXX
SG_ Signal4 : 32|9@1+ (1,0) [0|255] "" XXX
SG_ Standstill_2 : 41|1@1+ (1,0) [0|1] "" XXX
SG_ ES_Error : 42|1@1+ (1,0) [0|1] "" XXX
SG_ Signal5 : 43|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 44|3@1+ (1,0) [0|7] "" XXX
SG_ Signal6 : 47|1@1+ (1,0) [0|1] "" XXX
SG_ Button : 48|3@1+ (1,0) [0|7] "" XXX
SG_ Signal7 : 51|5@1+ (1,0) [0|31] "" XXX
SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 354 ES_RPM: 8 XXX
SG_ Brake : 8|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 9|1@1+ (1,0) [0|1] "" XXX
SG_ RPM : 16|16@1+ (1,0) [0|65535] "" XXX
SG_ Checksum : 32|8@1+ (1,0) [0|255] "" XXX
SG_ Counter : 48|3@1+ (1,0) [0|7] "" XXX
BO_ 356 ES_LKAS: 8 XXX
SG_ Counter : 0|3@1+ (1,0) [0|7] "" XXX
SG_ LKAS_Command : 8|13@1- (-1,0) [-4096|4096] "" XXX
SG_ LKAS_Active : 24|1@1+ (1,0) [0|1] "" XXX
SG_ Checksum : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 359 ES_LDW: 8 XXX
SG_ All_depart_2015 : 0|1@1+ (1,0) [0|1] "" XXX
SG_ Right_Line_2017 : 24|1@1+ (1,0) [0|1] "" XXX
SG_ Left_Line_2017 : 25|1@1+ (1,0) [0|1] "" XXX
SG_ Sig1All_Depart : 28|1@1+ (1,0) [0|1] "" XXX
SG_ Sig2All_Depart : 31|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_Inactive_2017 : 36|1@1+ (1,0) [0|1] "" XXX
SG_ LKAS_Active : 37|1@1+ (1,0) [0|1] "" XXX
SG_ Sig1Right_Depart : 48|1@1+ (1,0) [0|1] "" XXX
SG_ Sig1Right_Depart_Front : 49|1@1+ (1,0) [0|1] "" XXX
SG_ Sig2Right_Depart : 50|1@1+ (1,0) [0|1] "" XXX
SG_ Left_Depart_Front : 51|1@1+ (1,0) [0|1] "" XXX
SG_ Sig3All_Depart : 52|1@1+ (1,0) [0|1] "" XXX
BO_ 604 BSD_RCTA: 8 XXX
SG_ Counter : 0|3@1+ (1,0) [0|7] "" XXX
SG_ State : 5|1@1+ (1,0) [0|1] "" XXX
SG_ R_ADJACENT : 32|1@1+ (1,0) [0|1] "" XXX
SG_ L_ADJACENT : 33|1@1+ (1,0) [0|1] "" XXX
SG_ R_APPROACHING : 42|1@1+ (1,0) [0|1] "" XXX
SG_ L_APPROACHING : 43|1@1+ (1,0) [0|1] "" XXX
SG_ R_RCTA : 46|1@1+ (1,0) [0|1] "" XXX
SG_ L_RCTA : 47|1@1+ (1,0) [0|1] "" XXX
BO_ 642 Dashlights: 8 XXX
SG_ Counter : 12|4@1+ (1,0) [0|15] "" XXX
SG_ SEATBELT_FL : 40|1@1+ (1,0) [0|1] "" XXX
SG_ LEFT_BLINKER : 44|1@1+ (1,0) [0|1] "" XXX
SG_ RIGHT_BLINKER : 45|1@1+ (1,0) [0|1] "" XXX
BO_ 880 Steering_Torque_2: 8 XXX
SG_ Steering_Voltage_Flat : 0|8@1+ (1,0) [0|255] "" XXX
SG_ Steer_Torque_Sensor : 29|11@1- (-1,0) [-1000|1000] "" XXX
SG_ Counter : 40|4@1+ (1,0) [0|15] "" XXX
BO_ 884 BodyInfo: 8 XXX
SG_ DOOR_OPEN_FR : 24|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_FL : 25|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RL : 26|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_RR : 27|1@1+ (1,0) [0|1] "" XXX
SG_ DOOR_OPEN_Hatch : 28|1@1+ (1,0) [0|1] "" XXX
BO_ 864 Engine_Temp: 8 XXX
SG_ Oil_Temp : 16|8@1+ (1,-40) [0|255] "" XXX
SG_ Coolant_Temp : 24|8@1+ (1,-40) [0|255] "" XXX
SG_ Cruise_Activated : 45|1@1+ (1,0) [0|1] "" XXX
SG_ Saved_Speed : 56|8@1+ (1,0) [0|255] "" XXX
BO_ 866 Fuel: 8 XXX
BO_ 1745 Dash_State: 8 XXX
SG_ Units : 15|1@1+ (1,0) [0|1] "" XXX
CM_ SG_ 320 Off_Throttle_2 "Less sensitive";
CM_ SG_ 320 Throttle_Body "Throttle related";
CM_ SG_ 328 Gear "15 = P, 14 = R, 0 = N, 1-6=gear";
CM_ SG_ 328 Gear_2 "15 = P, 14 = R, 0 = N, 1-6=gear";
CM_ SG_ 353 Button "1 = main, 2 = set shallow, 3 = set deep, 4 = resume shallow, 5 resume deep";
CM_ SG_ 354 RPM "20hz version of Transmission_Engine under Transmission";
CM_ SG_ 359 Sig1Right_Depart "right depart, hill steep and seatbelt disengage";
CM_ SG_ 359 LKAS_Inactive_2017 "1 when not steering, 0 when lkas steering";
CM_ SG_ 359 Sig1Right_Depart_Front "object in front, right depart, hill steep and seatbelt disengage alert ";
CM_ SG_ 359 Left_Depart_Front "warning after acceleration into car in front and left depart";
CM_ SG_ 359 Sig1All_Depart "Left and right depart";
CM_ SG_ 359 Sig2All_Depart "Left and right depart";
CM_ SG_ 359 All_depart_2015 "always 1 on 2017";
CM_ SG_ 604 R_APPROACHING "Faster car approaching in far right lane";
CM_ SG_ 604 L_APPROACHING "Faster car approaching in far left lane";
CM_ SG_ 604 R_RCTA "Rear cross traffic alert, only when in R gear";
CM_ SG_ 604 L_RCTA "Rear cross traffic alert, only when in R gear";
CM_ SG_ 642 Counter "Affected by signals";
CM_ SG_ 642 SEATBELT_FL "Driver seatbelt";
CM_ SG_ 880 Steering_Voltage_Flat "receives later than 371";
VAL_ 328 Gear 0 "N" 1 "D" 2 "D" 3 "D" 4 "D" 5 "D" 6 "D" 14 "R" 15 "P";
VAL_ 1745 Units 0 "Metric" 1 "Imperial";
CM_ "subaru_outback_2019.dbc starts here"
BO_ 358 ES_DashStatus: 8 XXX
SG_ Not_Ready_Startup : 0|3@1+ (1,0) [0|7] "" XXX
SG_ Seatbelt_Disengage : 12|2@1+ (1,0) [0|3] "" XXX
SG_ Disengage_Alert : 14|2@1+ (1,0) [0|3] "" XXX
SG_ Cruise_On : 16|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_Activated : 17|1@1+ (1,0) [0|1] "" XXX
SG_ Signal1 : 18|1@1+ (1,0) [0|1] "" XXX
SG_ WHEELS_MOVING_2015 : 19|1@1+ (1,0) [0|1] "" XXX
SG_ Driver_Input : 20|1@1+ (1,0) [0|1] "" XXX
SG_ Distance_Bars : 21|3@1+ (1,0) [0|7] "" XXX
SG_ Cruise_Set_Speed : 24|8@1+ (1,0) [0|255] "" XXX
SG_ ES_Error : 32|1@1+ (1,0) [0|1] "" XXX
SG_ Cruise_On_2 : 34|1@1+ (1,0) [0|1] "" XXX
SG_ Counter : 37|3@1+ (1,0) [0|7] "" XXX
SG_ Steep_Hill_Disengage : 44|1@1+ (1,0) [0|3] "" XXX
SG_ Lead_Car : 46|1@1+ (1,0) [0|1] "" XXX
SG_ Obstacle_Distance : 48|4@1+ (5,0) [0|15] "m" XXX
BO_ 881 Steering_Torque: 8 XXX
SG_ Steering_Motor_Flat : 0|10@1+ (32,0) [0|1000] "" XXX
SG_ Steer_Torque_Output : 16|11@1- (-32,0) [-1000|1000] "" XXX
SG_ LKA_Lockout : 27|1@1+ (1,0) [0|1] "" XXX
SG_ Steer_Torque_Sensor : 29|11@1- (-1,0) [-1000|1000] "" XXX
SG_ Steering_Angle : 40|16@1- (-0.033,0) [-600|600] "" XXX
CM_ SG_ 358 Disengage_Alert "seatbelt and steep hill disengage";
CM_ SG_ 358 ES_Error "No engagement until restart";
CM_ SG_ 358 Lead_Car "front car detected";
+1 -1
View File
@@ -311,7 +311,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
@@ -311,7 +311,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
+2 -2
View File
@@ -311,7 +311,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
@@ -375,7 +375,7 @@ BO_ 705 GAS_PEDAL: 8 XXX
SG_ GAS_PEDAL : 55|8@0+ (0.005,0) [0|1] "" XXX
BO_ 608 STEER_TORQUE_SENSOR: 8 XXX
SG_ STEER_TORQUE_EPS : 47|16@0- (1.0,0) [-20000|20000] "" XXX
SG_ STEER_TORQUE_EPS : 47|16@0- (0.88,0) [-20000|20000] "" XXX
SG_ STEER_TORQUE_DRIVER : 15|16@0- (1,0) [-32768|32767] "" XXX
SG_ STEER_OVERRIDE : 0|1@0+ (1,0) [0|1] "" XXX
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
@@ -311,7 +311,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
@@ -311,7 +311,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
+1 -1
View File
@@ -328,7 +328,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
+1 -1
View File
@@ -328,7 +328,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
+1 -1
View File
@@ -311,7 +311,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
+1 -1
View File
@@ -311,7 +311,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
@@ -311,7 +311,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
@@ -311,7 +311,7 @@ CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set";
CM_ SG_ 37 STEER_RATE "factor is tbd";
CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect";
CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isn't perfect";
CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph";
CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?";
CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque";
+1 -1
View File
@@ -1,3 +1,3 @@
# flake8: noqa
# pylint: skip-file
from .python import Panda, PandaWifiStreaming, PandaDFU, ESPROM, CesantaFlasher, flash_release, BASEDIR, ensure_st_up_to_date, build_st, PandaSerial
from .python import Panda, PandaWifiStreaming, PandaDFU, flash_release, BASEDIR, ensure_st_up_to_date, build_st, PandaSerial
+2 -13
View File
@@ -9,6 +9,7 @@
#ifdef PANDA
#include "drivers/fan.h"
#include "drivers/rtc.h"
#include "drivers/clock_source.h"
#include "boards/white.h"
#include "boards/grey.h"
#include "boards/black.h"
@@ -23,7 +24,7 @@ void detect_board_type(void) {
// SPI lines floating: white (TODO: is this reliable? Not really, we have to enable ESP/GPS to be able to detect this on the UART)
set_gpio_output(GPIOC, 14, 1);
set_gpio_output(GPIOC, 5, 1);
if(!detect_with_pull(GPIOB, 1, PULL_UP)){
if(!detect_with_pull(GPIOB, 1, PULL_UP) && !detect_with_pull(GPIOB, 7, PULL_UP)){
hw_type = HW_TYPE_DOS;
current_board = &board_dos;
} else if((detect_with_pull(GPIOA, 4, PULL_DOWN)) || (detect_with_pull(GPIOA, 5, PULL_DOWN)) || (detect_with_pull(GPIOA, 6, PULL_DOWN)) || (detect_with_pull(GPIOA, 7, PULL_DOWN))){
@@ -53,22 +54,10 @@ void detect_board_type(void) {
// ///// Configuration detection ///// //
bool has_external_debug_serial = 0;
bool is_entering_bootmode = 0;
void detect_configuration(void) {
// detect if external serial debugging is present
has_external_debug_serial = detect_with_pull(GPIOA, 3, PULL_DOWN);
#ifdef PANDA
if(hw_type == HW_TYPE_WHITE_PANDA) {
// check if the ESP is trying to put me in boot mode
is_entering_bootmode = !detect_with_pull(GPIOB, 0, PULL_UP);
} else {
is_entering_bootmode = 0;
}
#else
is_entering_bootmode = 0;
#endif
}
// ///// Board functions ///// //
+15 -11
View File
@@ -1,10 +1,10 @@
// ******************** Prototypes ********************
typedef void (*board_init)(void);
typedef void (*board_enable_can_transciever)(uint8_t transciever, bool enabled);
typedef void (*board_enable_can_transcievers)(bool enabled);
typedef void (*board_enable_can_transceiver)(uint8_t transceiver, bool enabled);
typedef void (*board_enable_can_transceivers)(bool enabled);
typedef void (*board_set_led)(uint8_t color, bool enabled);
typedef void (*board_set_usb_power_mode)(uint8_t mode);
typedef void (*board_set_esp_gps_mode)(uint8_t mode);
typedef void (*board_set_gps_mode)(uint8_t mode);
typedef void (*board_set_can_mode)(uint8_t mode);
typedef void (*board_usb_power_mode_tick)(uint32_t uptime);
typedef bool (*board_check_ignition)(void);
@@ -12,16 +12,18 @@ typedef uint32_t (*board_read_current)(void);
typedef void (*board_set_ir_power)(uint8_t percentage);
typedef void (*board_set_fan_power)(uint8_t percentage);
typedef void (*board_set_phone_power)(bool enabled);
typedef void (*board_set_clock_source_mode)(uint8_t mode);
typedef void (*board_set_siren)(bool enabled);
struct board {
const char *board_type;
const harness_configuration *harness_config;
board_init init;
board_enable_can_transciever enable_can_transciever;
board_enable_can_transcievers enable_can_transcievers;
board_enable_can_transceiver enable_can_transceiver;
board_enable_can_transceivers enable_can_transceivers;
board_set_led set_led;
board_set_usb_power_mode set_usb_power_mode;
board_set_esp_gps_mode set_esp_gps_mode;
board_set_gps_mode set_gps_mode;
board_set_can_mode set_can_mode;
board_usb_power_mode_tick usb_power_mode_tick;
board_check_ignition check_ignition;
@@ -29,6 +31,8 @@ struct board {
board_set_ir_power set_ir_power;
board_set_fan_power set_fan_power;
board_set_phone_power set_phone_power;
board_set_clock_source_mode set_clock_source_mode;
board_set_siren set_siren;
};
// ******************* Definitions ********************
@@ -52,10 +56,10 @@ struct board {
#define USB_POWER_CDP 2U
#define USB_POWER_DCP 3U
// ESP modes
#define ESP_GPS_DISABLED 0U
#define ESP_GPS_ENABLED 1U
#define ESP_GPS_BOOTMODE 2U
// GPS modes
#define GPS_DISABLED 0U
#define GPS_ENABLED 1U
#define GPS_BOOTMODE 2U
// CAN modes
#define CAN_MODE_NORMAL 0U
@@ -72,4 +76,4 @@ bool board_has_gmlan(void);
bool board_has_obd(void);
bool board_has_lin(void);
bool board_has_rtc(void);
bool board_has_relay(void);
bool board_has_relay(void);
+28 -18
View File
@@ -2,8 +2,8 @@
// Black Panda + Harness //
// ///////////////////// //
void black_enable_can_transciever(uint8_t transciever, bool enabled) {
switch (transciever){
void black_enable_can_transceiver(uint8_t transceiver, bool enabled) {
switch (transceiver){
case 1U:
set_gpio_output(GPIOC, 1, !enabled);
break;
@@ -17,18 +17,18 @@ void black_enable_can_transciever(uint8_t transciever, bool enabled) {
set_gpio_output(GPIOB, 10, !enabled);
break;
default:
puts("Invalid CAN transciever ("); puth(transciever); puts("): enabling failed\n");
puts("Invalid CAN transceiver ("); puth(transceiver); puts("): enabling failed\n");
break;
}
}
void black_enable_can_transcievers(bool enabled) {
void black_enable_can_transceivers(bool enabled) {
for(uint8_t i=1U; i<=4U; i++){
// Leave main CAN always on for CAN-based ignition detection
if((car_harness_status == HARNESS_STATUS_FLIPPED) ? (i == 3U) : (i == 1U)){
black_enable_can_transciever(i, true);
black_enable_can_transceiver(i, true);
} else {
black_enable_can_transciever(i, enabled);
black_enable_can_transceiver(i, enabled);
}
}
}
@@ -77,24 +77,24 @@ void black_set_usb_power_mode(uint8_t mode) {
}
}
void black_set_esp_gps_mode(uint8_t mode) {
void black_set_gps_mode(uint8_t mode) {
switch (mode) {
case ESP_GPS_DISABLED:
case GPS_DISABLED:
// GPS OFF
set_gpio_output(GPIOC, 14, 0);
set_gpio_output(GPIOC, 5, 0);
break;
case ESP_GPS_ENABLED:
case GPS_ENABLED:
// GPS ON
set_gpio_output(GPIOC, 14, 1);
set_gpio_output(GPIOC, 5, 1);
break;
case ESP_GPS_BOOTMODE:
case GPS_BOOTMODE:
set_gpio_output(GPIOC, 14, 1);
set_gpio_output(GPIOC, 5, 0);
break;
default:
puts("Invalid ESP/GPS mode\n");
puts("Invalid GPS mode\n");
break;
}
}
@@ -154,6 +154,14 @@ void black_set_phone_power(bool enabled){
UNUSED(enabled);
}
void black_set_clock_source_mode(uint8_t mode){
UNUSED(mode);
}
void black_set_siren(bool enabled){
UNUSED(enabled);
}
void black_init(void) {
common_init_gpio();
@@ -167,7 +175,7 @@ void black_init(void) {
set_gpio_mode(GPIOC, 3, MODE_ANALOG);
// Set default state of GPS
current_board->set_esp_gps_mode(ESP_GPS_ENABLED);
current_board->set_gps_mode(GPS_ENABLED);
// C10: OBD_SBU1_RELAY (harness relay driving output)
// C11: OBD_SBU2_RELAY (harness relay driving output)
@@ -190,8 +198,8 @@ void black_init(void) {
// Initialize harness
harness_init();
// Enable CAN transcievers
black_enable_can_transcievers(true);
// Enable CAN transceivers
black_enable_can_transceivers(true);
// Disable LEDs
black_set_led(LED_RED, false);
@@ -228,16 +236,18 @@ const board board_black = {
.board_type = "Black",
.harness_config = &black_harness_config,
.init = black_init,
.enable_can_transciever = black_enable_can_transciever,
.enable_can_transcievers = black_enable_can_transcievers,
.enable_can_transceiver = black_enable_can_transceiver,
.enable_can_transceivers = black_enable_can_transceivers,
.set_led = black_set_led,
.set_usb_power_mode = black_set_usb_power_mode,
.set_esp_gps_mode = black_set_esp_gps_mode,
.set_gps_mode = black_set_gps_mode,
.set_can_mode = black_set_can_mode,
.usb_power_mode_tick = black_usb_power_mode_tick,
.check_ignition = black_check_ignition,
.read_current = black_read_current,
.set_fan_power = black_set_fan_power,
.set_ir_power = black_set_ir_power,
.set_phone_power = black_set_phone_power
.set_phone_power = black_set_phone_power,
.set_clock_source_mode = black_set_clock_source_mode,
.set_siren = black_set_siren
};
+3 -3
View File
@@ -23,7 +23,7 @@ void common_init_gpio(void){
set_gpio_alternate(GPIOA, 12, GPIO_AF10_OTG_FS);
GPIOA->OSPEEDR = GPIO_OSPEEDER_OSPEEDR11 | GPIO_OSPEEDER_OSPEEDR12;
// A9,A10: USART 1 for talking to the ESP / GPS
// A9,A10: USART 1 for talking to the GPS
set_gpio_alternate(GPIOA, 9, GPIO_AF7_USART1);
set_gpio_alternate(GPIOA, 10, GPIO_AF7_USART1);
@@ -65,7 +65,7 @@ void peripherals_init(void){
RCC->APB1ENR |= RCC_APB1ENR_PWREN; // for RTC config
RCC->APB2ENR |= RCC_APB2ENR_USART1EN;
RCC->AHB2ENR |= RCC_AHB2ENR_OTGFSEN;
//RCC->APB2ENR |= RCC_APB2ENR_TIM1EN;
RCC->APB2ENR |= RCC_APB2ENR_TIM1EN; // clock source timer
RCC->APB2ENR |= RCC_APB2ENR_ADC1EN;
RCC->APB2ENR |= RCC_APB2ENR_SPI1EN;
RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;
@@ -81,4 +81,4 @@ bool detect_with_pull(GPIO_TypeDef *GPIO, int pin, int mode) {
bool ret = get_gpio_input(GPIO, pin);
set_gpio_pullup(GPIO, pin, PULL_NONE);
return ret;
}
}
+28 -22
View File
@@ -2,8 +2,8 @@
// Dos + Harness //
// ///////////// //
void dos_enable_can_transciever(uint8_t transciever, bool enabled) {
switch (transciever){
void dos_enable_can_transceiver(uint8_t transceiver, bool enabled) {
switch (transceiver){
case 1U:
set_gpio_output(GPIOC, 1, !enabled);
break;
@@ -17,18 +17,18 @@ void dos_enable_can_transciever(uint8_t transciever, bool enabled) {
set_gpio_output(GPIOB, 10, !enabled);
break;
default:
puts("Invalid CAN transciever ("); puth(transciever); puts("): enabling failed\n");
puts("Invalid CAN transceiver ("); puth(transceiver); puts("): enabling failed\n");
break;
}
}
void dos_enable_can_transcievers(bool enabled) {
void dos_enable_can_transceivers(bool enabled) {
for(uint8_t i=1U; i<=4U; i++){
// Leave main CAN always on for CAN-based ignition detection
if((car_harness_status == HARNESS_STATUS_FLIPPED) ? (i == 3U) : (i == 1U)){
uno_enable_can_transciever(i, true);
uno_enable_can_transceiver(i, true);
} else {
uno_enable_can_transciever(i, enabled);
uno_enable_can_transceiver(i, enabled);
}
}
}
@@ -54,20 +54,18 @@ void dos_set_gps_load_switch(bool enabled) {
}
void dos_set_bootkick(bool enabled){
UNUSED(enabled);
set_gpio_output(GPIOC, 4, !enabled);
}
void dos_bootkick(void) {}
void dos_set_phone_power(bool enabled){
UNUSED(enabled);
}
void dos_set_usb_power_mode(uint8_t mode) {
UNUSED(mode);
dos_set_bootkick(mode == USB_POWER_CDP);
}
void dos_set_esp_gps_mode(uint8_t mode) {
void dos_set_gps_mode(uint8_t mode) {
UNUSED(mode);
}
@@ -101,11 +99,6 @@ void dos_set_can_mode(uint8_t mode){
void dos_usb_power_mode_tick(uint32_t uptime){
UNUSED(uptime);
if(bootkick_timer != 0U){
bootkick_timer--;
} else {
dos_set_bootkick(false);
}
}
bool dos_check_ignition(void){
@@ -132,6 +125,14 @@ uint32_t dos_read_current(void){
return 0U;
}
void dos_set_clock_source_mode(uint8_t mode){
clock_source_init(mode);
}
void dos_set_siren(bool enabled){
set_gpio_output(GPIOC, 12, enabled);
}
void dos_init(void) {
common_init_gpio();
@@ -171,8 +172,8 @@ void dos_init(void) {
// Initialize RTC
rtc_init();
// Enable CAN transcievers
dos_enable_can_transcievers(true);
// Enable CAN transceivers
dos_enable_can_transceivers(true);
// Disable LEDs
dos_set_led(LED_RED, false);
@@ -189,6 +190,9 @@ void dos_init(void) {
// init multiplexer
can_set_obd(car_harness_status, false);
// Init clock source as internal free running
dos_set_clock_source_mode(CLOCK_SOURCE_MODE_FREE_RUNNING);
}
const harness_configuration dos_harness_config = {
@@ -209,16 +213,18 @@ const board board_dos = {
.board_type = "Dos",
.harness_config = &dos_harness_config,
.init = dos_init,
.enable_can_transciever = dos_enable_can_transciever,
.enable_can_transcievers = dos_enable_can_transcievers,
.enable_can_transceiver = dos_enable_can_transceiver,
.enable_can_transceivers = dos_enable_can_transceivers,
.set_led = dos_set_led,
.set_usb_power_mode = dos_set_usb_power_mode,
.set_esp_gps_mode = dos_set_esp_gps_mode,
.set_gps_mode = dos_set_gps_mode,
.set_can_mode = dos_set_can_mode,
.usb_power_mode_tick = dos_usb_power_mode_tick,
.check_ignition = dos_check_ignition,
.read_current = dos_read_current,
.set_fan_power = dos_set_fan_power,
.set_ir_power = dos_set_ir_power,
.set_phone_power = dos_set_phone_power
.set_phone_power = dos_set_phone_power,
.set_clock_source_mode = dos_set_clock_source_mode,
.set_siren = dos_set_siren
};
+12 -10
View File
@@ -8,22 +8,22 @@ void grey_init(void) {
white_grey_common_init();
// Set default state of GPS
current_board->set_esp_gps_mode(ESP_GPS_ENABLED);
current_board->set_gps_mode(GPS_ENABLED);
}
void grey_set_esp_gps_mode(uint8_t mode) {
void grey_set_gps_mode(uint8_t mode) {
switch (mode) {
case ESP_GPS_DISABLED:
case GPS_DISABLED:
// GPS OFF
set_gpio_output(GPIOC, 14, 0);
set_gpio_output(GPIOC, 5, 0);
break;
case ESP_GPS_ENABLED:
case GPS_ENABLED:
// GPS ON
set_gpio_output(GPIOC, 14, 1);
set_gpio_output(GPIOC, 5, 1);
break;
case ESP_GPS_BOOTMODE:
case GPS_BOOTMODE:
set_gpio_output(GPIOC, 14, 1);
set_gpio_output(GPIOC, 5, 0);
break;
@@ -37,16 +37,18 @@ const board board_grey = {
.board_type = "Grey",
.harness_config = &white_harness_config,
.init = grey_init,
.enable_can_transciever = white_enable_can_transciever,
.enable_can_transcievers = white_enable_can_transcievers,
.enable_can_transceiver = white_enable_can_transceiver,
.enable_can_transceivers = white_enable_can_transceivers,
.set_led = white_set_led,
.set_usb_power_mode = white_set_usb_power_mode,
.set_esp_gps_mode = grey_set_esp_gps_mode,
.set_gps_mode = grey_set_gps_mode,
.set_can_mode = white_set_can_mode,
.usb_power_mode_tick = white_usb_power_mode_tick,
.check_ignition = white_check_ignition,
.read_current = white_read_current,
.set_fan_power = white_set_fan_power,
.set_ir_power = white_set_ir_power,
.set_phone_power = white_set_phone_power
};
.set_phone_power = white_set_phone_power,
.set_clock_source_mode = white_set_clock_source_mode,
.set_siren = white_set_siren
};
+23 -13
View File
@@ -2,19 +2,19 @@
// Pedal //
// ///// //
void pedal_enable_can_transciever(uint8_t transciever, bool enabled) {
switch (transciever){
void pedal_enable_can_transceiver(uint8_t transceiver, bool enabled) {
switch (transceiver){
case 1:
set_gpio_output(GPIOB, 3, !enabled);
break;
default:
puts("Invalid CAN transciever ("); puth(transciever); puts("): enabling failed\n");
puts("Invalid CAN transceiver ("); puth(transceiver); puts("): enabling failed\n");
break;
}
}
void pedal_enable_can_transcievers(bool enabled) {
pedal_enable_can_transciever(1U, enabled);
void pedal_enable_can_transceivers(bool enabled) {
pedal_enable_can_transceiver(1U, enabled);
}
void pedal_set_led(uint8_t color, bool enabled) {
@@ -35,7 +35,7 @@ void pedal_set_usb_power_mode(uint8_t mode){
puts("Trying to set USB power mode on pedal. This is not supported.\n");
}
void pedal_set_esp_gps_mode(uint8_t mode) {
void pedal_set_gps_mode(uint8_t mode) {
UNUSED(mode);
puts("Trying to set ESP/GPS mode on pedal. This is not supported.\n");
}
@@ -77,6 +77,14 @@ void pedal_set_phone_power(bool enabled){
UNUSED(enabled);
}
void pedal_set_clock_source_mode(uint8_t mode){
UNUSED(mode);
}
void pedal_set_siren(bool enabled){
UNUSED(enabled);
}
void pedal_init(void) {
common_init_gpio();
@@ -86,8 +94,8 @@ void pedal_init(void) {
// DAC outputs on A4 and A5
// apparently they don't need GPIO setup
// Enable transciever
pedal_enable_can_transcievers(true);
// Enable transceiver
pedal_enable_can_transceivers(true);
// Disable LEDs
pedal_set_led(LED_RED, false);
@@ -102,16 +110,18 @@ const board board_pedal = {
.board_type = "Pedal",
.harness_config = &pedal_harness_config,
.init = pedal_init,
.enable_can_transciever = pedal_enable_can_transciever,
.enable_can_transcievers = pedal_enable_can_transcievers,
.enable_can_transceiver = pedal_enable_can_transceiver,
.enable_can_transceivers = pedal_enable_can_transceivers,
.set_led = pedal_set_led,
.set_usb_power_mode = pedal_set_usb_power_mode,
.set_esp_gps_mode = pedal_set_esp_gps_mode,
.set_gps_mode = pedal_set_gps_mode,
.set_can_mode = pedal_set_can_mode,
.usb_power_mode_tick = pedal_usb_power_mode_tick,
.check_ignition = pedal_check_ignition,
.read_current = pedal_read_current,
.set_fan_power = pedal_set_fan_power,
.set_ir_power = pedal_set_ir_power,
.set_phone_power = pedal_set_phone_power
};
.set_phone_power = pedal_set_phone_power,
.set_clock_source_mode = pedal_set_clock_source_mode,
.set_siren = pedal_set_siren
};
+27 -17
View File
@@ -4,8 +4,8 @@
#define BOOTKICK_TIME 3U
uint8_t bootkick_timer = 0U;
void uno_enable_can_transciever(uint8_t transciever, bool enabled) {
switch (transciever){
void uno_enable_can_transceiver(uint8_t transceiver, bool enabled) {
switch (transceiver){
case 1U:
set_gpio_output(GPIOC, 1, !enabled);
break;
@@ -19,18 +19,18 @@ void uno_enable_can_transciever(uint8_t transciever, bool enabled) {
set_gpio_output(GPIOB, 10, !enabled);
break;
default:
puts("Invalid CAN transciever ("); puth(transciever); puts("): enabling failed\n");
puts("Invalid CAN transceiver ("); puth(transceiver); puts("): enabling failed\n");
break;
}
}
void uno_enable_can_transcievers(bool enabled) {
void uno_enable_can_transceivers(bool enabled) {
for(uint8_t i=1U; i<=4U; i++){
// Leave main CAN always on for CAN-based ignition detection
if((car_harness_status == HARNESS_STATUS_FLIPPED) ? (i == 3U) : (i == 1U)){
uno_enable_can_transciever(i, true);
uno_enable_can_transceiver(i, true);
} else {
uno_enable_can_transciever(i, enabled);
uno_enable_can_transceiver(i, enabled);
}
}
}
@@ -89,21 +89,21 @@ void uno_set_usb_power_mode(uint8_t mode) {
}
}
void uno_set_esp_gps_mode(uint8_t mode) {
void uno_set_gps_mode(uint8_t mode) {
switch (mode) {
case ESP_GPS_DISABLED:
case GPS_DISABLED:
// GPS OFF
set_gpio_output(GPIOB, 1, 0);
set_gpio_output(GPIOC, 5, 0);
uno_set_gps_load_switch(false);
break;
case ESP_GPS_ENABLED:
case GPS_ENABLED:
// GPS ON
set_gpio_output(GPIOB, 1, 1);
set_gpio_output(GPIOC, 5, 1);
uno_set_gps_load_switch(true);
break;
case ESP_GPS_BOOTMODE:
case GPS_BOOTMODE:
set_gpio_output(GPIOB, 1, 1);
set_gpio_output(GPIOC, 5, 0);
uno_set_gps_load_switch(true);
@@ -175,6 +175,14 @@ uint32_t uno_read_current(void){
return 0U;
}
void uno_set_clock_source_mode(uint8_t mode){
UNUSED(mode);
}
void uno_set_siren(bool enabled){
UNUSED(enabled);
}
void uno_init(void) {
common_init_gpio();
@@ -188,7 +196,7 @@ void uno_init(void) {
set_gpio_mode(GPIOC, 3, MODE_ANALOG);
// Set default state of GPS
current_board->set_esp_gps_mode(ESP_GPS_ENABLED);
current_board->set_gps_mode(GPS_ENABLED);
// C10: OBD_SBU1_RELAY (harness relay driving output)
// C11: OBD_SBU2_RELAY (harness relay driving output)
@@ -223,8 +231,8 @@ void uno_init(void) {
// Initialize RTC
rtc_init();
// Enable CAN transcievers
uno_enable_can_transcievers(true);
// Enable CAN transceivers
uno_enable_can_transceivers(true);
// Disable LEDs
uno_set_led(LED_RED, false);
@@ -271,16 +279,18 @@ const board board_uno = {
.board_type = "Uno",
.harness_config = &uno_harness_config,
.init = uno_init,
.enable_can_transciever = uno_enable_can_transciever,
.enable_can_transcievers = uno_enable_can_transcievers,
.enable_can_transceiver = uno_enable_can_transceiver,
.enable_can_transceivers = uno_enable_can_transceivers,
.set_led = uno_set_led,
.set_usb_power_mode = uno_set_usb_power_mode,
.set_esp_gps_mode = uno_set_esp_gps_mode,
.set_gps_mode = uno_set_gps_mode,
.set_can_mode = uno_set_can_mode,
.usb_power_mode_tick = uno_usb_power_mode_tick,
.check_ignition = uno_check_ignition,
.read_current = uno_read_current,
.set_fan_power = uno_set_fan_power,
.set_ir_power = uno_set_ir_power,
.set_phone_power = uno_set_phone_power
.set_phone_power = uno_set_phone_power,
.set_clock_source_mode = uno_set_clock_source_mode,
.set_siren = uno_set_siren
};
+28 -22
View File
@@ -2,8 +2,8 @@
// White Panda //
// /////////// //
void white_enable_can_transciever(uint8_t transciever, bool enabled) {
switch (transciever){
void white_enable_can_transceiver(uint8_t transceiver, bool enabled) {
switch (transceiver){
case 1U:
set_gpio_output(GPIOC, 1, !enabled);
break;
@@ -14,15 +14,15 @@ void white_enable_can_transciever(uint8_t transciever, bool enabled) {
set_gpio_output(GPIOA, 0, !enabled);
break;
default:
puts("Invalid CAN transciever ("); puth(transciever); puts("): enabling failed\n");
puts("Invalid CAN transceiver ("); puth(transceiver); puts("): enabling failed\n");
break;
}
}
void white_enable_can_transcievers(bool enabled) {
uint8_t t1 = enabled ? 1U : 2U; // leave transciever 1 enabled to detect CAN ignition
void white_enable_can_transceivers(bool enabled) {
uint8_t t1 = enabled ? 1U : 2U; // leave transceiver 1 enabled to detect CAN ignition
for(uint8_t i=t1; i<=3U; i++) {
white_enable_can_transciever(i, enabled);
white_enable_can_transceiver(i, enabled);
}
}
@@ -71,21 +71,21 @@ void white_set_usb_power_mode(uint8_t mode){
}
}
void white_set_esp_gps_mode(uint8_t mode) {
void white_set_gps_mode(uint8_t mode) {
switch (mode) {
case ESP_GPS_DISABLED:
case GPS_DISABLED:
// ESP OFF
set_gpio_output(GPIOC, 14, 0);
set_gpio_output(GPIOC, 5, 0);
break;
#ifndef EON
case ESP_GPS_ENABLED:
case GPS_ENABLED:
// ESP ON
set_gpio_output(GPIOC, 14, 1);
set_gpio_output(GPIOC, 5, 1);
break;
#endif
case ESP_GPS_BOOTMODE:
case GPS_BOOTMODE:
set_gpio_output(GPIOC, 14, 1);
set_gpio_output(GPIOC, 5, 0);
break;
@@ -242,6 +242,14 @@ void white_set_phone_power(bool enabled){
UNUSED(enabled);
}
void white_set_clock_source_mode(uint8_t mode){
UNUSED(mode);
}
void white_set_siren(bool enabled){
UNUSED(enabled);
}
void white_grey_common_init(void) {
common_init_gpio();
@@ -291,8 +299,8 @@ void white_grey_common_init(void) {
set_gpio_alternate(GPIOC, 11, GPIO_AF7_USART3);
set_gpio_pullup(GPIOC, 11, PULL_UP);
// Enable CAN transcievers
white_enable_can_transcievers(true);
// Enable CAN transceivers
white_enable_can_transceivers(true);
// Disable LEDs
white_set_led(LED_RED, false);
@@ -316,12 +324,8 @@ void white_grey_common_init(void) {
void white_init(void) {
white_grey_common_init();
// Set default state of ESP
#ifdef EON
current_board->set_esp_gps_mode(ESP_GPS_DISABLED);
#else
current_board->set_esp_gps_mode(ESP_GPS_ENABLED);
#endif
// Set ESP off by default
current_board->set_gps_mode(GPS_DISABLED);
}
const harness_configuration white_harness_config = {
@@ -332,16 +336,18 @@ const board board_white = {
.board_type = "White",
.harness_config = &white_harness_config,
.init = white_init,
.enable_can_transciever = white_enable_can_transciever,
.enable_can_transcievers = white_enable_can_transcievers,
.enable_can_transceiver = white_enable_can_transceiver,
.enable_can_transceivers = white_enable_can_transceivers,
.set_led = white_set_led,
.set_usb_power_mode = white_set_usb_power_mode,
.set_esp_gps_mode = white_set_esp_gps_mode,
.set_gps_mode = white_set_gps_mode,
.set_can_mode = white_set_can_mode,
.usb_power_mode_tick = white_usb_power_mode_tick,
.check_ignition = white_check_ignition,
.read_current = white_read_current,
.set_fan_power = white_set_fan_power,
.set_ir_power = white_set_ir_power,
.set_phone_power = white_set_phone_power
.set_phone_power = white_set_phone_power,
.set_clock_source_mode = white_set_clock_source_mode,
.set_siren = white_set_siren
};
+100
View File
@@ -0,0 +1,100 @@
#define CLOCK_SOURCE_MODE_DISABLED 0U
#define CLOCK_SOURCE_MODE_FREE_RUNNING 1U
#define CLOCK_SOURCE_MODE_EXTERNAL_SYNC 2U
#define CLOCK_SOURCE_PERIOD_MS 50U
#define CLOCK_SOURCE_PULSE_LEN_MS 2U
uint8_t clock_source_mode = CLOCK_SOURCE_MODE_DISABLED;
void EXTI0_IRQ_Handler(void) {
volatile unsigned int pr = EXTI->PR & (1U << 0);
if (pr != 0U) {
if(clock_source_mode == CLOCK_SOURCE_MODE_EXTERNAL_SYNC){
// TODO: Implement!
}
}
EXTI->PR = (1U << 0);
}
void TIM1_UP_TIM10_IRQ_Handler(void) {
if((TIM1->SR & TIM_SR_UIF) != 0) {
if(clock_source_mode != CLOCK_SOURCE_MODE_DISABLED) {
// Start clock pulse
set_gpio_output(GPIOB, 14, true);
set_gpio_output(GPIOB, 15, true);
}
// Reset interrupt
TIM1->SR &= ~(TIM_SR_UIF);
}
}
void TIM1_CC_IRQ_Handler(void) {
if((TIM1->SR & TIM_SR_CC1IF) != 0) {
if(clock_source_mode != CLOCK_SOURCE_MODE_DISABLED) {
// End clock pulse
set_gpio_output(GPIOB, 14, false);
set_gpio_output(GPIOB, 15, false);
}
// Reset interrupt
TIM1->SR &= ~(TIM_SR_CC1IF);
}
}
void clock_source_init(uint8_t mode){
// Setup external clock signal interrupt
REGISTER_INTERRUPT(EXTI0_IRQn, EXTI0_IRQ_Handler, 110U, FAULT_INTERRUPT_RATE_CLOCK_SOURCE)
register_set(&(SYSCFG->EXTICR[0]), SYSCFG_EXTICR1_EXTI0_PB, 0xFU);
register_set_bits(&(EXTI->IMR), (1U << 0));
register_set_bits(&(EXTI->RTSR), (1U << 0));
register_clear_bits(&(EXTI->FTSR), (1U << 0));
// Setup timer
REGISTER_INTERRUPT(TIM1_UP_TIM10_IRQn, TIM1_UP_TIM10_IRQ_Handler, (1200U / CLOCK_SOURCE_PERIOD_MS) , FAULT_INTERRUPT_RATE_TIM1)
REGISTER_INTERRUPT(TIM1_CC_IRQn, TIM1_CC_IRQ_Handler, (1200U / CLOCK_SOURCE_PERIOD_MS) , FAULT_INTERRUPT_RATE_TIM1)
register_set(&(TIM1->PSC), (9600-1), 0xFFFFU); // Tick on 0.1 ms
register_set(&(TIM1->ARR), ((CLOCK_SOURCE_PERIOD_MS*10U) - 1U), 0xFFFFU); // Period
register_set(&(TIM1->CCMR1), 0U, 0xFFFFU); // No output on compare
register_set_bits(&(TIM1->CCER), TIM_CCER_CC1E); // Enable compare 1
register_set(&(TIM1->CCR1), (CLOCK_SOURCE_PULSE_LEN_MS*10U), 0xFFFFU); // Compare 1 value
register_set_bits(&(TIM1->DIER), TIM_DIER_UIE | TIM_DIER_CC1IE); // Enable interrupts
register_set(&(TIM1->CR1), TIM_CR1_CEN, 0x3FU); // Enable timer
// Set mode
switch(mode) {
case CLOCK_SOURCE_MODE_DISABLED:
// No clock signal
NVIC_DisableIRQ(EXTI0_IRQn);
NVIC_DisableIRQ(TIM1_UP_TIM10_IRQn);
NVIC_DisableIRQ(TIM1_CC_IRQn);
// Disable pulse if we were in the middle of it
set_gpio_output(GPIOB, 14, false);
set_gpio_output(GPIOB, 15, false);
clock_source_mode = CLOCK_SOURCE_MODE_DISABLED;
break;
case CLOCK_SOURCE_MODE_FREE_RUNNING:
// Clock signal is based on internal timer
NVIC_DisableIRQ(EXTI0_IRQn);
NVIC_EnableIRQ(TIM1_UP_TIM10_IRQn);
NVIC_EnableIRQ(TIM1_CC_IRQn);
clock_source_mode = CLOCK_SOURCE_MODE_FREE_RUNNING;
break;
case CLOCK_SOURCE_MODE_EXTERNAL_SYNC:
// Clock signal is based on external timer
NVIC_EnableIRQ(EXTI0_IRQn);
NVIC_EnableIRQ(TIM1_UP_TIM10_IRQn);
NVIC_EnableIRQ(TIM1_CC_IRQn);
clock_source_mode = CLOCK_SOURCE_MODE_EXTERNAL_SYNC;
break;
default:
puts("Unknown clock source mode: "); puth(mode); puts("\n");
break;
}
}
+8 -8
View File
@@ -50,8 +50,8 @@ void debug_ring_callback(uart_ring *ring);
// ******************************** UART buffers ********************************
// esp_gps = USART1
UART_BUFFER(esp_gps, FIFO_SIZE_DMA, FIFO_SIZE_INT, USART1, NULL, true)
// gps = USART1
UART_BUFFER(gps, FIFO_SIZE_DMA, FIFO_SIZE_INT, USART1, NULL, true)
// lin1, K-LINE = UART5
// lin2, L-LINE = USART3
@@ -68,7 +68,7 @@ uart_ring *get_ring_by_number(int a) {
ring = &uart_ring_debug;
break;
case 1:
ring = &uart_ring_esp_gps;
ring = &uart_ring_gps;
break;
case 2:
ring = &uart_ring_lin1;
@@ -185,8 +185,8 @@ void uart_interrupt_handler(uart_ring *q) {
// Reset IDLE flag
UART_READ_DR(q->uart)
if(q == &uart_ring_esp_gps){
dma_pointer_handler(&uart_ring_esp_gps, DMA2_Stream5->NDTR);
if(q == &uart_ring_gps){
dma_pointer_handler(&uart_ring_gps, DMA2_Stream5->NDTR);
} else {
#ifdef DEBUG_UART
puts("No IDLE dma_pointer_handler implemented for this UART.");
@@ -197,7 +197,7 @@ void uart_interrupt_handler(uart_ring *q) {
EXIT_CRITICAL();
}
void USART1_IRQ_Handler(void) { uart_interrupt_handler(&uart_ring_esp_gps); }
void USART1_IRQ_Handler(void) { uart_interrupt_handler(&uart_ring_gps); }
void USART2_IRQ_Handler(void) { uart_interrupt_handler(&uart_ring_debug); }
void USART3_IRQ_Handler(void) { uart_interrupt_handler(&uart_ring_lin2); }
void UART5_IRQ_Handler(void) { uart_interrupt_handler(&uart_ring_lin1); }
@@ -219,7 +219,7 @@ void DMA2_Stream5_IRQ_Handler(void) {
}
// Re-calculate write pointer and reset flags
dma_pointer_handler(&uart_ring_esp_gps, DMA2_Stream5->NDTR);
dma_pointer_handler(&uart_ring_gps, DMA2_Stream5->NDTR);
DMA2->HIFCR = DMA_HIFCR_CTCIF5 | DMA_HIFCR_CHTIF5;
EXIT_CRITICAL();
@@ -229,7 +229,7 @@ void DMA2_Stream5_IRQ_Handler(void) {
void dma_rx_init(uart_ring *q) {
// Initialization is UART-dependent
if(q == &uart_ring_esp_gps){
if(q == &uart_ring_gps){
// DMA2, stream 5, channel 4
// Disable FIFO mode (enable direct)
+22 -20
View File
@@ -3,26 +3,28 @@
#define FAULT_STATUS_PERMANENT 2U
// Fault types
#define FAULT_RELAY_MALFUNCTION (1U << 0)
#define FAULT_UNUSED_INTERRUPT_HANDLED (1U << 1)
#define FAULT_INTERRUPT_RATE_CAN_1 (1U << 2)
#define FAULT_INTERRUPT_RATE_CAN_2 (1U << 3)
#define FAULT_INTERRUPT_RATE_CAN_3 (1U << 4)
#define FAULT_INTERRUPT_RATE_TACH (1U << 5)
#define FAULT_INTERRUPT_RATE_GMLAN (1U << 6)
#define FAULT_INTERRUPT_RATE_INTERRUPTS (1U << 7)
#define FAULT_INTERRUPT_RATE_SPI_DMA (1U << 8)
#define FAULT_INTERRUPT_RATE_SPI_CS (1U << 9)
#define FAULT_INTERRUPT_RATE_UART_1 (1U << 10)
#define FAULT_INTERRUPT_RATE_UART_2 (1U << 11)
#define FAULT_INTERRUPT_RATE_UART_3 (1U << 12)
#define FAULT_INTERRUPT_RATE_UART_5 (1U << 13)
#define FAULT_INTERRUPT_RATE_UART_DMA (1U << 14)
#define FAULT_INTERRUPT_RATE_USB (1U << 15)
#define FAULT_INTERRUPT_RATE_TIM1 (1U << 16)
#define FAULT_INTERRUPT_RATE_TIM3 (1U << 17)
#define FAULT_REGISTER_DIVERGENT (1U << 18)
#define FAULT_INTERRUPT_RATE_KLINE_INIT (1U << 19)
#define FAULT_RELAY_MALFUNCTION (1U << 0)
#define FAULT_UNUSED_INTERRUPT_HANDLED (1U << 1)
#define FAULT_INTERRUPT_RATE_CAN_1 (1U << 2)
#define FAULT_INTERRUPT_RATE_CAN_2 (1U << 3)
#define FAULT_INTERRUPT_RATE_CAN_3 (1U << 4)
#define FAULT_INTERRUPT_RATE_TACH (1U << 5)
#define FAULT_INTERRUPT_RATE_GMLAN (1U << 6)
#define FAULT_INTERRUPT_RATE_INTERRUPTS (1U << 7)
#define FAULT_INTERRUPT_RATE_SPI_DMA (1U << 8)
#define FAULT_INTERRUPT_RATE_SPI_CS (1U << 9)
#define FAULT_INTERRUPT_RATE_UART_1 (1U << 10)
#define FAULT_INTERRUPT_RATE_UART_2 (1U << 11)
#define FAULT_INTERRUPT_RATE_UART_3 (1U << 12)
#define FAULT_INTERRUPT_RATE_UART_5 (1U << 13)
#define FAULT_INTERRUPT_RATE_UART_DMA (1U << 14)
#define FAULT_INTERRUPT_RATE_USB (1U << 15)
#define FAULT_INTERRUPT_RATE_TIM1 (1U << 16)
#define FAULT_INTERRUPT_RATE_TIM3 (1U << 17)
#define FAULT_REGISTER_DIVERGENT (1U << 18)
#define FAULT_INTERRUPT_RATE_KLINE_INIT (1U << 19)
#define FAULT_INTERRUPT_RATE_CLOCK_SOURCE (1U << 20)
#define FAULT_INTERRUPT_RATE_TIM9 (1U << 21)
// Permanent faults
#define PERMANENT_FAULTS 0U
+1 -1
View File
@@ -1,3 +1,3 @@
#!/bin/bash
sudo apt-get install gcc-arm-none-eabi python-pip
sudo pip install libusb1 pycrypto requests
sudo pip install libusb1 pycryptodome requests
+1 -1
View File
@@ -4,4 +4,4 @@ sudo easy_install pip
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap ArmMbed/homebrew-formulae
brew install python dfu-util arm-none-eabi-gcc
pip install --user libusb1 pycrypto requests
pip install --user libusb1 pycryptodome requests
+2 -6
View File
@@ -64,13 +64,9 @@ void early(void) {
if (enter_bootloader_mode == ENTER_BOOTLOADER_MAGIC) {
#ifdef PANDA
current_board->set_esp_gps_mode(ESP_GPS_DISABLED);
current_board->set_gps_mode(GPS_DISABLED);
#endif
current_board->set_led(LED_GREEN, 1);
jump_to_bootloader();
}
if (is_entering_bootmode) {
enter_bootloader_mode = ENTER_SOFTLOADER_MAGIC;
}
}
}
+101 -84
View File
@@ -400,24 +400,24 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
// **** 0xd9: set ESP power
case 0xd9:
if (setup->b.wValue.w == 1U) {
current_board->set_esp_gps_mode(ESP_GPS_ENABLED);
current_board->set_gps_mode(GPS_ENABLED);
} else if (setup->b.wValue.w == 2U) {
current_board->set_esp_gps_mode(ESP_GPS_BOOTMODE);
current_board->set_gps_mode(GPS_BOOTMODE);
} else {
current_board->set_esp_gps_mode(ESP_GPS_DISABLED);
current_board->set_gps_mode(GPS_DISABLED);
}
break;
// **** 0xda: reset ESP, with optional boot mode
case 0xda:
current_board->set_esp_gps_mode(ESP_GPS_DISABLED);
current_board->set_gps_mode(GPS_DISABLED);
delay(1000000);
if (setup->b.wValue.w == 1U) {
current_board->set_esp_gps_mode(ESP_GPS_BOOTMODE);
current_board->set_gps_mode(GPS_BOOTMODE);
} else {
current_board->set_esp_gps_mode(ESP_GPS_ENABLED);
current_board->set_gps_mode(GPS_ENABLED);
}
delay(1000000);
current_board->set_esp_gps_mode(ESP_GPS_ENABLED);
current_board->set_gps_mode(GPS_ENABLED);
break;
// **** 0xdb: set GMLAN (white/grey) or OBD CAN (black) multiplexing mode
case 0xdb:
@@ -493,7 +493,7 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
}
// TODO: Remove this again and fix boardd code to hande the message bursts instead of single chars
if (ur == &uart_ring_esp_gps) {
if (ur == &uart_ring_gps) {
dma_pointer_handler(ur, DMA2_Stream5->NDTR);
}
@@ -606,6 +606,14 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
}
}
break;
// **** 0xf5: set clock source mode
case 0xf5:
current_board->set_clock_source_mode(setup->b.wValue.w);
break;
// **** 0xf6: set siren enabled
case 0xf6:
siren_enabled = (setup->b.wValue.w != 0U);
break;
default:
puts("NO HANDLER ");
puth(setup->b.bRequest);
@@ -663,87 +671,97 @@ void __attribute__ ((noinline)) enable_fpu(void) {
#define EON_HEARTBEAT_IGNITION_CNT_ON 5U
#define EON_HEARTBEAT_IGNITION_CNT_OFF 2U
// called at 1Hz
// called at 8Hz
uint8_t loop_counter = 0U;
void TIM1_BRK_TIM9_IRQ_Handler(void) {
if (TIM9->SR != 0) {
can_live = pending_can_live;
// siren
current_board->set_siren((loop_counter & 1U) && siren_enabled);
current_board->usb_power_mode_tick(uptime_cnt);
// decimated to 1Hz
if(loop_counter == 0U){
can_live = pending_can_live;
//puth(usart1_dma); puts(" "); puth(DMA2_Stream5->M0AR); puts(" "); puth(DMA2_Stream5->NDTR); puts("\n");
current_board->usb_power_mode_tick(uptime_cnt);
// reset this every 16th pass
if ((uptime_cnt & 0xFU) == 0U) {
pending_can_live = 0;
}
#ifdef DEBUG
puts("** blink ");
puth(can_rx_q.r_ptr); puts(" "); puth(can_rx_q.w_ptr); puts(" ");
puth(can_tx1_q.r_ptr); puts(" "); puth(can_tx1_q.w_ptr); puts(" ");
puth(can_tx2_q.r_ptr); puts(" "); puth(can_tx2_q.w_ptr); puts("\n");
#endif
//puth(usart1_dma); puts(" "); puth(DMA2_Stream5->M0AR); puts(" "); puth(DMA2_Stream5->NDTR); puts("\n");
// Tick drivers
fan_tick();
// set green LED to be controls allowed
current_board->set_led(LED_GREEN, controls_allowed);
// turn off the blue LED, turned on by CAN
// unless we are in power saving mode
current_board->set_led(LED_BLUE, (uptime_cnt & 1U) && (power_save_status == POWER_SAVE_STATUS_ENABLED));
// increase heartbeat counter and cap it at the uint32 limit
if (heartbeat_counter < __UINT32_MAX__) {
heartbeat_counter += 1U;
}
#ifdef EON
// check heartbeat counter if we are running EON code.
// if the heartbeat has been gone for a while, go to SILENT safety mode and enter power save
if (heartbeat_counter >= (check_started() ? EON_HEARTBEAT_IGNITION_CNT_ON : EON_HEARTBEAT_IGNITION_CNT_OFF)) {
puts("EON hasn't sent a heartbeat for 0x");
puth(heartbeat_counter);
puts(" seconds. Safety is set to SILENT mode.\n");
if (current_safety_mode != SAFETY_SILENT) {
set_safety_mode(SAFETY_SILENT, 0U);
// reset this every 16th pass
if ((uptime_cnt & 0xFU) == 0U) {
pending_can_live = 0;
}
if (power_save_status != POWER_SAVE_STATUS_ENABLED) {
set_power_save_state(POWER_SAVE_STATUS_ENABLED);
#ifdef DEBUG
puts("** blink ");
puth(can_rx_q.r_ptr); puts(" "); puth(can_rx_q.w_ptr); puts(" ");
puth(can_tx1_q.r_ptr); puts(" "); puth(can_tx1_q.w_ptr); puts(" ");
puth(can_tx2_q.r_ptr); puts(" "); puth(can_tx2_q.w_ptr); puts("\n");
#endif
// Tick drivers
fan_tick();
// set green LED to be controls allowed
current_board->set_led(LED_GREEN, controls_allowed);
// turn off the blue LED, turned on by CAN
// unless we are in power saving mode
current_board->set_led(LED_BLUE, (uptime_cnt & 1U) && (power_save_status == POWER_SAVE_STATUS_ENABLED));
// increase heartbeat counter and cap it at the uint32 limit
if (heartbeat_counter < __UINT32_MAX__) {
heartbeat_counter += 1U;
}
// Also disable IR when the heartbeat goes missing
current_board->set_ir_power(0U);
#ifdef EON
// check heartbeat counter if we are running EON code.
// if the heartbeat has been gone for a while, go to SILENT safety mode and enter power save
if (heartbeat_counter >= (check_started() ? EON_HEARTBEAT_IGNITION_CNT_ON : EON_HEARTBEAT_IGNITION_CNT_OFF)) {
puts("EON hasn't sent a heartbeat for 0x");
puth(heartbeat_counter);
puts(" seconds. Safety is set to SILENT mode.\n");
if (current_safety_mode != SAFETY_SILENT) {
set_safety_mode(SAFETY_SILENT, 0U);
}
if (power_save_status != POWER_SAVE_STATUS_ENABLED) {
set_power_save_state(POWER_SAVE_STATUS_ENABLED);
}
// If enumerated but no heartbeat (phone up, boardd not running), turn the fan on to cool the device
if(usb_enumerated()){
current_board->set_fan_power(50U);
} else {
current_board->set_fan_power(0U);
// Also disable IR when the heartbeat goes missing
current_board->set_ir_power(0U);
// If enumerated but no heartbeat (phone up, boardd not running), turn the fan on to cool the device
if(usb_enumerated()){
current_board->set_fan_power(50U);
} else {
current_board->set_fan_power(0U);
}
}
// enter CDP mode when car starts to ensure we are charging a turned off EON
if (check_started() && (usb_power_mode != USB_POWER_CDP)) {
current_board->set_usb_power_mode(USB_POWER_CDP);
}
#endif
// check registers
check_registers();
// set ignition_can to false after 2s of no CAN seen
if (ignition_can_cnt > 2U) {
ignition_can = false;
};
// on to the next one
uptime_cnt += 1U;
safety_mode_cnt += 1U;
ignition_can_cnt += 1U;
// synchronous safety check
safety_tick(current_hooks);
}
// enter CDP mode when car starts to ensure we are charging a turned off EON
if (check_started() && (usb_power_mode != USB_POWER_CDP)) {
current_board->set_usb_power_mode(USB_POWER_CDP);
}
#endif
// check registers
check_registers();
// set ignition_can to false after 2s of no CAN seen
if (ignition_can_cnt > 2U) {
ignition_can = false;
};
// on to the next one
uptime_cnt += 1U;
safety_mode_cnt += 1U;
ignition_can_cnt += 1U;
// synchronous safety check
safety_tick(current_hooks);
loop_counter++;
loop_counter %= 8U;
}
TIM9->SR = 0;
}
@@ -753,8 +771,8 @@ int main(void) {
// Init interrupt table
init_interrupts(true);
// 1s timer
REGISTER_INTERRUPT(TIM1_BRK_TIM9_IRQn, TIM1_BRK_TIM9_IRQ_Handler, 2U, FAULT_INTERRUPT_RATE_TIM1)
// 8Hz timer
REGISTER_INTERRUPT(TIM1_BRK_TIM9_IRQn, TIM1_BRK_TIM9_IRQ_Handler, 10U, FAULT_INTERRUPT_RATE_TIM9)
// shouldn't have interrupts here, but just in case
disable_interrupts();
@@ -778,7 +796,6 @@ int main(void) {
puts("Config:\n");
puts(" Board type: "); puts(current_board->board_type); puts("\n");
puts(has_external_debug_serial ? " Real serial\n" : " USB serial\n");
puts(is_entering_bootmode ? " ESP wants bootmode\n" : " No bootmode\n");
// init board
current_board->init();
@@ -794,10 +811,10 @@ int main(void) {
}
if (board_has_gps()) {
uart_init(&uart_ring_esp_gps, 9600);
uart_init(&uart_ring_gps, 9600);
} else {
// enable ESP uart
uart_init(&uart_ring_esp_gps, 115200);
uart_init(&uart_ring_gps, 115200);
}
if(board_has_lin()){
@@ -820,14 +837,14 @@ int main(void) {
set_safety_mode(SAFETY_SILENT, 0);
// enable CAN TXs
current_board->enable_can_transcievers(true);
current_board->enable_can_transceivers(true);
#ifndef EON
spi_init();
#endif
// 1hz
timer_init(TIM9, 1464);
// 8hz
timer_init(TIM9, 183);
NVIC_EnableIRQ(TIM1_BRK_TIM9_IRQn);
#ifdef DEBUG
+1
View File
@@ -13,3 +13,4 @@ const board *current_board;
bool is_enumerated = 0;
uint32_t heartbeat_counter = 0;
uint32_t uptime_cnt = 0;
bool siren_enabled = false;
+3 -3
View File
@@ -28,13 +28,13 @@ void set_power_save_state(int state) {
enable = true;
}
current_board->enable_can_transcievers(enable);
current_board->enable_can_transceivers(enable);
// Switch EPS/GPS
if (enable) {
current_board->set_esp_gps_mode(ESP_GPS_ENABLED);
current_board->set_gps_mode(GPS_ENABLED);
} else {
current_board->set_esp_gps_mode(ESP_GPS_DISABLED);
current_board->set_gps_mode(GPS_DISABLED);
}
if(board_has_gmlan()){
+1
View File
@@ -38,6 +38,7 @@
#define SAFETY_VOLKSWAGEN_PQ 21U
#define SAFETY_SUBARU_LEGACY 22U
#define SAFETY_HYUNDAI_LEGACY 23U
#define SAFETY_HYUNDAI_COMMUNITY 24U
uint16_t current_safety_mode = SAFETY_SILENT;
const safety_hooks *current_hooks = &nooutput_hooks;
+1 -1
View File
@@ -1,4 +1,4 @@
const int HYUNDAI_MAX_STEER = 255; // like stock
const int HYUNDAI_MAX_STEER = 384; // like stock
const int HYUNDAI_MAX_RT_DELTA = 112; // max delta torque allowed for real time checks
const uint32_t HYUNDAI_RT_INTERVAL = 250000; // 250ms between real time checks
const int HYUNDAI_MAX_RATE_UP = 3;
+1 -1
View File
@@ -56,7 +56,7 @@ static int nissan_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {
// X-Trail 0x15c, Leaf 0x239
if ((addr == 0x15c) || (addr == 0x239)) {
if (addr == 0x15c){
gas_pressed = ((GET_BYTE(to_push, 5) << 2) | ((GET_BYTE(to_push, 6) >> 6) & 0x3)) > 1;
gas_pressed = ((GET_BYTE(to_push, 5) << 2) | ((GET_BYTE(to_push, 6) >> 6) & 0x3)) > 3;
} else {
gas_pressed = GET_BYTE(to_push, 0) > 3;
}
+1 -1
View File
@@ -290,7 +290,7 @@ void soft_flasher_start(void) {
// B8,B9: CAN 1
set_gpio_alternate(GPIOB, 8, GPIO_AF9_CAN1);
set_gpio_alternate(GPIOB, 9, GPIO_AF9_CAN1);
current_board->enable_can_transciever(1, true);
current_board->enable_can_transceiver(1, true);
// init can
llcan_set_speed(CAN1, 5000, false, false);
-15
View File
@@ -1,15 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQCjIHvrSCWN0Nec6ozbImYik30PIF7JSWgdwDKTxSJ05RM3pj5E
LQEGt3qcaVrTokO68tpt5Gu1p6ZsNqWg7iVTW9M7Qj7IH45YDzQP/PSRjgSosQA6
6f5Gokba5QrW38myqimvj+0p+YH+CNGCBRlTUQGCO8uLCspMZneRSLPW9QIDAQAB
AoGADaUn+HRef9BaWMvd4G6uMHI54cwJYbj8NpDfKjExQqnuw5bqWnWRQmiSnwbJ
DC7kj3zE/LBAuj890ot3q1CAWqh47ZICZfoX9Qbi5TpvIHFCGy6YkOliF6iIQhR2
4+zNKTAA0zNKskOM25PdI+grK1Ni/bEofSA6TrqvEwsmxnkCQQDVp9FUUor2Bo/h
/3oAIP51LTw7vfpztYbJr+BDV63czV2DLXzSwzeNrwH4sA3oy1mjUgMBBgAarNGE
DYlc4H5jAkEAw3UCHzzXPlxkw2QGp7nBly5y3p80Uqc31NuYz8rdX/U8KTngi2No
Ft/SGCEXNpeYbToj+WK3RJJ2Ey0mK8+IxwJAcpGd/5CPsaQNLcw4WK9Yo+8Q2Jxk
G/4gfDCSmqn+smNxnLEcuUwzkwdgkEGgA9BfjeOhdsAH+EXpx90WZrZ/LwJBAK0k
jq+rTqUQZbZsejTEKYjJ/bnV4BzDwoKN0Q1pkLc7X4LJoW74rTFuLgdv8MdMfRtt
IIb/eoeFEpGkMicnHesCQHgR7BTUGBM6Uxam7RCdsgVsxoHBma21E/44ivWUMZzN
3oVt0mPnjS4speOlqwED5pCJ7yw7jwLPFMs8kNxuIKU=
-----END RSA PRIVATE KEY-----
-1
View File
@@ -1 +0,0 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCjIHvrSCWN0Nec6ozbImYik30PIF7JSWgdwDKTxSJ05RM3pj5ELQEGt3qcaVrTokO68tpt5Gu1p6ZsNqWg7iVTW9M7Qj7IH45YDzQP/PSRjgSosQA66f5Gokba5QrW38myqimvj+0p+YH+CNGCBRlTUQGCO8uLCspMZneRSLPW9Q== batman@y840

Some files were not shown because too many files have changed in this diff Show More