openpilot v0.8.6 release

pull/21584/head v0.8.6
Vehicle Researcher 2021-07-14 17:34:36 -07:00
parent ce6564c684
commit b201dc1996
429 changed files with 9831 additions and 11933 deletions

View File

@ -2,7 +2,7 @@
Our software is open source so you can solve your own problems without needing help from others. And if you solve a problem and are so kind, you can upstream it for the rest of the world to use.
Most open source development activity is coordinated through our [GitHub Discussions](https://github.com/commaai/openpilot/discussions) and [Discord](https://discord.comma.ai). A lot of documentation is available on our [medium](https://medium.com/@comma_ai/).
Most open source development activity is coordinated through our [GitHub Discussions](https://github.com/commaai/openpilot/discussions) and [Discord](https://discord.comma.ai). A lot of documentation is available on our [blog](https://blog.comma.ai/).
## Getting Started
@ -22,9 +22,9 @@ Code is automatically checked for style by GitHub Actions as part of the automat
## Car Ports (openpilot)
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.
We've released a [Model Port guide](https://blog.comma.ai/openpilot-port-guide-for-toyota-models/) 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).
If you port openpilot to a substantially new car brand, see this more generic [Brand Port guide](https://blog.comma.ai/how-to-write-a-car-port-for-openpilot/).
## Pull Requests
@ -36,7 +36,7 @@ Or alternatively, when on the master branch:
```
git submodule update --init
```
The reasons for having submodules on a dedicated repository and our new development philosophy can be found in our [post about externalization](https://medium.com/@comma_ai/a-2020-theme-externalization-13b33326d8b3).
The reasons for having submodules on a dedicated repository and our new development philosophy can be found in our [post about externalization](https://blog.comma.ai/a-2020-theme-externalization/).
Modules that are in seperate repositories include:
* cereal
* laika

21
Jenkinsfile vendored
View File

@ -7,6 +7,7 @@ set -e
export CI=1
export TEST_DIR=${env.TEST_DIR}
export SOURCE_DIR=${env.SOURCE_DIR}
export GIT_BRANCH=${env.GIT_BRANCH}
export GIT_COMMIT=${env.GIT_COMMIT}
@ -50,6 +51,7 @@ pipeline {
environment {
COMMA_JWT = credentials('athena-test-jwt')
TEST_DIR = "/data/openpilot"
SOURCE_DIR = "/data/openpilot_source/"
}
options {
timeout(time: 3, unit: 'HOURS')
@ -127,7 +129,8 @@ pipeline {
stage('Devel Tests') {
steps {
phone_steps("eon-build", [
["build devel", "cd release && DEVEL_TEST=1 ./build_devel.sh"],
["build devel", "cd $SOURCE_DIR/release && EXTRA_FILES='tools/' ./build_devel.sh"],
["build openpilot", "cd selfdrive/manager && ./build.py"],
["test manager", "python selfdrive/manager/test/test_manager.py"],
["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"],
["test car interfaces", "cd selfdrive/car/tests/ && ./test_car_interfaces.py"],
@ -180,21 +183,29 @@ pipeline {
}
*/
stage('Tici Build') {
stage('tici Build') {
environment {
R3_PUSH = "${env.BRANCH_NAME == 'master' ? '1' : ' '}"
}
steps {
phone_steps("tici", [
["build", "cd selfdrive/manager && ./build.py"],
["test loggerd", "python selfdrive/loggerd/tests/test_loggerd.py"],
["test encoder", "LD_LIBRARY_PATH=/usr/local/lib python selfdrive/loggerd/tests/test_encoder.py"],
["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"],
//["build release3-staging", "cd release && PUSH=${env.R3_PUSH} ./build_release3.sh"],
])
}
}
stage('Unit Tests (tici)') {
steps {
phone_steps("tici2", [
["build", "cd selfdrive/manager && ./build.py"],
["test loggerd", "python selfdrive/loggerd/tests/test_loggerd.py"],
["test encoder", "LD_LIBRARY_PATH=/usr/local/lib python selfdrive/loggerd/tests/test_encoder.py"],
])
}
}
stage('camerad') {
steps {
phone_steps("eon-party", [
@ -224,7 +235,7 @@ pipeline {
}
steps {
phone_steps("eon-build", [
["push devel", "cd release && CI_PUSH='master-ci' ./build_devel.sh"],
["push devel", "cd $SOURCE_DIR/release && PUSH='master-ci' ./build_devel.sh"],
])
}
}

View File

@ -57,7 +57,7 @@ openpilot should preserve all other vehicle's stock features, including, but are
Supported Hardware
------
At the moment, openpilot supports the [EON DevKit](https://comma.ai/shop/products/eon-dashcam-devkit) and the [comma two](https://comma.ai/shop/products/comma-two-devkit). A [car harness](https://comma.ai/shop/products/car-harness) is recommended to connect the EON or comma two to the car. For experimental purposes, openpilot can also run on an Ubuntu computer with external [webcams](https://github.com/commaai/openpilot/tree/master/tools/webcam).
At the moment, openpilot supports the EON Gold DevKit and the [comma two](https://comma.ai/shop/products/comma-two-devkit). A [car harness](https://comma.ai/shop/products/car-harness) is recommended to connect the EON or comma two to the car. For experimental purposes, openpilot can also run on an Ubuntu computer with external [webcams](https://github.com/commaai/openpilot/tree/master/tools/webcam).
Supported Cars
------
@ -70,10 +70,12 @@ Supported Cars
| Honda | Accord 2018-20 | All | Stock | 0mph | 3mph |
| Honda | Accord Hybrid 2018-20 | All | Stock | 0mph | 3mph |
| Honda | Civic Hatchback 2017-21 | Honda Sensing | Stock | 0mph | 12mph |
| Honda | Civic Sedan/Coupe 2016-18 | Honda Sensing | openpilot | 0mph | 12mph |
| Honda | Civic Sedan/Coupe 2019-20 | All | Stock | 0mph | 2mph<sup>2</sup> |
| Honda | Civic Coupe 2016-18 | Honda Sensing | openpilot | 0mph | 12mph |
| Honda | Civic Coupe 2019-20 | All | Stock | 0mph | 2mph<sup>2</sup> |
| Honda | Civic Sedan 2016-18 | Honda Sensing | openpilot | 0mph | 12mph |
| Honda | Civic Sedan 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 2017-21 | 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-20 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
@ -92,16 +94,17 @@ Supported Cars
| Lexus | IS 2017-2019 | All | Stock | 22mph | 0mph |
| Lexus | NX 2018 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Lexus | NX 2020 | All | openpilot | 0mph | 0mph |
| Lexus | NX Hybrid 2018 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Lexus | NX Hybrid 2018-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Lexus | RX 2016-18 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Lexus | RX 2020-21 | All | openpilot | 0mph | 0mph |
| Lexus | RX Hybrid 2016-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Lexus | RX Hybrid 2020 | All | openpilot | 0mph | 0mph |
| Lexus | UX Hybrid 2019 | All | openpilot | 0mph | 0mph |
| Lexus | RX Hybrid 2020-21 | All | openpilot | 0mph | 0mph |
| Lexus | UX Hybrid 2019-21 | All | openpilot | 0mph | 0mph |
| Toyota | Alphard 2020 | All | openpilot | 0mph | 0mph |
| Toyota | Avalon 2016-21 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
| Toyota | Avalon Hybrid 2019 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
| Toyota | Avalon Hybrid 2019-21 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
| Toyota | Camry 2018-20 | All | Stock | 0mph<sup>4</sup> | 0mph |
| Toyota | Camry 2021 | All | openpilot | 0mph | 0mph |
| Toyota | Camry 2021 | All | openpilot | 0mph<sup>4</sup> | 0mph |
| Toyota | Camry Hybrid 2018-20 | All | Stock | 0mph<sup>4</sup> | 0mph |
| Toyota | Camry Hybrid 2021 | All | openpilot | 0mph | 0mph |
| Toyota | C-HR 2017-20 | All | Stock | 0mph | 0mph |
@ -151,19 +154,23 @@ Community Maintained Cars and Features
| Genesis | G90 2018 | All | Stock | 0mph | 0mph |
| GMC | Acadia 2018<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
| Holden | Astra 2017<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
| Hyundai | Elantra 2017-19, 2021 | SCC + LKAS | Stock | 19mph | 34mph |
| Hyundai | Elantra 2017-19 | SCC + LKAS | Stock | 19mph | 34mph |
| Hyundai | Elantra 2021 | SCC + LKAS | Stock | 0mph | 0mph |
| Hyundai | Elantra Hybrid 2021 | SCC + LKAS | Stock | 0mph | 0mph |
| Hyundai | Genesis 2015-16 | SCC + LKAS | Stock | 19mph | 37mph |
| Hyundai | Ioniq Electric 2019 | SCC + LKAS | Stock | 0mph | 32mph |
| Hyundai | Ioniq Electric 2020 | SCC + LKAS | Stock | 0mph | 0mph |
| Hyundai | Ioniq PHEV 2020 | SCC + LKAS | Stock | 0mph | 0mph |
| Hyundai | Kona 2020 | SCC + LKAS | Stock | 0mph | 0mph |
| Hyundai | Kona EV 2019 | SCC + LKAS | Stock | 0mph | 0mph |
| Hyundai | Santa Fe 2019-20 | All | Stock | 0mph | 0mph |
| Hyundai | Sonata 2018-2019 | SCC + LKAS | Stock | 0mph | 0mph |
| Hyundai | Veloster 2019 | SCC + LKAS | Stock | 5mph | 0mph |
| Hyundai | Veloster 2019-20 | 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-2021 | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Niro EV 2020 | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Niro PHEV 2019 | SCC + LKAS | Stock | 10mph | 32mph |
| Kia | Optima 2017 | SCC + LKAS | Stock | 0mph | 32mph |
| Kia | Optima 2019 | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Seltos 2021 | SCC + LKAS | Stock | 0mph | 0mph |
@ -178,6 +185,7 @@ Community Maintained Cars and Features
| SEAT | Leon 2014-2020 | Driver Assistance | Stock | 0mph | 0mph |
| Škoda | Kodiaq 2018 | Driver Assistance | Stock | 0mph | 0mph |
| Škoda | Octavia 2015, 2019 | Driver Assistance | Stock | 0mph | 0mph |
| Škoda | Octavia RS 2016 | Driver Assistance | Stock | 0mph | 0mph |
| Škoda | Scala 2020 | Driver Assistance | Stock | 0mph | 0mph |
| Škoda | Superb 2015-18 | Driver Assistance | Stock | 0mph | 0mph |
| Subaru | Ascent 2019 | EyeSight | Stock | 0mph | 0mph |
@ -192,10 +200,12 @@ Community Maintained Cars and Features
| Volkswagen| Golf GTI 2018-19 | Driver Assistance | Stock | 0mph | 0mph |
| Volkswagen| Golf R 2016-19 | Driver Assistance | Stock | 0mph | 0mph |
| Volkswagen| Golf SportsVan 2016 | Driver Assistance | Stock | 0mph | 0mph |
| Volkswagen| Golf SportWagen 2015 | Driver Assistance | Stock | 0mph | 0mph |
| Volkswagen| Jetta 2018-20 | Driver Assistance | Stock | 0mph | 0mph |
| Volkswagen| Jetta GLI 2021 | Driver Assistance | Stock | 0mph | 0mph |
| Volkswagen| Passat 2016-17<sup>2</sup> | Driver Assistance | Stock | 0mph | 0mph |
| Volkswagen| Tiguan 2020 | Driver Assistance | Stock | 0mph | 0mph |
| Volkswagen| Touran 2017 | Driver Assistance | Stock | 0mph | 0mph |
<sup>1</sup>Requires an [OBD-II car harness](https://comma.ai/shop/products/comma-car-harness) and [community built ASCM harness](https://github.com/commaai/openpilot/wiki/GM#hardware). ***NOTE: disconnecting the ASCM disables Automatic Emergency Braking (AEB).*** <br />
<sup>2</sup>Only includes the MQB Passat sold outside of North America. The NMS Passat made in Chattanooga TN is not yet supported.
@ -209,7 +219,7 @@ Although they're not upstream, the community has openpilot running on other make
Installation Instructions
------
Install openpilot on an EON or comma two by entering ``https://openpilot.comma.ai`` during the installer setup.
Install openpilot on an EON Gold or comma two by entering ``https://openpilot.comma.ai`` during the installer setup.
Follow these [video instructions](https://youtu.be/lcjqxCymins) to properly mount the device on the windshield. Note: openpilot features an automatic pose calibration routine and openpilot performance should not be affected by small pitch and yaw misalignments caused by imprecise device mounting.
@ -299,7 +309,7 @@ Safety and Testing
* panda has software in the loop [safety tests](https://github.com/commaai/panda/tree/master/tests/safety).
* Internally, we have a hardware in the loop Jenkins test suite that builds and unit tests the various processes.
* panda has additional hardware in the loop [tests](https://github.com/commaai/panda/blob/master/Jenkinsfile).
* We run the latest openpilot in a testing closet containing 10 EONs continuously replaying routes.
* We run the latest openpilot in a testing closet containing 10 comma devices continuously replaying routes.
Testing on PC
------
@ -326,7 +336,7 @@ Community and Contributing
openpilot is developed by [comma](https://comma.ai/) and by users like you. We welcome both pull requests and issues on [GitHub](http://github.com/commaai/openpilot). Bug fixes and new car ports are encouraged.
You can add support for your car by following guides we have written for [Brand](https://medium.com/@comma_ai/how-to-write-a-car-port-for-openpilot-7ce0785eda84) and [Model](https://medium.com/@comma_ai/openpilot-port-guide-for-toyota-models-e5467f4b5fe6) ports. Generally, a car with adaptive cruise control and lane keep assist is a good candidate. [Join our Discord](https://discord.comma.ai) to discuss car ports: most car makes have a dedicated channel.
You can add support for your car by following guides we have written for [Brand](https://blog.comma.ai/how-to-write-a-car-port-for-openpilot/) and [Model](https://blog.comma.ai/openpilot-port-guide-for-toyota-models/) ports. Generally, a car with adaptive cruise control and lane keep assist is a good candidate. [Join our Discord](https://discord.comma.ai) to discuss car ports: most car makes have a dedicated channel.
Want to get paid to work on openpilot? [comma is hiring](https://comma.ai/jobs/).
@ -337,27 +347,27 @@ Directory Structure
.
├── cereal # The messaging spec and libs used for all logs
├── common # Library like functionality we've developed here
├── installer/updater # Manages auto-updates of NEOS
├── installer/updater # Manages updates of NEOS
├── opendbc # Files showing how to interpret data from cars
├── panda # Code used to communicate on CAN
├── phonelibs # Libraries used on NEOS devices
├── pyextra # Libraries used on NEOS devices
├── phonelibs # External libraries
├── pyextra # Extra python packages not shipped in NEOS
└── selfdrive # Code needed to drive the car
├── assets # Fonts, images and sounds for UI
├── assets # Fonts, images, and sounds for UI
├── athena # Allows communication with the app
├── boardd # Daemon to talk to the board
├── camerad # Driver to capture images from the camera sensors
├── car # Car specific code to read states and control actuators
├── common # Shared C/C++ code for the daemons
├── controls # Perception, planning and controls
├── controls # Planning and controls
├── debug # Tools to help you debug and do car ports
├── locationd # Soon to be home of precise location
├── locationd # Precise localization and vehicle parameter estimation
├── logcatd # Android logcat as a service
├── loggerd # Logger and uploader of car data
├── modeld # Driving and monitoring model runners
├── proclogd # Logs information from proc
├── sensord # IMU / GPS interface code
├── test # Unit tests, system tests and a car simulator
├── sensord # IMU interface code
├── test # Unit tests, system tests, and a car simulator
└── ui # The UI
Licensing

View File

@ -1,3 +1,19 @@
Version 0.8.6 (2021-07-21)
========================
* Revamp lateral and longitudinal planners
* Refactor planner output API to be more readable and verbose
* Planners now output desired trajectories for speed, acceleration, curvature, and curvature rate
* Use MPC for longitudinal planning when no lead car is present, makes accel and decel smoother
* Remove "CHECK DRIVER FACE VISIBILITY" warning
* Fixed cruise fault on some TSS2.5 Camrys and international Toyotas
* Hyundai Elantra Hybrid 2021 support thanks to tecandrew!
* Hyundai Ioniq PHEV 2020 support thanks to YawWashout!
* Kia Niro Hybrid 2019 support thanks to jyoung8607!
* Škoda Octavia RS 2016 support thanks to jyoung8607!
* Toyota Alphard 2020 support thanks to belm0!
* Volkswagen Golf SportWagen 2015 support thanks to jona96!
* Volkswagen Touran 2017 support thanks to jyoung8607!
Version 0.8.5 (2021-06-11)
========================
* NEOS update: improved reliability and stability with better voltage regulator configuration

View File

@ -28,7 +28,7 @@ ensuring two main safety requirements.
react. This means that while the system is engaged, the actuators are constrained
to operate within reasonable limits.
For vehicle specific implementation of the safety concept, refer to `panda/board/safety/`.
For additional safety implementation details, refer to [panda safety model](https://github.com/commaai/panda#safety-model). For vehicle specific implementation of the safety concept, refer to [panda/board/safety/](https://github.com/commaai/panda/tree/master/board/safety).
**Extra note**: comma.ai strongly discourages the use of openpilot forks with safety code either missing or
not fully meeting the above requirements.

View File

@ -13,6 +13,10 @@ AddOption('--test',
action='store_true',
help='build test files')
AddOption('--setup',
action='store_true',
help='build setup and installer files')
AddOption('--kaitai',
action='store_true',
help='Regenerate kaitai struct parsers')
@ -47,6 +51,11 @@ AddOption('--external-sconscript',
dest='external_sconscript',
help='add an external SConscript to the build')
AddOption('--no-thneed',
action='store_true',
dest='no_thneed',
help='avoid using thneed')
real_arch = arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
if platform.system() == "Darwin":
arch = "Darwin"
@ -98,8 +107,8 @@ if arch == "aarch64" or arch == "larch64":
"#phonelibs/libyuv/lib",
"/system/vendor/lib64"
]
cflags = ["-DQCOM", "-mcpu=cortex-a57"]
cxxflags = ["-DQCOM", "-mcpu=cortex-a57"]
cflags = ["-DQCOM", "-D_USING_LIBCXX", "-mcpu=cortex-a57"]
cxxflags = ["-DQCOM", "-D_USING_LIBCXX", "-mcpu=cortex-a57"]
rpath = []
else:
cflags = []
@ -195,8 +204,6 @@ env = Environment(
"#phonelibs/qrcode",
"#phonelibs",
"#cereal",
"#cereal/messaging",
"#cereal/visionipc",
"#opendbc/can",
],
@ -317,7 +324,8 @@ qt_flags = [
"-DQT_QUICK_LIB",
"-DQT_QUICKWIDGETS_LIB",
"-DQT_QML_LIB",
"-DQT_CORE_LIB"
"-DQT_CORE_LIB",
"-DQT_MESSAGELOGCONTEXT",
]
qt_env['CXXFLAGS'] += qt_flags
qt_env['LIBPATH'] += ['#selfdrive/ui']
@ -399,8 +407,8 @@ SConscript(['selfdrive/modeld/SConscript'])
SConscript(['selfdrive/controls/lib/cluster/SConscript'])
SConscript(['selfdrive/controls/lib/lateral_mpc/SConscript'])
SConscript(['selfdrive/controls/lib/longitudinal_mpc/SConscript'])
SConscript(['selfdrive/controls/lib/longitudinal_mpc_model/SConscript'])
SConscript(['selfdrive/controls/lib/lead_mpc_lib/SConscript'])
SConscript(['selfdrive/controls/lib/longitudinal_mpc_lib/SConscript'])
SConscript(['selfdrive/boardd/SConscript'])
SConscript(['selfdrive/proclogd/SConscript'])

View File

@ -53,7 +53,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
lowSpeedLockout @31;
plannerError @32;
joystickDebug @34;
steerTempUnavailableUserOverride @35;
steerTempUnavailableSilent @35;
resumeRequired @36;
preDriverDistracted @37;
promptDriverDistracted @38;
@ -78,7 +78,6 @@ struct CarEvent @0x9b1657f34caf3ad3 {
stockAeb @64;
ldw @65;
carUnrecognized @66;
driverMonitorLowAcc @68;
invalidLkasSetting @69;
speedTooHigh @70;
laneChangeBlocked @71;
@ -110,6 +109,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
wideRoadCameraError @102;
localizerMalfunction @103;
driverMonitorLowAccDEPRECATED @68;
radarCanErrorDEPRECATED @15;
radarCommIssueDEPRECATED @67;
gasUnavailableDEPRECATED @3;
@ -362,12 +362,11 @@ struct CarParams {
fuzzyFingerprint @55 :Bool;
enableGasInterceptor @2 :Bool;
enableCruise @3 :Bool;
enableCamera @4 :Bool;
enableDsu @5 :Bool; # driving support unit
enableApgs @6 :Bool; # advanced parking guidance system
enableBsm @56 :Bool; # blind spot monitoring
hasStockCamera @57 :Bool; # factory LKAS/LDW camera is present
pcmCruise @3 :Bool; # is openpilot's state tied to the PCM's cruise state?
enableDsu @5 :Bool; # driving support unit
enableApgs @6 :Bool; # advanced parking guidance system
enableBsm @56 :Bool; # blind spot monitoring
hasStockCamera @57 :Bool; # factory LKAS/LDW camera is present
minEnableSpeed @7 :Float32;
minSteerSpeed @8 :Float32;
@ -564,5 +563,6 @@ struct CarParams {
gateway @1; # Integration at vehicle's CAN gateway
}
enableCameraDEPRECATED @4 :Bool;
isPandaBlackDEPRECATED @39: Bool;
}

View File

@ -123,27 +123,38 @@ struct InitData {
struct FrameData {
frameId @0 :UInt32;
encodeId @1 :UInt32; # DEPRECATED
timestampEof @2 :UInt64;
frameType @7 :FrameType;
frameLength @3 :Int32;
# Timestamps
timestampEof @2 :UInt64;
timestampSof @8 :UInt64;
# Exposure
integLines @4 :Int32;
globalGain @5 :Int32;
highConversionGain @20 :Bool;
gain @15 :Float32; # This includes highConversionGain if enabled
measuredGreyFraction @21 :Float32;
targetGreyFraction @22 :Float32;
# Focus
lensPos @11 :Int32;
lensSag @12 :Float32;
lensErr @13 :Float32;
lensTruePos @14 :Float32;
image @6 :Data;
gainFrac @15 :Float32;
focusVal @16 :List(Int16);
focusConf @17 :List(UInt8);
sharpnessScore @18 :List(UInt16);
recoverState @19 :Int32;
frameType @7 :FrameType;
timestampSof @8 :UInt64;
transform @10 :List(Float32);
androidCaptureResult @9 :AndroidCaptureResult;
image @6 :Data;
globalGainDEPRECATED @5 :Int32;
enum FrameType {
unknown @0;
neo @1;
@ -212,6 +223,8 @@ struct SensorEventData {
mmc3416x @7; # magnetometer (c2)
bmx055 @8;
rpr0521 @9;
lsm6ds3trc @10;
mmc5603nj @11;
}
}
@ -279,6 +292,7 @@ struct DeviceState @0xa4d8b5af2aa492eb {
freeSpacePercent @7 :Float32;
memoryUsagePercent @19 :Int8;
cpuUsagePercent @20 :Int8;
gpuUsagePercent @33 :Int8;
usbOnline @12 :Bool;
networkType @22 :NetworkType;
networkInfo @31 :NetworkInfo;
@ -322,6 +336,7 @@ struct DeviceState @0xa4d8b5af2aa492eb {
cell3G @3;
cell4G @4;
cell5G @5;
ethernet @6;
}
enum NetworkStrength {
@ -405,7 +420,7 @@ struct PandaState @0xa7649e2575e4591e {
registerDivergent @18;
interruptRateKlineInit @19;
interruptRateClockSource @20;
interruptRateTim9 @21;
interruptRateTick @21;
# Update max fault type in boardd when adding faults
}
@ -522,7 +537,6 @@ struct ControlsState @0x97ff69c53601abf1 {
uiAccelCmd @5 :Float32;
ufAccelCmd @33 :Float32;
aTarget @35 :Float32;
steeringAngleDesiredDeg @29 :Float32;
curvature @37 :Float32; # path curvature from vehicle model
forceDecel @51 :Bool;
@ -544,6 +558,7 @@ struct ControlsState @0x97ff69c53601abf1 {
pidState @53 :LateralPIDState;
lqrState @55 :LateralLQRState;
angleState @58 :LateralAngleState;
debugState @59 :LateralDebugState;
}
enum OpenpilotState @0xdbe58b96d2d1ac61 {
@ -615,6 +630,13 @@ struct ControlsState @0x97ff69c53601abf1 {
saturated @3 :Bool;
}
struct LateralDebugState {
active @0 :Bool;
steeringAngleDeg @1 :Float32;
output @2 :Float32;
saturated @3 :Bool;
}
# deprecated
vEgoDEPRECATED @0 :Float32;
vEgoRawDEPRECATED @32 :Float32;
@ -643,6 +665,7 @@ struct ControlsState @0x97ff69c53601abf1 {
mapValidDEPRECATED @49 :Bool;
jerkFactorDEPRECATED @12 :Float32;
steerOverrideDEPRECATED @20 :Bool;
steeringAngleDesiredDegDEPRECATED @29 :Float32;
}
struct ModelDataV2 {
@ -669,6 +692,7 @@ struct ModelDataV2 {
# predicted lead cars
leads @11 :List(LeadDataV2);
leadsV3 @18 :List(LeadDataV3);
meta @12 :MetaData;
@ -694,6 +718,25 @@ struct ModelDataV2 {
xyvaStd @3 :List(Float32);
}
struct LeadDataV3 {
prob @0 :Float32; # probability that car is your lead at time t
probTime @1 :Float32;
t @2 :List(Float32);
# x and y are relative position in device frame
# v absolute norm speed
# a is derivative of v
x @3 :List(Float32);
xStd @4 :List(Float32);
y @5 :List(Float32);
yStd @6 :List(Float32);
v @7 :List(Float32);
vStd @8 :List(Float32);
a @9 :List(Float32);
aStd @10 :List(Float32);
}
struct MetaData {
engagedProb @0 :Float32;
desirePrediction @1 :List(Float32);
@ -754,34 +797,35 @@ struct AndroidLogEntry {
}
struct LongitudinalPlan @0xe00b5b3eba12876c {
mdMonoTime @9 :UInt64;
radarStateMonoTime @10 :UInt64;
vCruise @16 :Float32;
aCruise @17 :Float32;
vTarget @3 :Float32;
vTargetFuture @14 :Float32;
vMax @20 :Float32;
aTarget @18 :Float32;
vStart @26 :Float32;
aStart @27 :Float32;
modelMonoTime @9 :UInt64;
hasLead @7 :Bool;
fcw @8 :Bool;
longitudinalPlanSource @15 :LongitudinalPlanSource;
processingDelay @29 :Float32;
# desired speed/accel/jerk over next 2.5s
accels @32 :List(Float32);
speeds @33 :List(Float32);
jerks @34 :List(Float32);
enum LongitudinalPlanSource {
cruise @0;
mpc1 @1;
mpc2 @2;
mpc3 @3;
model @4;
lead0 @1;
lead1 @2;
lead2 @3;
e2e @4;
}
# deprecated
vCruiseDEPRECATED @16 :Float32;
aCruiseDEPRECATED @17 :Float32;
vTargetDEPRECATED @3 :Float32;
vTargetFutureDEPRECATED @14 :Float32;
aTargetDEPRECATED @18 :Float32;
vStartDEPRECATED @26 :Float32;
aStartDEPRECATED @27 :Float32;
vMaxDEPRECATED @20 :Float32;
radarStateMonoTimeDEPRECATED @10 :UInt64;
jerkFactorDEPRECATED @6 :Float32;
hasLeftLaneDEPRECATED @23 :Bool;
hasRightLaneDEPRECATED @24 :Bool;
@ -819,11 +863,11 @@ struct LateralPlan @0xe1e9318e2ae8b51e {
laneChangeState @18 :LaneChangeState;
laneChangeDirection @19 :LaneChangeDirection;
# curvature is in rad/m
curvature @22 :Float32;
curvatureRate @23 :Float32;
rawCurvature @24 :Float32;
rawCurvatureRate @25 :Float32;
# desired curvatures over next 2.5s in rad/m
psis @26 :List(Float32);
curvatures @27 :List(Float32);
curvatureRates @28 :List(Float32);
enum Desire {
none @0;
@ -849,6 +893,10 @@ struct LateralPlan @0xe1e9318e2ae8b51e {
}
# deprecated
curvatureDEPRECATED @22 :Float32;
curvatureRateDEPRECATED @23 :Float32;
rawCurvatureDEPRECATED @24 :Float32;
rawCurvatureRateDEPRECATED @25 :Float32;
cProbDEPRECATED @3 :Float32;
dPolyDEPRECATED @1 :List(Float32);
cPolyDEPRECATED @2 :List(Float32);
@ -1201,6 +1249,8 @@ struct DriverState {
partialFace @18 :Float32;
distractedPose @19 :Float32;
distractedEyes @20 :Float32;
eyesOnRoad @21 :Float32;
phoneUse @22 :Float32;
irPwrDEPRECATED @10 :Float32;
descriptorDEPRECATED @1 :List(Float32);
@ -1301,6 +1351,18 @@ struct ManagerState {
}
}
struct UploaderState {
immediateQueueSize @0 :UInt32;
immediateQueueCount @1 :UInt32;
rawQueueSize @2 :UInt32;
rawQueueCount @3 :UInt32;
# stats for last successfully uploaded file
lastTime @4 :Float32; # s
lastSpeed @5 :Float32; # MB/s
lastFilename @6 :Text;
}
struct Event {
logMonoTime @0 :UInt64; # nanoseconds
valid @67 :Bool = true;
@ -1328,8 +1390,6 @@ struct Event {
longitudinalPlan @24 :LongitudinalPlan;
lateralPlan @64 :LateralPlan;
ubloxGnss @34 :UbloxGnss;
liveMpc @36 :LiveMpcData;
liveLongitudinalMpc @37 :LiveLongitudinalMpcData;
ubloxRaw @39 :Data;
gpsLocationExternal @48 :GpsLocationData;
driverState @59 :DriverState;
@ -1353,6 +1413,7 @@ struct Event {
# systems stuff
androidLog @20 :AndroidLogEntry;
managerState @78 :ManagerState;
uploaderState @79 :UploaderState;
procLog @33 :ProcLog;
clocks @35 :Clocks;
deviceState @6 :DeviceState;
@ -1364,6 +1425,8 @@ struct Event {
# *********** legacy + deprecated ***********
model @9 :Legacy.ModelData; # TODO: rename modelV2 and mark this as deprecated
liveMpcDEPRECATED @36 :LiveMpcData;
liveLongitudinalMpcDEPRECATED @37 :LiveLongitudinalMpcData;
liveLocationKalmanDEPRECATED @51 :Legacy.LiveLocationData;
orbslamCorrectionDEPRECATED @45 :Legacy.OrbslamCorrection;
liveUIDEPRECATED @14 :Legacy.LiveUI;

View File

@ -1,59 +1,74 @@
#include <iostream>
#include <string>
#include <algorithm>
#include <cassert>
#include <csignal>
#include <iostream>
#include <map>
#include <string>
typedef void (*sighandler_t)(int sig);
#include "services.h"
#include "impl_msgq.h"
#include "impl_zmq.h"
#include "services.h"
void sigpipe_handler(int sig) {
assert(sig == SIGPIPE);
std::cout << "SIGPIPE received" << std::endl;
}
static std::vector<std::string> get_services() {
std::vector<std::string> name_list;
static std::vector<std::string> get_services(std::string whitelist_str, bool zmq_to_msgq) {
std::vector<std::string> service_list;
for (const auto& it : services) {
std::string name = it.name;
if (name == "plusFrame" || name == "uiLayoutState") continue;
name_list.push_back(name);
bool in_whitelist = whitelist_str.find(name) != std::string::npos;
if (name == "plusFrame" || name == "uiLayoutState" || (zmq_to_msgq && !in_whitelist)) {
continue;
}
service_list.push_back(name);
}
return name_list;
return service_list;
}
int main(void){
int main(int argc, char** argv) {
signal(SIGPIPE, (sighandler_t)sigpipe_handler);
auto endpoints = get_services();
bool zmq_to_msgq = argc > 2;
std::string ip = zmq_to_msgq ? argv[1] : "127.0.0.1";
std::string whitelist_str = zmq_to_msgq ? std::string(argv[2]) : "";
std::map<SubSocket*, PubSocket*> sub2pub;
Context *zmq_context = new ZMQContext();
Context *msgq_context = new MSGQContext();
Poller *poller = new MSGQPoller();
for (auto endpoint: endpoints){
SubSocket * msgq_sock = new MSGQSubSocket();
msgq_sock->connect(msgq_context, endpoint, "127.0.0.1", false);
poller->registerSocket(msgq_sock);
PubSocket * zmq_sock = new ZMQPubSocket();
zmq_sock->connect(zmq_context, endpoint);
sub2pub[msgq_sock] = zmq_sock;
Poller *poller;
Context *pub_context;
Context *sub_context;
if (zmq_to_msgq) { // republishes zmq debugging messages as msgq
poller = new ZMQPoller();
pub_context = new MSGQContext();
sub_context = new ZMQContext();
} else {
poller = new MSGQPoller();
pub_context = new ZMQContext();
sub_context = new MSGQContext();
}
std::map<SubSocket*, PubSocket*> sub2pub;
for (auto endpoint: get_services(whitelist_str, zmq_to_msgq)) {
PubSocket * pub_sock;
SubSocket * sub_sock;
if (zmq_to_msgq) {
pub_sock = new MSGQPubSocket();
sub_sock = new ZMQSubSocket();
} else {
pub_sock = new ZMQPubSocket();
sub_sock = new MSGQSubSocket();
}
pub_sock->connect(pub_context, endpoint);
sub_sock->connect(sub_context, endpoint, ip, false);
while (true){
for (auto sub_sock : poller->poll(100)){
poller->registerSocket(sub_sock);
sub2pub[sub_sock] = pub_sock;
}
while (true) {
for (auto sub_sock : poller->poll(100)) {
Message * msg = sub_sock->receive();
if (msg == NULL) continue;
sub2pub[sub_sock]->sendMessage(msg);

View File

@ -19,15 +19,15 @@ class Service:
self.frequency = frequency
self.decimation = decimation
DCAM_FREQ = 10. if not TICI else 20.
services = {
"roadCameraState": (True, 20., 1), # should_log, frequency, decimation (optional)
# service: (should_log, frequency, qlog decimation (optional))
"sensorEvents": (True, 100., 100),
"gpsNMEA": (True, 9.),
"deviceState": (True, 2., 1),
"can": (True, 100.),
"controlsState": (True, 100., 100),
"features": (True, 0.),
"controlsState": (True, 100., 10),
"pandaState": (True, 2., 1),
"radarState": (True, 20., 5),
"roadEncodeIdx": (True, 20., 1),
@ -38,36 +38,29 @@ services = {
"androidLog": (True, 0., 1),
"carState": (True, 100., 10),
"carControl": (True, 100., 10),
"longitudinalPlan": (True, 20., 2),
"liveLocation": (True, 0., 1),
"longitudinalPlan": (True, 20., 5),
"procLog": (True, 0.5),
"gpsLocationExternal": (True, 10., 1),
"ubloxGnss": (True, 10.),
"clocks": (True, 1., 1),
"liveMpc": (False, 20.),
"liveLongitudinalMpc": (False, 20.),
"ubloxRaw": (True, 20.),
"liveLocationKalman": (True, 20., 2),
"uiLayoutState": (True, 0.),
"liveParameters": (True, 20., 2),
"cameraOdometry": (True, 20., 5),
"lateralPlan": (True, 20., 2),
"lateralPlan": (True, 20., 5),
"thumbnail": (True, 0.2, 1),
"carEvents": (True, 1., 1),
"carParams": (True, 0.02, 1),
"driverCameraState": (True, 10. if not TICI else 20., 1),
"driverEncodeIdx": (True, 10. if not TICI else 20., 1),
"driverState": (True, 10. if not TICI else 20., 1),
"driverMonitoringState": (True, 10. if not TICI else 20., 1),
"offroadLayout": (False, 0.),
"roadCameraState": (True, 20., 20),
"driverCameraState": (True, DCAM_FREQ, DCAM_FREQ),
"driverEncodeIdx": (True, DCAM_FREQ, 1),
"driverState": (True, DCAM_FREQ, DCAM_FREQ / 2),
"driverMonitoringState": (True, DCAM_FREQ, DCAM_FREQ / 2),
"wideRoadEncodeIdx": (True, 20., 1),
"wideRoadCameraState": (True, 20., 1),
"modelV2": (True, 20., 20),
"wideRoadCameraState": (True, 20., 20),
"modelV2": (True, 20., 40),
"managerState": (True, 2., 1),
"testModel": (False, 0.),
"testLiveLocation": (False, 0.),
"testJoystick": (False, 0.),
"uploaderState": (True, 0., 1),
}
service_list = {name: Service(new_port(idx), *vals) for # type: ignore
idx, (name, vals) in enumerate(services.items())}

View File

@ -3,7 +3,7 @@
#include <cstdint>
#include <cstddef>
constexpr int VISIONIPC_MAX_FDS = 64;
constexpr int VISIONIPC_MAX_FDS = 128;
struct VisionIpcBufExtra {
uint32_t frame_id;

View File

@ -3,9 +3,9 @@
#include <string>
#include <unistd.h>
#include "messaging.h"
#include "visionipc.h"
#include "visionbuf.h"
#include "messaging/messaging.h"
#include "visionipc/visionipc.h"
#include "visionipc/visionbuf.h"
class VisionIpcClient {
private:

View File

@ -7,9 +7,9 @@
#include <sys/socket.h>
#include <unistd.h>
#include "messaging.h"
#include "ipc.h"
#include "visionipc_server.h"
#include "messaging/messaging.h"
#include "visionipc/ipc.h"
#include "visionipc/visionipc_server.h"
std::string get_endpoint_name(std::string name, VisionStreamType type){
if (messaging_use_zmq()){

View File

@ -5,9 +5,9 @@
#include <atomic>
#include <map>
#include "messaging.h"
#include "visionipc.h"
#include "visionbuf.h"
#include "messaging/messaging.h"
#include "visionipc/visionipc.h"
#include "visionipc/visionbuf.h"
std::string get_endpoint_name(std::string name, VisionStreamType type);

View File

@ -17,12 +17,12 @@ cdef extern from "selfdrive/common/params.h":
ALL
cdef cppclass Params:
Params(bool)
Params(string)
Params(bool) nogil
Params(string) nogil
string get(string, bool) nogil
bool getBool(string)
int remove(string)
int put(string, string)
int putBool(string, bool)
bool checkKey(string)
bool getBool(string) nogil
int remove(string) nogil
int put(string, string) nogil
int putBool(string, bool) nogil
bool checkKey(string) nogil
void clearAll(ParamKeyType)

View File

@ -31,10 +31,14 @@ cdef class Params:
cdef c_Params* p
def __cinit__(self, d=None, bool persistent_params=False):
cdef string path
if d is None:
self.p = new c_Params(persistent_params)
with nogil:
self.p = new c_Params(persistent_params)
else:
self.p = new c_Params(<string>d.encode())
path = <string>d.encode()
with nogil:
self.p = new c_Params(path)
def __dealloc__(self):
del self.p
@ -53,13 +57,12 @@ cdef class Params:
return key
def get(self, key, block=False, encoding=None):
def get(self, key, bool block=False, encoding=None):
cdef string k = self.check_key(key)
cdef bool b = block
cdef string val
with nogil:
val = self.p.get(k, b)
val = self.p.get(k, block)
if val == b"":
if block:
@ -76,7 +79,10 @@ cdef class Params:
def get_bool(self, key):
cdef string k = self.check_key(key)
return self.p.getBool(k)
cdef bool r
with nogil:
r = self.p.getBool(k)
return r
def put(self, key, dat):
"""
@ -86,16 +92,19 @@ cdef class Params:
in general try to avoid writing params as much as possible.
"""
cdef string k = self.check_key(key)
dat = ensure_bytes(dat)
self.p.put(k, dat)
cdef string dat_bytes = ensure_bytes(dat)
with nogil:
self.p.put(k, dat_bytes)
def put_bool(self, key, val):
def put_bool(self, key, bool val):
cdef string k = self.check_key(key)
self.p.putBool(k, val)
with nogil:
self.p.putBool(k, val)
def delete(self, key):
cdef string k = self.check_key(key)
self.p.remove(k)
with nogil:
self.p.remove(k)
def put_nonblocking(key, val, d=None):

View File

@ -557,7 +557,7 @@ struct Updater {
// TODO: this should be generic between android versions
// IPowerManager.reboot(confirm=false, reason="recovery", wait=true)
system("service call power 16 i32 0 s16 recovery i32 1");
while(1) pause();
while (true) pause();
// execl("/system/bin/reboot", "recovery");
// set_error("failed to reboot into recovery");

View File

@ -84,7 +84,6 @@ function two_init {
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
@ -97,68 +96,18 @@ function tici_init {
sudo su -c 'echo "performance" > /sys/class/devfreq/soc:qcom,memlat-cpu0/governor'
sudo su -c 'echo "performance" > /sys/class/devfreq/soc:qcom,memlat-cpu4/governor'
nmcli connection modify --temporary lte gsm.auto-config yes
nmcli connection modify --temporary lte gsm.home-only yes
# set success flag for current boot slot
sudo abctl --set_success
# Check if AGNOS update is required
if [ $(< /VERSION) != "$AGNOS_VERSION" ]; then
# Get number of slot to switch to
CUR_SLOT=$(abctl --boot_slot)
if [[ "$CUR_SLOT" == "_a" ]]; then
OTHER_SLOT="_b"
OTHER_SLOT_NUMBER="1"
else
OTHER_SLOT="_a"
OTHER_SLOT_NUMBER="0"
fi
echo "Cur slot $CUR_SLOT, target $OTHER_SLOT"
# Get expected hashes from manifest
MANIFEST="$DIR/selfdrive/hardware/tici/agnos.json"
SYSTEM_HASH_EXPECTED=$(jq -r ".[] | select(.name == \"system\") | .hash_raw" $MANIFEST)
SYSTEM_SIZE=$(jq -r ".[] | select(.name == \"system\") | .size" $MANIFEST)
BOOT_HASH_EXPECTED=$(jq -r ".[] | select(.name == \"boot\") | .hash_raw" $MANIFEST)
BOOT_SIZE=$(jq -r ".[] | select(.name == \"boot\") | .size" $MANIFEST)
echo "Expected hashes:"
echo "System: $SYSTEM_HASH_EXPECTED"
echo "Boot: $BOOT_HASH_EXPECTED"
$DIR/selfdrive/hardware/tici/agnos.py --swap $MANIFEST
# Read hashes from alternate partitions, should already be flashed by updated
SYSTEM_HASH=$(dd if="/dev/disk/by-partlabel/system$OTHER_SLOT" bs=1 skip="$SYSTEM_SIZE" count=64 2>/dev/null)
BOOT_HASH=$(dd if="/dev/disk/by-partlabel/boot$OTHER_SLOT" bs=1 skip="$BOOT_SIZE" count=64 2>/dev/null)
echo "Found hashes:"
echo "System: $SYSTEM_HASH"
echo "Boot: $BOOT_HASH"
if [[ "$SYSTEM_HASH" == "$SYSTEM_HASH_EXPECTED" && "$BOOT_HASH" == "$BOOT_HASH_EXPECTED" ]]; then
echo "Swapping active slot to $OTHER_SLOT_NUMBER"
# Clean hashes before swapping to prevent looping
dd if=/dev/zero of="/dev/disk/by-partlabel/system$OTHER_SLOT" bs=1 seek="$SYSTEM_SIZE" count=64
dd if=/dev/zero of="/dev/disk/by-partlabel/boot$OTHER_SLOT" bs=1 seek="$BOOT_SIZE" count=64
sync
abctl --set_active "$OTHER_SLOT_NUMBER"
sleep 1
sudo reboot
else
echo "Hash mismatch, downloading agnos"
if $DIR/selfdrive/hardware/tici/agnos.py $MANIFEST; then
echo "Download done, swapping active slot to $OTHER_SLOT_NUMBER"
# Clean hashes before swapping to prevent looping
dd if=/dev/zero of="/dev/disk/by-partlabel/system$OTHER_SLOT" bs=1 seek="$SYSTEM_SIZE" count=64
dd if=/dev/zero of="/dev/disk/by-partlabel/boot$OTHER_SLOT" bs=1 seek="$BOOT_SIZE" count=64
sync
abctl --set_active "$OTHER_SLOT_NUMBER"
fi
sleep 1
sudo reboot
fi
sleep 1
sudo reboot
fi
}
@ -211,7 +160,7 @@ function launch {
# handle pythonpath
ln -sfn $(pwd) /data/pythonpath
export PYTHONPATH="$PWD"
export PYTHONPATH="$PWD:$PWD/pyextra"
# hardware specific init
if [ -f /EON ]; then

View File

@ -11,7 +11,7 @@ if [ -z "$REQUIRED_NEOS_VERSION" ]; then
fi
if [ -z "$AGNOS_VERSION" ]; then
export AGNOS_VERSION="0.18"
export AGNOS_VERSION="0.21"
fi
if [ -z "$PASSIVE" ]; then

View File

@ -275,7 +275,7 @@ BO_ 316 GAS_PEDAL: 8 PCM
BO_ 342 STEERING_SENSORS: 6 EPS
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 43|4@0+ (1,0) [0|3] "" EON

View File

@ -257,7 +257,7 @@ CM_ "acura_rdx_2018_can.dbc starts here";
BO_ 342 STEERING_SENSORS: 6 EPS
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON

View File

@ -69,7 +69,7 @@ BO_ 232 BRAKE_HOLD: 7 XXX
BO_ 342 STEERING_SENSORS: 6 EPS
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON

View File

@ -5,9 +5,11 @@ unsigned int honda_checksum(unsigned int address, uint64_t d, int l) {
d >>= 4; // remove checksum
int s = 0;
bool extended = address > 0x7FF; // extended can
while (address) { s += (address & 0xF); address >>= 4; }
while (d) { s += (d & 0xF); d >>= 4; }
s = 8-s;
if (extended) s += 3;
s &= 0xF;
return s;

View File

@ -370,6 +370,48 @@ BO_ 891 STALK_STATUS_2: 8 XXX
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
BO_ 13274 LKAS_HUD_A: 5 ADAS
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY
BO_ 13275 LKAS_HUD_B: 8 ADAS
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" BDY
CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event";
CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event";
CM_ SG_ 479 AEB_PREPARE "set 1s before AEB";

View File

@ -370,6 +370,48 @@ BO_ 891 STALK_STATUS_2: 8 XXX
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
BO_ 13274 LKAS_HUD_A: 5 ADAS
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY
BO_ 13275 LKAS_HUD_B: 8 ADAS
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" BDY
CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event";
CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event";
CM_ SG_ 479 AEB_PREPARE "set 1s before AEB";

View File

@ -370,6 +370,48 @@ BO_ 891 STALK_STATUS_2: 8 XXX
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
BO_ 13274 LKAS_HUD_A: 5 ADAS
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY
BO_ 13275 LKAS_HUD_B: 8 ADAS
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" BDY
CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event";
CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event";
CM_ SG_ 479 AEB_PREPARE "set 1s before AEB";

View File

@ -370,6 +370,48 @@ BO_ 891 STALK_STATUS_2: 8 XXX
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
BO_ 13274 LKAS_HUD_A: 5 ADAS
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY
BO_ 13275 LKAS_HUD_B: 8 ADAS
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" BDY
CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event";
CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event";
CM_ SG_ 479 AEB_PREPARE "set 1s before AEB";

View File

@ -370,6 +370,48 @@ BO_ 891 STALK_STATUS_2: 8 XXX
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
BO_ 13274 LKAS_HUD_A: 5 ADAS
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY
BO_ 13275 LKAS_HUD_B: 8 ADAS
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" BDY
CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event";
CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event";
CM_ SG_ 479 AEB_PREPARE "set 1s before AEB";

View File

@ -257,7 +257,7 @@ CM_ "honda_crv_touring_2016_can.dbc starts here";
BO_ 342 STEERING_SENSORS: 6 EPS
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON

View File

@ -275,7 +275,7 @@ BO_ 304 GAS_PEDAL_2: 8 PCM
BO_ 342 STEERING_SENSORS: 6 EPS
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 43|4@0+ (1,0) [0|3] "" EON

View File

@ -271,7 +271,7 @@ BO_ 316 GAS_PEDAL: 8 PCM
BO_ 342 STEERING_SENSORS: 6 EPS
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 43|4@0+ (1,0) [0|3] "" EON

View File

@ -370,6 +370,48 @@ BO_ 891 STALK_STATUS_2: 8 XXX
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
BO_ 13274 LKAS_HUD_A: 5 ADAS
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY
BO_ 13275 LKAS_HUD_B: 8 ADAS
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
SG_ SET_ME_X01 : 20|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" BDY
CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event";
CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event";
CM_ SG_ 479 AEB_PREPARE "set 1s before AEB";

View File

@ -267,7 +267,7 @@ BO_ 316 GAS_PEDAL: 8 PCM
BO_ 342 STEERING_SENSORS: 6 EPS
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 43|4@0+ (1,0) [0|3] "" EON

View File

@ -275,7 +275,7 @@ BO_ 316 GAS_PEDAL: 8 PCM
BO_ 342 STEERING_SENSORS: 6 EPS
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 43|4@0+ (1,0) [0|3] "" EON

View File

@ -270,7 +270,7 @@ BO_ 316 GAS_PEDAL: 8 PCM
BO_ 342 STEERING_SENSORS: 6 EPS
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON
SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 43|4@0+ (1,0) [0|3] "" EON

View File

@ -1028,10 +1028,7 @@ BO_ 48 EMS18: 6 EMS
BO_ 1322 CLU15: 8 CLU
SG_ CF_Clu_VehicleSpeed : 0|8@1+ (1.0,0.0) [0.0|255.0] "" BCM
SG_ CF_Clu_InhibitP : 9|1@1+ (1.0,0.0) [0.0|1.0] "" BCM
SG_ CF_Clu_InhibitR : 10|1@1+ (1.0,0.0) [0.0|1.0] "" BCM
SG_ CF_Clu_InhibitN : 11|1@1+ (1.0,0.0) [0.0|1.0] "" BCM
SG_ CF_Clu_InhibitD : 12|1@1+ (1.0,0.0) [0.0|1.0] "" BCM
SG_ CF_Clu_Gear : 9|4@1+ (1,0) [0|15] "" BCM
SG_ CF_Clu_HudInfoSet : 13|7@1+ (1.0,0.0) [0.0|127.0] "" HUD
SG_ CF_Clu_HudFontColorSet : 20|2@1+ (1.0,0.0) [0.0|3.0] "" HUD
SG_ CF_Clu_HudBrightUpSW : 22|2@1+ (1.0,0.0) [0.0|3.0] "" HUD
@ -1196,7 +1193,7 @@ BO_ 1313 GW_DDM_PE: 8 BCM
SG_ C_RRDoorStatus : 6|2@1+ (1.0,0.0) [0.0|3.0] "" CLU
SG_ C_TrunkStatus : 8|2@1+ (1.0,0.0) [0.0|3.0] "" CLU
SG_ C_OSMirrorStatus : 10|2@1+ (1.0,0.0) [0.0|3.0] "" CLU
BO_ 1056 SCC11: 8 SCC
SG_ MainMode_ACC : 0|1@1+ (1,0) [0|1] "" CLU,EMS,ESC
SG_ SCCInfoDisplay : 1|3@1+ (1,0) [0|7] "" CLU,ESC
@ -1523,7 +1520,8 @@ BO_ 881 E_EMS11: 8 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
SG_ Accel_Pedal_Pos : 31|8@1+ (1,0) [0|254] "" XXX
SG_ CR_Vcu_AccPedDep_Pos : 56|8@1+ (1,0) [0|254] "" XXX
BO_ 1355 EV_PC6: 8 CGW
SG_ CF_Vcu_SbwWarnMsg : 16|3@1+ (1,0) [0|7] "" Vector__XXX
@ -1639,8 +1637,14 @@ BO_ 1042 ICM_412h: 8 ICM
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_ 274 CUR_GR 1 "D" 2 "D" 3 "D" 4 "D" 5 "D" 6 "D" 7 "D" 8 "D" 14 "R" 0 "P";
VAL_ 871 CF_Lvr_Gear 5 "D" 8 "S" 6 "N" 7 "R" 0 "P";
VAL_ 882 Elect_Gear_Shifter 5 "D" 8 "S" 6 "N" 7 "R" 0 "P";
VAL_ 1322 CF_Clu_Gear 1 "P" 2 "R" 4 "N" 8 "D";
VAL_ 909 CF_VSM_Warn 2 "FCW" 3 "AEB";
VAL_ 1157 LFA_Icon_State 0 "no_wheel" 1 "white_wheel" 2 "green_wheel" 3 "green_wheel_blink";
VAL_ 1157 LFA_SysWarning 0 "no_message" 1 "switching_to_hda" 2 "switching_to_scc" 3 "lfa_error" 4 "check_hda" 5 "keep_hands_on_wheel_orange" 6 "keep_hands_on_wheel_red";
VAL_ 1157 HDA_Icon_State 0 "no_hda" 1 "white_hda" 2 "green_hda";
VAL_ 1157 HDA_SysWarning 0 "no_message" 1 "driving_convenience_systems_cancelled" 2 "highway_drive_assist_system_cancelled";
CM_ "BO_ E_EMS11: All (plug-in) hybrids use this gas signal: CR_Vcu_AccPedDep_Pos, and all EVs use the Accel_Pedal_Pos signal. See hyundai/values.py for a specific car list";

View File

@ -163,7 +163,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -196,6 +196,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -333,6 +336,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -360,6 +364,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -163,7 +163,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -196,6 +196,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -333,6 +336,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -360,6 +364,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -163,7 +163,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -196,6 +196,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -333,6 +336,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -360,6 +364,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -163,7 +163,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -196,6 +196,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -333,6 +336,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -360,6 +364,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -163,7 +163,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -196,6 +196,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -333,6 +336,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -360,6 +364,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -163,7 +163,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -196,6 +196,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -333,6 +336,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -360,6 +364,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -0,0 +1,734 @@
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_:
NEO
MCU
GTW
EPAS
DI
ESP
SBW
STW
APP
DAS
XXX
VAL_TABLE_ StW_AnglHP_Spd 16383 "SNA" ;
VAL_TABLE_ DI_aebFaultReason 15 "DI_AEB_FAULT_DAS_REQ_DI_UNAVAIL" 14 "DI_AEB_FAULT_ACCEL_REQ_INVALID" 13 "DI_AEB_FAULT_MIN_TIME_BTWN_EVENTS" 12 "DI_AEB_FAULT_ESP_MIA" 11 "DI_AEB_FAULT_ESP_FAULT" 10 "DI_AEB_FAULT_EPB_NOT_PARKED" 9 "DI_AEB_FAULT_ACCEL_OUT_OF_BOUNDS" 8 "DI_AEB_FAULT_PM_REQUEST" 7 "DI_AEB_FAULT_VEL_EST_ABNORMAL" 6 "DI_AEB_FAULT_DAS_SNA" 5 "DI_AEB_FAULT_DAS_CONTROL_MIA" 4 "DI_AEB_FAULT_SPEED_DELTA" 3 "DI_AEB_FAULT_EBR_FAULT" 2 "DI_AEB_FAULT_PM_MIA" 1 "DI_AEB_FAULT_EPB_MIA" 0 "DI_AEB_FAULT_NONE" ;
VAL_TABLE_ DI_aebLockState 3 "AEB_LOCK_STATE_SNA" 2 "AEB_LOCK_STATE_UNUSED" 1 "AEB_LOCK_STATE_UNLOCKED" 0 "AEB_LOCK_STATE_LOCKED" ;
VAL_TABLE_ DI_aebSmState 7 "DI_AEB_STATE_FAULT" 6 "DI_AEB_STATE_EXIT" 5 "DI_AEB_STATE_STANDSTILL" 4 "DI_AEB_STATE_STOPPING" 3 "DI_AEB_STATE_ENABLE" 2 "DI_AEB_STATE_ENABLE_INIT" 1 "DI_AEB_STATE_STANDBY" 0 "DI_AEB_STATE_UNAVAILABLE" ;
VAL_TABLE_ DI_aebState 7 "AEB_CAN_STATE_SNA" 4 "AEB_CAN_STATE_FAULT" 3 "AEB_CAN_STATE_STANDSTILL" 2 "AEB_CAN_STATE_ENABLED" 1 "AEB_CAN_STATE_STANDBY" 0 "AEB_CAN_STATE_UNAVAILABLE" ;
VAL_TABLE_ DI_epbInterfaceReady 1 "EPB_INTERFACE_READY" 0 "EPB_INTERFACE_NOT_READY" ;
VAL_TABLE_ DI_gear 7 "DI_GEAR_SNA" 4 "DI_GEAR_D" 3 "DI_GEAR_N" 2 "DI_GEAR_R" 1 "DI_GEAR_P" 0 "DI_GEAR_INVALID" ;
VAL_TABLE_ DI_gpoReason 8 "DI_GPO_NUMREASONS" 7 "DI_GPO_CAPACITOR_OVERTEMP" 6 "DI_GPO_NOT_ENOUGH_12V" 5 "DI_GPO_NO_BATTERY_POWER" 4 "DI_GPO_AMBIENT_OVERTEMP" 3 "DI_GPO_FLUID_DELTAT" 2 "DI_GPO_STATOR_OVERTEMP" 1 "DI_GPO_HEATSINK_OVERTEMP" 0 "DI_GPO_OUTLET_OVERTEMP" ;
VAL_TABLE_ DI_immobilizerCondition 1 "DI_IMM_CONDITION_LEARNED" 0 "DI_IMM_CONDITION_VIRGIN_SNA" ;
VAL_TABLE_ DI_immobilizerState 7 "DI_IMM_STATE_FAULT" 6 "DI_IMM_STATE_FAULTRETRY" 5 "DI_IMM_STATE_RESET" 4 "DI_IMM_STATE_LEARN" 3 "DI_IMM_STATE_DISARMED" 2 "DI_IMM_STATE_AUTHENTICATING" 1 "DI_IMM_STATE_REQUEST" 0 "DI_IMM_STATE_INIT_SNA" ;
VAL_TABLE_ DI_limpReason 24 "DI_LIMP_NUMREASONS" 23 "DI_LIMP_CAPACITOR_OVERTEMP" 22 "DI_LIMP_GTW_MIA" 21 "DI_LIMP_TRQCMD_VALIDITY_UNKNOWN" 20 "DI_LIMP_DI_MIA" 19 "DI_LIMP_CONFIG_MISMATCH" 18 "DI_LIMP_HEATSINK_TEMP" 17 "DI_LIMP_PMREQUEST" 16 "DI_LIMP_PMHEARTBEAT" 15 "DI_LIMP_TRQ_CROSS_CHECK" 14 "DI_LIMP_EXTERNAL_COMMAND" 13 "DI_LIMP_WRONG_CS_CALIBRATION" 12 "DI_LIMP_STATOR_TEMP" 11 "DI_LIMP_DELTAT_TOO_NEGATIVE" 10 "DI_LIMP_DELTAT_TOO_POSITIVE" 9 "DI_LIMP_AMBIENT_TEMP" 8 "DI_LIMP_OUTLET_TEMP" 7 "DI_LIMP_LOW_FLOW" 6 "DI_LIMP_BMS_MIA" 5 "DI_LIMP_12V_SUPPLY_UNDERVOLTAGE" 4 "DI_LIMP_NO_FLUID" 3 "DI_LIMP_NO_FUNC_HEATSINK_SENSOR" 2 "DI_LIMP_NO_FUNC_STATORT_SENSOR" 1 "DI_LIMP_BUSV_SENSOR_IRRATIONAL" 0 "DI_LIMP_PHASE_IMBALANCE" ;
VAL_TABLE_ DI_mode 2 "DI_MODE_DYNO" 1 "DI_MODE_DRIVE" 0 "DI_MODE_UNDEF" ;
VAL_TABLE_ DI_motorType 14 "DI_MOTOR_F2AE" 13 "DI_MOTOR_F2AD" 12 "DI_MOTOR_F2AC" 11 "DI_MOTOR_F2AB" 10 "DI_MOTOR_F1AC" 9 "DI_MOTOR_SSR1A" 8 "DI_MOTOR_F1A" 7 "DI_MOTOR_M7M6" 6 "DI_MOTOR_M8A" 5 "DI_MOTOR_M7M5" 4 "DI_MOTOR_M7M4" 3 "DI_MOTOR_M7M3" 2 "DI_MOTOR_ROADSTER_SPORT" 1 "DI_MOTOR_ROADSTER_BASE" 0 "DI_MOTOR_SNA" ;
VAL_TABLE_ DI_speedUnits 1 "DI_SPEED_KPH" 0 "DI_SPEED_MPH" ;
VAL_TABLE_ DI_state 4 "DI_STATE_ENABLE" 3 "DI_STATE_FAULT" 2 "DI_STATE_CLEAR_FAULT" 1 "DI_STATE_STANDBY" 0 "DI_STATE_PREAUTH" ;
VAL_TABLE_ DI_velocityEstimatorState 4 "VE_STATE_BACKUP_MOTOR" 3 "VE_STATE_BACKUP_WHEELS_B" 2 "VE_STATE_BACKUP_WHEELS_A" 1 "VE_STATE_WHEELS_NORMAL" 0 "VE_STATE_NOT_INITIALIZED" ;
BO_ 1160 DAS_steeringControl: 4 NEO
SG_ DAS_steeringControlType : 23|2@0+ (1,0) [0|0] "" EPAS
SG_ DAS_steeringControlChecksum : 31|8@0+ (1,0) [0|0] "" EPAS
SG_ DAS_steeringControlCounter : 19|4@0+ (1,0) [0|0] "" EPAS
SG_ DAS_steeringAngleRequest : 6|15@0+ (0.1,-1638.35) [-1638.35|1638.35] "deg" EPAS
SG_ DAS_steeringHapticRequest : 7|1@0+ (1,0) [0|0] "" EPAS
BO_ 257 GTW_epasControl: 3 NEO
SG_ GTW_epasControlChecksum : 23|8@0+ (1,0) [0|255] "" NEO
SG_ GTW_epasControlCounter : 11|4@0+ (1,0) [0|15] "" NEO
SG_ GTW_epasControlType : 15|2@0+ (1,0) [-1|4] "" NEO
SG_ GTW_epasEmergencyOn : 7|1@0+ (1,0) [-1|2] "" NEO
SG_ GTW_epasLDWEnabled : 12|1@0+ (1,0) [-1|2] "" NEO
SG_ GTW_epasPowerMode : 6|4@0+ (1,0) [4|14] "" NEO
SG_ GTW_epasTuneRequest : 2|3@0+ (1,0) [-1|8] "" NEO
BO_ 880 EPAS_sysStatus: 8 EPAS
SG_ EPAS_currentTuneMode : 7|4@0+ (1,0) [8|15] "" NEO
SG_ EPAS_eacErrorCode : 23|4@0+ (1,0) [-1|16] "" NEO
SG_ EPAS_eacStatus : 55|3@0+ (1,0) [5|7] "" NEO
SG_ EPAS_handsOnLevel : 39|2@0+ (1,0) [-1|4] "" NEO
SG_ EPAS_internalSAS : 37|14@0+ (0.1,-819.200012) [0|0] "deg" NEO
SG_ EPAS_steeringFault : 2|1@0+ (1,0) [-1|2] "" NEO
SG_ EPAS_steeringRackForce : 1|10@0+ (50,-25575) [0|0] "N" NEO
SG_ EPAS_steeringReduced : 3|1@0+ (1,0) [-1|2] "" NEO
SG_ EPAS_sysStatusChecksum : 63|8@0+ (1,0) [0|255] "" NEO
SG_ EPAS_sysStatusCounter : 51|4@0+ (1,0) [0|15] "" NEO
SG_ EPAS_torsionBarTorque : 19|12@0+ (0.01,-20.5) [0|0] "Nm" NEO
BO_ 3 STW_ANGL_STAT: 8 STW
SG_ StW_Angl : 5|14@0+ (0.5,-2048) [0|0] "deg" NEO
SG_ StW_AnglSpd : 21|14@0+ (0.5,-2048) [0|0] "/s" NEO
SG_ StW_AnglSens_Stat : 33|2@0+ (1,0) [-1|4] "" NEO
SG_ StW_AnglSens_Id : 35|2@0+ (1,0) [3|3] "" NEO
SG_ MC_STW_ANGL_STAT : 55|4@0+ (1,0) [0|15] "" NEO
SG_ CRC_STW_ANGL_STAT : 63|8@0+ (1,0) [0|255] "" NEO
BO_ 14 STW_ANGLHP_STAT: 8 STW
SG_ StW_AnglHP : 5|14@0+ (0.1,-819.2) [-819.2|819] "deg" NEO
SG_ StW_AnglHP_Spd : 21|14@0+ (0.5,-4096) [-4096|4095.5] "deg/s" NEO
SG_ StW_AnglHP_Sens_Stat : 33|2@0+ (1,0) [0|0] "" NEO
SG_ StW_AnglHP_Sens_Id : 35|2@0+ (1,0) [0|0] "" NEO
SG_ MC_STW_ANGLHP_STAT : 55|4@0+ (1,0) [0|15] "" NEO
SG_ CRC_STW_ANGLHP_STAT : 63|8@0+ (1,0) [0|0] "" NEO
BO_ 264 DI_torque1: 8 DI
SG_ DI_torqueDriver : 0|13@1- (0.25,0) [-750|750] "Nm" NEO
SG_ DI_torque1Counter : 13|3@1+ (1,0) [0|0] "" NEO
SG_ DI_torqueMotor : 16|13@1- (0.25,0) [-750|750] "Nm" NEO
SG_ DI_soptState : 29|3@1+ (1,0) [0|0] "" NEO
SG_ DI_motorRPM : 32|16@1- (1,0) [-17000|17000] "RPM" NEO
SG_ DI_pedalPos : 48|8@1+ (0.4,0) [0|100] "%" NEO
SG_ DI_torque1Checksum : 56|8@1+ (1,0) [0|0] "" NEO
BO_ 280 DI_torque2: 6 DI
SG_ DI_torqueEstimate : 0|12@1- (0.5,0) [-750|750] "Nm" NEO
SG_ DI_gear : 12|3@1+ (1,0) [0|0] "" NEO
SG_ DI_brakePedal : 15|1@1+ (1,0) [0|0] "" NEO
SG_ DI_vehicleSpeed : 16|12@1+ (0.05,-25) [-25|179.75] "MPH" NEO
SG_ DI_gearRequest : 28|3@1+ (1,0) [0|0] "" NEO
SG_ DI_torqueInterfaceFailure : 31|1@1+ (1,0) [0|0] "" NEO
SG_ DI_torque2Counter : 32|4@1+ (1,0) [0|0] "" NEO
SG_ DI_brakePedalState : 36|2@1+ (1,0) [0|0] "" NEO
SG_ DI_epbParkRequest : 38|1@1+ (1,0) [0|0] "" NEO
SG_ DI_epbInterfaceReady : 39|1@1+ (1,0) [0|0] "" NEO
SG_ DI_torque2Checksum : 40|8@1+ (1,0) [0|0] "" NEO
BO_ 309 ESP_135h: 5 ESP
SG_ ESP_135hChecksum : 23|8@0+ (1,0) [0|255] "" NEO
SG_ ESP_135hCounter : 11|4@0+ (1,0) [0|15] "" NEO
SG_ ESP_absBrakeEvent : 2|1@0+ (1,0) [-1|2] "" NEO
SG_ ESP_brakeDiscWipingActive : 4|1@0+ (1,0) [-1|2] "" NEO
SG_ ESP_brakeLamp : 3|1@0+ (1,0) [-1|2] "" NEO
SG_ ESP_espFaultLamp : 6|1@0+ (1,0) [-1|2] "" NEO
SG_ ESP_espLampFlash : 7|1@0+ (1,0) [-1|2] "" NEO
SG_ ESP_hillStartAssistActive : 1|2@0+ (1,0) [-1|4] "" NEO
SG_ ESP_messagePumpService : 24|1@0+ (1,0) [0|1] "" NEO
SG_ ESP_messagePumpFailure : 25|1@0+ (1,0) [0|1] "" NEO
SG_ ESP_messageEBDFailure : 26|1@0+ (1,0) [0|1] "" NEO
SG_ ESP_absFaultLamp : 27|1@0+ (1,0) [-1|2] "" NEO
SG_ ESP_tcDisabledByFault : 28|1@0+ (1,0) [0|1] "" NEO
SG_ ESP_messageDynoModeActive : 29|1@0+ (1,0) [0|1] "" NEO
SG_ ESP_hydraulicBoostEnabled : 30|1@0+ (1,0) [0|1] "" NEO
SG_ ESP_espOffLamp : 31|1@0+ (1,0) [-1|2] "" NEO
SG_ ESP_stabilityControlSts : 14|3@0+ (1,0) [6|7] "" NEO
SG_ ESP_tcLampFlash : 5|1@0+ (1,0) [-1|2] "" NEO
SG_ ESP_tcOffLamp : 15|1@0+ (1,0) [0|1] "" NEO
BO_ 341 ESP_B: 8 ESP
SG_ ESP_BChecksum : 39|8@0+ (1,0) [0|255] "" NEO,EPAS
SG_ ESP_BCounter : 62|4@0+ (1,0) [1|15] "" NEO,EPAS
SG_ ESP_vehicleSpeed : 47|16@0+ (0.00999999978,0) [0|0] "kph" NEO,EPAS
SG_ ESP_vehicleSpeedQF : 57|2@0+ (1,0) [1|2] "" NEO,EPAS
SG_ ESP_wheelPulseCountFrL : 7|8@0+ (1,0) [0|254] "" NEO,EPAS
SG_ ESP_wheelPulseCountFrR : 15|8@0+ (1,0) [0|254] "" NEO,EPAS
SG_ ESP_wheelPulseCountReL : 23|8@0+ (1,0) [0|254] "" NEO,EPAS
SG_ ESP_wheelPulseCountReR : 31|8@0+ (1,0) [0|254] "" NEO,EPAS
BO_ 513 SDM1: 5 GTW
SG_ SDM_bcklPassStatus : 3|2@0+ (1,0) [0|3] "" NEO
SG_ SDM_bcklDrivStatus : 5|2@0+ (1,0) [0|3] "" NEO
BO_ 532 EPB_epasControl: 3 EPB
SG_ EPB_epasControlChecksum : 23|8@0+ (1,0) [0|255] "" NEO,EPAS
SG_ EPB_epasControlCounter : 11|4@0+ (1,0) [0|15] "" NEO,EPAS
SG_ EPB_epasEACAllow : 2|3@0+ (1,0) [4|7] "" NEO,EPAS
BO_ 792 GTW_carState: 8 GTW
SG_ YEAR : 0|7@1+ (1,2000) [2000|2127] "Year" NEO
SG_ CERRD : 7|1@1+ (1,0) [0|1] "" NEO
SG_ MONTH : 8|4@1+ (1,0) [1|12] "Month" NEO
SG_ DOOR_STATE_FL : 12|2@1+ (1,0) [0|3] "" NEO
SG_ DOOR_STATE_FR : 14|2@1+ (1,0) [0|3] "" NEO
SG_ SECOND : 16|6@1+ (1,0) [0|59] "s" NEO
SG_ DOOR_STATE_RL : 22|2@1+ (1,0) [0|3] "" NEO
SG_ Hour : 24|5@1+ (1,0) [0|23] "h" NEO
SG_ DOOR_STATE_RR : 29|2@1+ (1,0) [0|3] "" NEO
SG_ DAY : 32|5@1+ (1,0) [0|31] "" NEO
SG_ MINUTE : 40|6@1+ (1,0) [0|59] "min" NEO
SG_ BOOT_STATE : 46|2@1+ (1,0) [0|3] "" NEO
SG_ GTW_updateInProgress : 48|2@1+ (1,0) [0|3] "" NEO
SG_ DOOR_STATE_FrontTrunk : 50|2@1+ (1,0) [0|3] "" NEO
SG_ MCU_factoryMode : 52|1@1+ (1,0) [0|1] "" NEO
SG_ MCU_transportModeOn : 53|1@0+ (1,0) [0|1] "" NEO
SG_ BC_headLightLStatus : 55|2@0+ (1,0) [0|3] "" NEO
SG_ BC_headLightRStatus : 57|2@0+ (1,0) [0|3] "" NEO
SG_ BC_indicatorLStatus : 59|2@0+ (1,0) [0|3] "" NEO
SG_ BC_indicatorRStatus : 61|2@0+ (1,0) [0|3] "" NEO
BO_ 872 DI_state: 8 DI
SG_ DI_systemState : 0|3@1+ (1,0) [0|0] "" NEO
SG_ DI_vehicleHoldState : 3|3@1+ (1,0) [0|0] "" NEO
SG_ DI_proximity : 6|1@1+ (1,0) [0|0] "" NEO
SG_ DI_driveReady : 7|1@1+ (1,0) [0|0] "" NEO
SG_ DI_regenLight : 8|1@1+ (1,0) [0|0] "" NEO
SG_ DI_state : 9|3@1+ (1,0) [0|0] "" NEO
SG_ DI_cruiseState : 12|4@1+ (1,0) [0|0] "" NEO
SG_ DI_analogSpeed : 16|12@1+ (0.1,0) [0|150] "speed" NEO
SG_ DI_immobilizerState : 28|3@1+ (1,0) [0|0] "" NEO
SG_ DI_speedUnits : 31|1@1+ (1,0) [0|1] "" NEO
SG_ DI_cruiseSet : 32|9@1+ (0.5,0) [0|255.5] "speed" NEO
SG_ DI_aebState : 41|3@1+ (1,0) [0|0] "" NEO
SG_ DI_stateCounter : 44|4@1+ (1,0) [0|0] "" NEO
SG_ DI_digitalSpeed : 48|8@1+ (1,0) [0|250] "" NEO
SG_ DI_stateChecksum : 56|8@1+ (1,0) [0|0] "" NEO
BO_ 109 SBW_RQ_SCCM: 4 STW
SG_ StW_Sw_Stat3 : 0|3@1+ (1,0) [0|0] "" NEO
SG_ MsgTxmtId : 6|2@1+ (1,0) [0|0] "" NEO
SG_ TSL_RND_Posn_StW : 8|4@1+ (1,0) [0|0] "" NEO
SG_ TSL_P_Psd_StW : 12|2@1+ (1,0) [0|0] "" NEO
SG_ MC_SBW_RQ_SCCM : 20|4@1+ (1,0) [0|15] "" NEO
SG_ CRC_SBW_RQ_SCCM : 24|8@1+ (1,0) [0|0] "" NEO
BO_ 69 STW_ACTN_RQ: 8 STW
SG_ SpdCtrlLvr_Stat : 0|6@1+ (1,0) [0|0] "" NEO
SG_ VSL_Enbl_Rq : 6|1@1+ (1,0) [0|0] "" NEO
SG_ SpdCtrlLvrStat_Inv : 7|1@1+ (1,0) [0|0] "" NEO
SG_ DTR_Dist_Rq : 8|8@1+ (1,0) [0|200] "" NEO
SG_ TurnIndLvr_Stat : 16|2@1+ (1,0) [0|0] "" NEO
SG_ HiBmLvr_Stat : 18|2@1+ (1,0) [0|0] "" NEO
SG_ WprWashSw_Psd : 20|2@1+ (1,0) [0|0] "" NEO
SG_ WprWash_R_Sw_Posn_V2 : 22|2@1+ (1,0) [0|0] "" NEO
SG_ StW_Lvr_Stat : 24|3@1+ (1,0) [0|0] "" NEO
SG_ StW_Cond_Flt : 27|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Cond_Psd : 28|2@1+ (1,0) [0|0] "" NEO
SG_ HrnSw_Psd : 30|2@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw00_Psd : 32|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw01_Psd : 33|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw02_Psd : 34|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw03_Psd : 35|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw04_Psd : 36|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw05_Psd : 37|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw06_Psd : 38|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw07_Psd : 39|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw08_Psd : 40|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw09_Psd : 41|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw10_Psd : 42|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw11_Psd : 43|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw12_Psd : 44|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw13_Psd : 45|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw14_Psd : 46|1@1+ (1,0) [0|0] "" NEO
SG_ StW_Sw15_Psd : 47|1@1+ (1,0) [0|0] "" NEO
SG_ WprSw6Posn : 48|3@1+ (1,0) [0|0] "" NEO
SG_ MC_STW_ACTN_RQ : 52|4@1+ (1,0) [0|15] "" NEO
SG_ CRC_STW_ACTN_RQ : 56|8@1+ (1,0) [0|0] "" NEO
BO_ 643 BODY_R1: 8 GTW
SG_ AirTemp_Insd : 47|8@0+ (0.25,0) [0|63.5] "C" NEO
SG_ AirTemp_Outsd : 63|8@0+ (0.5,-40) [-40|86.5] "C" NEO
SG_ Bckl_Sw_RL_Stat_SAM_R : 49|2@0+ (1,0) [-1|4] "" NEO
SG_ Bckl_Sw_RM_Stat_SAM_R : 53|2@0+ (1,0) [-1|4] "" NEO
SG_ Bckl_Sw_RR_Stat_SAM_R : 51|2@0+ (1,0) [-1|4] "" NEO
SG_ DL_RLtch_Stat : 9|2@0+ (1,0) [-1|4] "" NEO
SG_ DrRLtch_FL_Stat : 1|2@0+ (1,0) [-1|4] "" NEO
SG_ DrRLtch_FR_Stat : 3|2@0+ (1,0) [-1|4] "" NEO
SG_ DrRLtch_RL_Stat : 5|2@0+ (1,0) [-1|4] "" NEO
SG_ DrRLtch_RR_Stat : 7|2@0+ (1,0) [-1|4] "" NEO
SG_ EngHd_Stat : 11|2@0+ (1,0) [-1|4] "" NEO
SG_ LoBm_On_Rq : 32|1@0+ (1,0) [0|1] "" NEO
SG_ HiBm_On : 33|1@0+ (1,0) [0|1] "" NEO
SG_ Hrn_On : 26|1@0+ (1,0) [0|1] "" NEO
SG_ IrLmp_D_Lt_Flt : 34|1@0+ (1,0) [0|1] "" NEO
SG_ IrLmp_P_Rt_Flt : 35|1@0+ (1,0) [0|1] "" NEO
SG_ LgtSens_Twlgt : 18|3@0+ (1,0) [0|7] "Steps" NEO
SG_ LgtSens_SNA : 19|1@0+ (1,0) [0|1] "" NEO
SG_ LgtSens_Tunnel : 20|1@0+ (1,0) [0|1] "" NEO
SG_ LgtSens_Flt : 21|1@0+ (1,0) [0|1] "" NEO
SG_ LgtSens_Night : 22|1@0+ (1,0) [-1|2] "" NEO
SG_ ADL_LoBm_On_Rq : 23|1@0+ (1,0) [0|1] "" NEO
SG_ LoBm_D_Lt_Flt : 36|1@0+ (1,0) [0|1] "" NEO
SG_ LoBm_P_Rt_Flt : 37|1@0+ (1,0) [0|1] "" NEO
SG_ MPkBrk_Stat : 28|1@0+ (1,0) [-1|2] "" NEO
SG_ RevGr_Engg : 39|2@0+ (1,0) [-1|4] "" NEO
SG_ StW_Cond_Stat : 55|2@0+ (1,0) [-1|4] "" NEO
SG_ Term54_Actv : 27|1@0+ (1,0) [0|1] "" NEO
SG_ Trlr_Stat : 25|2@0+ (1,0) [-1|4] "" NEO
SG_ VTA_Alm_Actv : 13|1@0+ (1,0) [0|1] "" NEO
SG_ WprOutsdPkPosn : 29|1@0+ (1,0) [0|1] "" NEO
BO_ 760 UI_gpsVehicleSpeed: 8 GTW
SG_ UI_gpsHDOP : 0|8@1+ (0.1,0) [0|25.5] "1" DAS
SG_ UI_gpsVehicleHeading : 8|16@1+ (0.0078125,0) [0|511.9921875] "deg" DAS
SG_ UI_gpsVehicleSpeed : 24|16@1+ (0.00390625,0) [0|250.996] "km/hr" Vector__XXX
SG_ UI_userSpeedOffset : 40|6@1+ (1,-30) [-30|33] "kph/mph" DAS
SG_ UI_mapSpeedLimitUnits : 46|1@1+ (1,0) [0|1] "" DAS
SG_ UI_userSpeedOffsetUnits : 47|1@1+ (1,0) [0|1] "" DAS
SG_ UI_mppSpeedLimit : 48|5@1+ (5,0) [0|155] "kph/mph" DAS
SG_ UI_gpsNmeaMIA : 53|1@1+ (1,0) [0|0] "" DAS
BO_ 536 MCU_chassisControl: 8 GTW
SG_ MCU_dasDebugEnable : 0|1@1+ (1,0) [0|0] "" NEO
SG_ MCU_parkBrakeRequest : 1|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_trailerModeCH : 3|1@1+ (1,0) [0|0] "" NEO
SG_ MCU_fcwSensitivity : 4|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_fcwEnable : 6|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_latControlEnable : 8|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_accOvertakeEnable : 10|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_ldwEnable : 12|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_aebEnable : 14|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_bsdEnable : 16|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_ahlbEnable : 18|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_parkSetting : 20|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_pedalSafetyEnable : 22|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_frontDefrostReq_das : 24|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_autoParkRequest : 26|4@1+ (1,0) [0|0] "" NEO
SG_ MCU_redLightStopSignEnable : 30|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_enableCreepTorqueCH : 32|1@1+ (1,0) [0|0] "" NEO
SG_ MCU_narrowGarages : 33|1@1+ (1,0) [0|0] "" NEO
SG_ MCU_rebootAutopilot : 34|1@1+ (1,0) [0|0] "" NEO
SG_ MCU_enableAutowipers : 35|1@1+ (1,0) [0|0] "" NEO
SG_ MCU_overPaintedUSS : 38|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_selfParkTune : 40|4@1+ (1,0) [0|15] "" NEO
SG_ MCU_towModeEnable : 44|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_zeroSpeedConfirmed : 46|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_aesEnable : 48|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_autoLaneChangeEnable : 50|2@1+ (1,0) [0|0] "" NEO
SG_ MCU_chassisControlCounter : 52|4@1+ (1,0) [0|0] "" NEO
SG_ MCU_chassisControlChecksum : 56|8@1+ (1,0) [0|0] "" NEO
BO_ 904 MCU_clusterBacklightRequest: 3 NEO
SG_ MCU_clusterBacklightOn : 7|1@1+ (1,0) [0|1] "" NEO
SG_ MCU_clusterBrightnessLevel : 8|8@1+ (0.5,0) [0|127.5] "%" NEO
SG_ MCU_clusterReadyForDrive : 6|1@1+ (1,0) [-1|2] "" NEO
SG_ MCU_clusterReadyForPowerOff : 5|1@1+ (1,0) [0|1] "" NEO
BO_ 984 MCU_locationStatus: 8 MCU
SG_ MCU_gpsAccuracy : 57|7@1+ (0.2,0) [0|0] "m" NEO
SG_ MCU_latitude : 0|28@1- (1E-06,0) [0|0] "deg" NEO
SG_ MCU_longitude : 28|29@1- (1E-06,0) [0|0] "deg" NEO
BO_ 104 MCU_locationStatus2: 8 MCU
SG_ MCU_elevation : 0|32@1- (0.1,0) [0|0] "m" GTW
SG_ MCU_navigonExpectedSpeed : 32|7@1+ (1,0) [0|126] "mph" GTW
BO_ 840 GTW_status: 8 GTW
SG_ GTW_accGoingDown : 6|1@0+ (1,0) [0|1] "" NEO
SG_ GTW_accRailReq : 8|1@0+ (1,0) [0|1] "" NEO
SG_ GTW_brakePressed : 1|1@0+ (1,0) [0|1] "" NEO
SG_ GTW_driveGoingDown : 7|1@0+ (1,0) [0|1] "" NEO
SG_ GTW_driveRailReq : 0|1@0+ (1,0) [0|1] "" NEO
SG_ GTW_driverIsLeaving : 5|1@0+ (1,0) [0|1] "" NEO
SG_ GTW_driverPresent : 2|1@0+ (1,0) [0|1] "" NEO
SG_ GTW_hvacGoingDown : 11|1@0+ (1,0) [0|1] "" NEO
SG_ GTW_hvacRailReq : 9|1@0+ (1,0) [0|1] "" NEO
SG_ GTW_icPowerOff : 4|1@0+ (1,0) [0|1] "" NEO
SG_ GTW_notEnough12VForDrive : 3|1@0+ (1,0) [0|1] "" NEO
SG_ GTW_preconditionRequest : 10|1@0+ (1,0) [0|1] "" NEO
SG_ GTW_statusChecksum : 63|8@0+ (1,0) [0|255] "" NEO
SG_ GTW_statusCounter : 51|4@0+ (1,0) [0|15] "" NEO
BO_ 920 GTW_carConfig: 8 GTW
SG_ GTW_performanceConfig : 2|3@0+ (1,0) [0|0] "" NEO
SG_ GTW_fourWheelDrive : 4|2@0+ (1,0) [0|0] "" NEO
SG_ GTW_unknown1 : 5|1@0+ (1,0) [0|0] "" NEO
SG_ GTW_dasHw : 7|2@0+ (1,0) [0|0] "" NEO
SG_ GTW_parkAssistInstalled : 9|2@0+ (1,0) [0|0] "" NEO
SG_ GTW_forwardRadarHw : 11|2@0+ (1,0) [0|0] "" NEO
SG_ GTW_airSuspensionInstalled : 14|3@0+ (1,0) [0|0] "" NEO
SG_ GTW_unknown2 : 15|1@0+ (1,0) [0|0] "" NEO
SG_ GTW_country : 23|16@0+ (1,0) [0|0] "" NEO
SG_ GTW_parkSensorGeometryType : 33|2@0+ (1,0) [0|0] "" NEO
SG_ GTW_rhd : 34|1@0+ (1,0) [0|0] "" NEO
SG_ GTW_bodyControlsType : 35|1@0+ (1,0) [0|0] "" NEO
SG_ GTW_radarPosition : 39|4@0+ (1,0) [0|0] "" NEO
SG_ GTW_rearCornerRadarHw : 41|2@0+ (1,0) [0|0] "" NEO
SG_ GTW_frontCornerRadarHw : 43|2@0+ (1,0) [0|0] "" NEO
SG_ GTW_epasType : 45|2@0+ (1,0) [0|0] "" NEO
SG_ GTW_chassisType : 47|2@0+ (1,0) [0|2] "" NEO
SG_ GTW_wheelType : 52|5@0+ (1,0) [0|0] "" NEO
SG_ GTW_rearSeatControllerMask : 55|3@0+ (1,0) [0|7] "" NEO
SG_ GTW_euVehicle : 56|1@0+ (1,0) [0|0] "" NEO
SG_ GTW_foldingMirrorsInstalled : 57|1@0+ (1,0) [0|0] "" NEO
SG_ GTW_brakeHwType : 59|2@0+ (1,0) [0|2] "" NEO
SG_ GTW_autopilot : 61|2@0+ (1,0) [0|0] "" NEO
SG_ GTW_unknown3 : 63|2@0+ (1,0) [0|0] "" NEO
BO_ 1006 UI_autopilotControl: 8 GTW
SG_ UI_autopilotControlIndex M : 0|3@1+ (1,0) [0|7] "" APP,APS
SG_ UI_hovEnabled m0 : 3|1@1+ (1,0) [0|0] "" APP,APS
SG_ UI_donDisableAutoWiperDuration m0 : 4|3@1+ (1,0) [0|0] "" APP,APS
SG_ UI_donDisableOnAutoWiperSpeed m0 : 7|4@1+ (1,0) [0|0] "" APP,APS
SG_ UI_blindspotMinSpeed m0 : 11|4@1+ (1,0) [0|0] "" APP,APS
SG_ UI_blindspotDistance m0 : 15|3@1+ (1,0) [0|0] "" APP,APS
SG_ UI_blindspotTTC m0 : 18|3@1+ (1,0) [0|0] "" APP,APS
SG_ UI_donStopEndOfRampBuffer m0 : 21|3@1+ (1,0) [0|0] "" APP,APS
SG_ UI_donDisableCutin m0 : 24|1@1+ (1,0) [0|0] "" APP,APS
SG_ UI_donMinGoreWidthForAbortMap m0 : 25|4@1+ (1,0) [0|0] "" APP,APS
SG_ UI_donAlcProgGoreAbortThres m0 : 29|4@1+ (1,0) [0|0] "" APP,APS
SG_ UI_donMinGoreWidthForAbortNotMap m0 : 33|4@1+ (1,0) [0|0] "" APP,APS
SG_ UI_alcDisableUltrasonicCheck m0 : 37|1@1+ (1,0) [0|0] "" APP,APS
SG_ UI_alcUltrasonicDistance m0 : 38|4@1+ (1,0) [0|0] "" APP,APS
SG_ UI_alcUltrasonicWaitTime m0 : 42|3@1+ (1,0) [0|0] "" APP,APS
SG_ UI_alcEgoLeadingReactionAccel m0 : 48|2@1+ (1,0) [0|0] "" APP,APS
SG_ UI_alcMergIntervalRearDHyst m0 : 50|2@1+ (1,0) [0|0] "" APP,APS
SG_ UI_alcMergingIntervalHeadwayHyst m0 : 52|2@1+ (1,0) [0|0] "" APP,APS
SG_ UI_alcAssertivenessRate m0 : 54|2@1+ (1,0) [0|0] "" APP,APS
SG_ UI_alcViewRangeSensitivity m0 : 56|2@1+ (1,0) [0|0] "" APP,APS
SG_ UI_camBlockLaneCheckDisable m1 : 3|1@1+ (1,0) [0|0] "" APP,APS
SG_ UI_camBlockLaneCheckThreshold m1 : 4|6@1+ (0.01587,0) [0|1] "%" APP,APS
SG_ UI_camBlockBlurDisable m1 : 10|1@1+ (1,0) [0|0] "" APP,APS
SG_ UI_camBlockBlurThreshold m1 : 11|6@1+ (0.01587,0) [0|1] "%" APP,APS
BO_ 728 UI_csaOfframpCurvature: 8 GTW
SG_ UI_csaOfframpCurvC2 : 0|16@1- (1E-06,0) [-0.032768|0.032767] "1/m" DAS
SG_ UI_csaOfframpCurvC3 : 16|16@1- (4E-09,0) [-0.000131072|0.000131068] "1/m2" DAS
SG_ UI_csaOfframpCurvRange : 32|8@1+ (2,0) [0|510] "m" DAS
SG_ UI_csaOfframpCurvCounter : 40|8@1+ (1,0) [0|255] "" Vector__XXX
SG_ UI_csaOfframpCurvUsingTspline : 48|1@1+ (1,0) [0|1] "" DAS
SG_ UI_csaOfframpCurvReserved : 49|7@1+ (1,0) [0|0] "" Vector__XXX
SG_ UI_csaOfframpCurvChecksum : 56|8@1+ (1,0) [0|0] "" Vector__XXX
BO_ 744 UI_csaRoadCurvature: 8 GTW
SG_ UI_csaRoadCurvC2 : 0|16@1- (1E-06,0) [-0.032768|0.032767] "1/m" DAS
SG_ UI_csaRoadCurvC3 : 16|16@1- (4E-09,0) [-0.000131072|0.000131068] "1/m2" DAS
SG_ UI_csaRoadCurvRange : 32|8@1+ (2,0) [0|510] "m" DAS
SG_ UI_csaRoadCurvCounter : 40|8@1+ (1,0) [0|255] "" Vector__XXX
SG_ UI_csaRoadCurvUsingTspline : 48|1@1+ (1,0) [0|1] "" DAS
SG_ UI_csaRoadCurvReserved : 49|7@1+ (1,0) [0|0] "" Vector__XXX
SG_ UI_csaRoadCurvChecksum : 56|8@1+ (1,0) [0|0] "" Vector__XXX
BO_ 1080 UI_driverAssistAnonDebugParams: 8 GTW
SG_ UI_anonDebugParam1 : 0|7@1+ (1,0) [0|100] "" DAS
SG_ UI_anonDebugFlag1 : 7|1@1+ (1,0) [0|0] "" DAS
SG_ UI_anonDebugParam2 : 8|7@1+ (1,0) [0|100] "" DAS
SG_ UI_anonDebugFlag2 : 15|1@1+ (1,0) [0|0] "" DAS
SG_ UI_anonDebugParam3 : 16|7@1+ (1,0) [0|100] "" DAS
SG_ UI_anonDebugFlag3 : 23|1@1+ (1,0) [0|0] "" DAS
SG_ UI_anonDebugParam4 : 24|7@1+ (1,0) [0|100] "" DAS
SG_ UI_anonDebugFlag4 : 31|1@1+ (1,0) [0|0] "" DAS
SG_ UI_anonDebugParam5 : 32|7@1+ (1,0) [0|100] "" DAS
SG_ UI_anonDebugParam6 : 40|7@1+ (1,0) [0|100] "" DAS
SG_ UI_anonDebugParam7 : 48|7@1+ (1,0) [0|100] "" DAS
SG_ UI_visionSpeedSlider : 56|7@1+ (1,0) [0|100] "" DAS
BO_ 1000 UI_driverAssistControl: 8 GTW
SG_ UI_autopilotControlRequest : 0|1@1+ (1,0) [1|0] "" DAS
SG_ UI_ulcStalkConfirm : 1|1@1+ (1,0) [1|0] "" DAS
SG_ UI_summonHeartbeat : 2|2@1+ (1,0) [0|0] "" DAS
SG_ UI_curvSpeedAdaptDisable : 4|1@1+ (1,0) [0|0] "" DAS
SG_ UI_dasDeveloper : 5|1@1+ (1,0) [0|0] "" DAS
SG_ UI_enableVinAssociation : 6|1@1+ (1,0) [0|0] "" DAS
SG_ UI_lssLkaEnabled : 7|1@1+ (1,0) [0|0] "" DAS
SG_ UI_lssLdwEnabled : 8|1@1+ (1,0) [0|0] "" DAS
SG_ UI_autoSummonEnable : 10|1@1+ (1,0) [0|1] "" DAS
SG_ UI_exceptionListEnable : 11|1@1+ (1,0) [0|1] "" APP
SG_ UI_roadCheckDisable : 12|1@1+ (1,0) [0|0] "" DAS
SG_ UI_driveOnMapsEnable : 13|1@1+ (1,0) [0|0] "" DAS
SG_ UI_handsOnRequirementDisable : 14|1@1+ (1,0) [0|0] "" DAS
SG_ UI_forksEnable : 15|1@1+ (1,0) [0|0] "" DAS
SG_ UI_fuseLanesDisable : 16|1@1+ (1,0) [0|0] "" DAS
SG_ UI_fuseHPPDisable : 17|1@1+ (1,0) [0|0] "" DAS
SG_ UI_fuseVehiclesDisable : 18|1@1+ (1,0) [0|0] "" DAS
SG_ UI_enableNextGenACC : 19|1@1+ (1,0) [0|1] "" APP
SG_ UI_visionSpeedType : 20|2@1+ (1,0) [0|0] "" APP
SG_ UI_curvatureDatabaseOnly : 22|1@1+ (1,0) [0|0] "" DAS
SG_ UI_lssElkEnabled : 23|1@1+ (1,0) [0|0] "" DAS
SG_ UI_summonExitType : 24|2@1+ (1,0) [0|3] "" DAS
SG_ UI_summonEntryType : 26|2@1+ (1,0) [0|3] "" DAS
SG_ UI_selfParkRequest : 28|4@1+ (1,0) [0|15] "" DAS,PARK
SG_ UI_summonReverseDist : 32|6@1+ (1,0) [0|63] "" DAS
SG_ UI_undertakeAssistEnable : 38|1@1+ (1,0) [0|0] "" DAS
SG_ UI_adaptiveSetSpeedEnable : 39|1@1+ (1,0) [0|0] "" DAS
SG_ UI_drivingSide : 40|2@1+ (1,0) [0|3] "" DAS
SG_ UI_enableClipTelemetry : 42|1@1+ (1,0) [0|0] "" APP
SG_ UI_enableTripTelemetry : 43|1@1+ (1,0) [0|0] "" APP
SG_ UI_enableRoadSegmentTelemetry : 44|1@1+ (1,0) [0|0] "" APP
SG_ UI_followNavRouteEnable : 46|1@1+ (1,0) [0|0] "" APP
SG_ UI_ulcSpeedConfig : 48|2@1+ (1,0) [0|3] "" APP
SG_ UI_ulcBlindSpotConfig : 50|2@1+ (1,0) [0|3] "" APP
SG_ UI_autopilotAlwaysOn : 52|1@1+ (1,0) [0|1] "" APP
SG_ UI_accFromZero : 53|1@1+ (1,0) [0|1] "" APP
SG_ UI_alcOffHighwayEnable : 54|1@1+ (1,0) [0|1] "" APP
SG_ UI_validationLoop : 55|1@1+ (1,0) [0|1] "" APP
SG_ UI_ulcOffHighway : 56|1@1+ (1,0) [0|1] "" APP
SG_ UI_enableNavRouteCSA : 57|1@1+ (1,0) [0|1] "" APP
SG_ UI_enableCutinExperiments : 58|1@1+ (1,0) [0|1] "" APP
SG_ UI_source3D : 60|3@1+ (1,0) [0|7] "" APP
SG_ UI_enableVisionOnlyStops : 63|1@1+ (1,0) [0|1] "" APP
BO_ 968 UI_driverAssistMapData: 8 GTW
SG_ UI_mapSpeedLimitDependency : 0|3@1+ (1,0) [0|0] "" DAS
SG_ UI_roadClass : 3|3@1+ (1,0) [0|0] "" DAS
SG_ UI_inSuperchargerGeofence : 6|1@1+ (1,0) [0|0] "" DAS
SG_ UI_mapSpeedUnits : 7|1@1+ (1,0) [0|0] "" DAS
SG_ UI_mapSpeedLimit : 8|5@1+ (1,0) [0|0] "" DAS
SG_ UI_mapSpeedLimitType : 13|3@1+ (1,0) [0|0] "" DAS
SG_ UI_countryCode : 16|10@1+ (1,0) [0|0] "" DAS
SG_ UI_streetCount : 26|2@1+ (1,0) [0|0] "" DAS
SG_ UI_gpsRoadMatch : 28|1@1+ (1,0) [0|0] "" DAS
SG_ UI_navRouteActive : 29|1@1+ (1,0) [0|0] "" DAS
SG_ UI_parallelAutoparkEnabled : 30|1@1+ (1,0) [0|1] "" DAS
SG_ UI_perpendicularAutoparkEnabled : 31|1@1+ (1,0) [0|1] "" DAS
SG_ UI_nextBranchDist : 32|5@1+ (10,0) [0|300] "m" DAS
SG_ UI_controlledAccess : 37|1@1+ (1,0) [0|0] "" DAS
SG_ UI_nextBranchLeftOffRamp : 38|1@1+ (1,0) [0|0] "" DAS
SG_ UI_nextBranchRightOffRamp : 39|1@1+ (1,0) [0|0] "" DAS
SG_ UI_rejectLeftLane : 40|1@1+ (1,0) [0|0] "" DAS
SG_ UI_rejectRightLane : 41|1@1+ (1,0) [0|0] "" DAS
SG_ UI_rejectHPP : 42|1@1+ (1,0) [0|0] "" DAS
SG_ UI_rejectNav : 43|1@1+ (1,0) [0|0] "" DAS
SG_ UI_rejectLeftFreeSpace : 44|1@1+ (1,0) [0|0] "" DAS
SG_ UI_rejectRightFreeSpace : 45|1@1+ (1,0) [0|0] "" DAS
SG_ UI_rejectAutosteer : 46|1@1+ (1,0) [0|0] "" DAS
SG_ UI_rejectHandsOn : 47|1@1+ (1,0) [0|0] "" DAS
SG_ UI_acceptBottsDots : 48|1@1+ (1,0) [0|0] "" DAS
SG_ UI_autosteerRestricted : 49|1@1+ (1,0) [0|0] "" DAS
SG_ UI_pmmEnabled : 50|1@1+ (1,0) [0|0] "" DAS
SG_ UI_scaEnabled : 51|1@1+ (1,0) [0|0] "" DAS
SG_ UI_mapDataCounter : 52|4@1+ (1,0) [0|0] "" DAS
SG_ UI_mapDataChecksum : 56|8@1+ (1,0) [0|0] "" DAS
BO_ 568 UI_driverAssistRoadSign: 8 GTW
SG_ UI_roadSign M : 0|8@1+ (1,0) [0|0] "" DAS
SG_ UI_splineLocConfidence : 40|7@1+ (1,0) [0|100] "" DAS
SG_ UI_splineID : 48|4@1+ (1,0) [0|15] "" Vector__XXX
SG_ UI_roadSignCounter : 52|4@1+ (1,0) [0|0] "" Vector__XXX
SG_ UI_roadSignChecksum : 56|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ UI_dummyData m0 : 8|1@1+ (1,0) [0|0] "" Vector__XXX
SG_ UI_stopSignStopLineDist m1 : 8|10@1+ (0.25,-8) [-8|247.5] "m" Vector__XXX
SG_ UI_stopSignStopLineConf m1 : 18|7@1+ (1,0) [0|100] "" Vector__XXX
SG_ UI_trafficLightStopLineDist m2 : 8|10@1+ (0.25,-8) [-8|247.5] "m" Vector__XXX
SG_ UI_trafficLightStopLineConf m2 : 18|7@1+ (1,0) [0|100] "" Vector__XXX
SG_ UI_baseMapSpeedLimitMPS m3 : 8|8@1+ (0.25,0) [0|63.75] "m/s" DAS
SG_ UI_bottomQrtlFleetSpeedMPS m3 : 16|8@1+ (0.25,0) [0|63.75] "m/s" DAS
SG_ UI_topQrtlFleetSpeedMPS m3 : 24|8@1+ (0.25,0) [0|63.75] "m/s" DAS
SG_ UI_meanFleetSplineSpeedMPS m4 : 8|8@1+ (0.25,0) [0|63.75] "m/s" DAS
SG_ UI_medianFleetSpeedMPS m4 : 16|8@1+ (0.25,0) [0|63.75] "m/s" DAS
SG_ UI_meanFleetSplineAccelMPS2 m4 : 24|8@1+ (0.05,-6.35) [-6.35|6.4] "m/s^2" DAS
SG_ UI_rampType m4 : 32|3@1+ (1,0) [0|7] "" DAS
SG_ UI_currSplineIdFull m5 : 8|32@1+ (1,0) [0|1] "" APP
BO_ 696 UI_radarMapData: 8 GTW
SG_ UI_radarTargetDx : 0|8@1+ (1,-95) [-95|160] "m" DAS
SG_ UI_radarTargetDxEnd : 8|8@1+ (1,0) [0|255] "m" DAS
SG_ UI_radarTargetTrustMap : 16|1@1+ (1,0) [0|1] "" DAS
SG_ UI_radarEnableBraking : 17|1@1+ (1,0) [0|1] "" DAS
SG_ UI_radarMapDataCounter : 52|4@1+ (1,0) [0|0] "" DAS
SG_ UI_radarMapDataChecksum : 56|8@1+ (1,0) [0|0] "" DAS
BO_ 712 UI_roadCurvature: 8 GTW
SG_ UI_roadCurvC0 : 0|11@1- (0.02,0) [-20.48|20.46] "m" DAS
SG_ UI_roadCurvC1 : 11|10@1- (0.00075,0) [-0.384|0.38325] "1" DAS
SG_ UI_roadCurvC2 : 21|14@1- (7.5E-06,0) [-0.03072|0.03071625] "1/m" DAS
SG_ UI_roadCurvC3 : 35|13@1- (3E-08,0) [-0.00012288|0.00012285] "1/m2" DAS
SG_ UI_roadCurvRange : 48|6@1+ (4,0) [0|252] "m" DAS
SG_ UI_roadCurvHealth : 54|2@1+ (1,0) [0|0] "" DAS
SG_ UI_roadCurvChecksum : 56|8@1+ (1,0) [0|0] "" Vector__XXX
BO_ 582 UI_solarData: 5 GTW
SG_ UI_solarAzimuthAngle : 0|16@1- (1,0) [0|360] "deg" APP
SG_ UI_solarAzimuthAngleCarRef : 16|9@1- (1,0) [-180|180] "deg" APP
SG_ UI_isSunUp : 25|1@1+ (1,0) [0|0] "" Vector__XXX
SG_ UI_solarElevationAngle : 32|8@1- (1,0) [-90|90] "deg" APP
BO_ 824 UI_status: 8 GTW
SG_ UI_touchActive : 0|1@1+ (1,0) [0|0] "" IC
SG_ UI_audioActive : 1|1@1+ (1,0) [0|0] "" IC
SG_ UI_bluetoothActive : 2|1@1+ (1,0) [0|0] "" IC
SG_ UI_cellActive : 3|1@1+ (1,0) [0|0] "" IC
SG_ UI_displayReady : 4|1@1+ (1,0) [0|0] "" IC
SG_ UI_gpsActive : 5|1@1+ (1,0) [0|0] "" IC
SG_ UI_wifiConnected : 6|1@1+ (1,0) [0|0] "" IC,APP
SG_ UI_systemActive : 7|1@1+ (1,0) [0|0] "" IC
SG_ UI_xmActive : 8|1@1+ (1,0) [0|0] "" IC
SG_ UI_displayOn : 9|1@1+ (1,0) [0|0] "" IC,APP
SG_ UI_readyForDrive : 10|1@1+ (1,0) [0|0] "" IC
SG_ UI_cellConnected : 11|1@1+ (1,0) [0|0] "" IC,APP
SG_ UI_vpnActive : 12|1@1+ (1,0) [0|0] "" IC,APP
SG_ UI_wifiActive : 13|1@1+ (1,0) [0|0] "" IC
SG_ UI_cameraActive : 14|1@1+ (1,0) [0|0] "" IC,APP
SG_ UI_usbActive : 15|1@1+ (1,0) [0|0] "" IC
SG_ UI_screenshotActive : 16|1@1+ (1,0) [0|0] "" IC,APP
SG_ UI_monitorModemPower : 17|1@1+ (1,0) [0|0] "" Vector__XXX
SG_ UI_factoryReset : 18|2@1+ (1,0) [0|3] "" Vector__XXX
SG_ UI_cellNetworkTechnology : 20|4@1+ (1,0) [0|15] "" APP
SG_ UI_tegraCoreTemperature : 24|8@1+ (1,-64) [0|0] "deg C" IC
SG_ UI_tegraAmbientTemperature : 32|8@1+ (1,-64) [0|0] "deg C" IC
SG_ UI_googleWifiUsages : 40|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ UI_autopilotTrial : 48|2@1+ (1,0) [0|0] "" APP
SG_ UI_cellSignalBars : 50|3@1+ (1,0) [0|7] "" APP
SG_ UI_hardwareType : 53|2@1+ (1,0) [0|3] "" APP
SG_ UI_developmentCar : 55|1@1+ (1,0) [0|0] "" Vector__XXX
SG_ UI_cellReceiverPower : 56|8@1+ (1,-128) [-128|127] "dB" APP
BO_ 1064 UI_telemetryControl: 8 GTW
SG_ UI_TCR_enable : 0|1@1+ (1,0) [0|0] "" DAS
SG_ UI_TCR_moveStateStanding : 1|1@1+ (1,0) [0|0] "" DAS
SG_ UI_TCR_moveStateStopped : 2|1@1+ (1,0) [0|0] "" DAS
SG_ UI_TCR_moveStateMoving : 3|1@1+ (1,0) [0|0] "" DAS
SG_ UI_TCR_moveStateIndeterm : 4|1@1+ (1,0) [0|0] "" DAS
SG_ UI_TCR_classConstElem : 5|1@1+ (1,0) [0|0] "" DAS
SG_ UI_TCR_classMovingPed : 6|1@1+ (1,0) [0|0] "" DAS
SG_ UI_TCR_classMovingTwoWheel : 7|1@1+ (1,0) [0|0] "" DAS
SG_ UI_TCR_classMovingFourWheel : 8|1@1+ (1,0) [0|0] "" DAS
SG_ UI_TCR_classUnknown : 9|1@1+ (1,0) [0|0] "" DAS
SG_ UI_TCR_downSampleFactor : 16|4@1+ (1,0) [0|15] "" Vector__XXX
SG_ UI_TCR_wExist : 24|5@1+ (1,0) [0|31] "" Vector__XXX
SG_ UI_TCR_vehSpeed : 32|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ UI_TCR_minRCS : 40|8@1+ (0.25,-14) [-14|49.75] "dB" Vector__XXX
SG_ UI_TCR_maxDy : 48|5@1+ (0.5,0) [0|15.5] "m" Vector__XXX
SG_ UI_TCR_maxObjects : 56|5@1+ (1,0) [0|31] "" Vector__XXX
SG_ UI_TCR_maxRoadClass : 61|3@1+ (1,0) [0|7] "" Vector__XXX
BO_ 522 BrakeMessage: 8 XXX
SG_ driverBrakeStatus : 2|2@1+ (1,0) [0|3] "" XXX
BO_ 921 AutopilotStatus: 8 XXX
SG_ autopilotStatus : 0|4@1+ (1,0) [0|0] "" XXX
VAL_ 3 StW_Angl 16383 "SNA" ;
VAL_ 3 StW_AnglSens_Id 2 "MUST" 0 "PSBL" 1 "SELF" ;
VAL_ 3 StW_AnglSens_Stat 2 "ERR" 3 "ERR_INI" 1 "INI" 0 "OK" ;
VAL_ 3 StW_AnglSpd 16383 "SNA" ;
VAL_ 14 StW_AnglHP 16383 "SNA" ;
VAL_ 14 StW_AnglHP_Spd 16383 "SNA" ;
VAL_ 14 StW_AnglHP_Sens_Stat 3 "SNA" 2 "ERR" 1 "INI" 0 "OK" ;
VAL_ 14 StW_AnglHP_Sens_Id 3 "SNA" 2 "KOSTAL" 1 "DELPHI" 0 "TEST" ;
VAL_ 69 SpdCtrlLvr_Stat 32 "DN_1ST" 16 "UP_1ST" 8 "DN_2ND" 4 "UP_2ND" 2 "RWD" 1 "FWD" 0 "IDLE" ;
VAL_ 69 DTR_Dist_Rq 255 "SNA" 200 "ACC_DIST_7" 166 "ACC_DIST_6" 133 "ACC_DIST_5" 100 "ACC_DIST_4" 66 "ACC_DIST_3" 33 "ACC_DIST_2" 0 "ACC_DIST_1" ;
VAL_ 69 TurnIndLvr_Stat 3 "SNA" 2 "RIGHT" 1 "LEFT" 0 "IDLE" ;
VAL_ 69 HiBmLvr_Stat 3 "SNA" 2 "HIBM_FLSH_ON_PSD" 1 "HIBM_ON_PSD" 0 "IDLE" ;
VAL_ 69 WprWashSw_Psd 3 "SNA" 2 "WASH" 1 "TIPWIPE" 0 "NPSD" ;
VAL_ 69 WprWash_R_Sw_Posn_V2 3 "SNA" 2 "WASH" 1 "INTERVAL" 0 "OFF" ;
VAL_ 69 StW_Lvr_Stat 4 "STW_BACK" 3 "STW_FWD" 2 "STW_DOWN" 1 "STW_UP" 0 "NPSD" ;
VAL_ 69 StW_Cond_Psd 3 "SNA" 2 "DOWN" 1 "UP" 0 "NPSD" ;
VAL_ 69 HrnSw_Psd 3 "SNA" 2 "NDEF2" 1 "PSD" 0 "NPSD" ;
VAL_ 69 StW_Sw00_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ;
VAL_ 69 StW_Sw01_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ;
VAL_ 69 StW_Sw03_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ;
VAL_ 69 StW_Sw04_Psd 1 "PRESSED" 0 "NOT_PRESSED_SNA" ;
VAL_ 69 WprSw6Posn 7 "SNA" 6 "STAGE2" 5 "STAGE1" 4 "INTERVAL4" 3 "INTERVAL3" 2 "INTERVAL2" 1 "INTERVAL1" 0 "OFF" ;
VAL_ 257 GTW_epasControlType 0 "WITHOUT" 1 "WITH_ANGLE" 3 "WITH_BOTH" 2 "WITH_TORQUE" ;
VAL_ 109 StW_Sw_Stat3 7 "SNA" 6 "NDEF6" 5 "NDEF5" 4 "NDEF4" 3 "PLUS_MINUS" 2 "MINUS" 1 "PLUS" 0 "NPSD" ;
VAL_ 109 MsgTxmtId 3 "NDEF3" 2 "NDEF2" 1 "SCCM" 0 "EWM" ;
VAL_ 109 TSL_RND_Posn_StW 15 "SNA" 8 "D" 6 "INI" 4 "N_DOWN" 2 "N_UP" 1 "R" 0 "IDLE" ;
VAL_ 109 TSL_P_Psd_StW 3 "SNA" 2 "INI" 1 "PSD" 0 "IDLE" ;
VAL_ 257 GTW_epasEmergencyOn 1 "EMERGENCY_POWER" 0 "NONE" ;
VAL_ 257 GTW_epasLDWEnabled 1 "ALLOWED" 0 "INHIBITED" ;
VAL_ 257 GTW_epasPowerMode 0 "DRIVE_OFF" 1 "DRIVE_ON" 3 "LOAD_SHED" 2 "SHUTTING_DOWN" 15 "SNA" ;
VAL_ 257 GTW_epasTuneRequest 1 "DM_COMFORT" 3 "DM_SPORT" 2 "DM_STANDARD" 0 "FAIL_SAFE_DEFAULT" 4 "RWD_COMFORT" 6 "RWD_SPORT" 5 "RWD_STANDARD" 7 "SNA" ;
VAL_ 264 DI_torqueDriver -4096 "SNA" ;
VAL_ 264 DI_torqueMotor -4096 "SNA" ;
VAL_ 264 DI_soptState 7 "SOPT_TEST_SNA" 4 "SOPT_TEST_NOT_RUN" 3 "SOPT_TEST_PASSED" 2 "SOPT_TEST_FAILED" 1 "SOPT_TEST_IN_PROGRESS" 0 "SOPT_PRE_TEST" ;
VAL_ 264 DI_motorRPM -32768 "SNA" ;
VAL_ 264 DI_pedalPos 255 "SNA" ;
VAL_ 280 DI_torqueEstimate -2048 "SNA" ;
VAL_ 280 DI_gear 7 "DI_GEAR_SNA" 4 "DI_GEAR_D" 3 "DI_GEAR_N" 2 "DI_GEAR_R" 1 "DI_GEAR_P" 0 "DI_GEAR_INVALID" ;
VAL_ 280 DI_brakePedal 1 "Applied" 0 "Not_applied" ;
VAL_ 280 DI_vehicleSpeed 4095 "SNA" ;
VAL_ 280 DI_gearRequest 7 "DI_GEAR_SNA" 4 "DI_GEAR_D" 3 "DI_GEAR_N" 2 "DI_GEAR_R" 1 "DI_GEAR_P" 0 "DI_GEAR_INVALID" ;
VAL_ 280 DI_torqueInterfaceFailure 1 "TORQUE_INTERFACE_FAILED" 0 "TORQUE_INTERFACE_NORMAL" ;
VAL_ 280 DI_brakePedalState 3 "SNA" 2 "INVALID" 1 "ON" 0 "OFF" ;
VAL_ 280 DI_epbParkRequest 1 "Park_requested" 0 "No_request" ;
VAL_ 280 DI_epbInterfaceReady 1 "EPB_INTERFACE_READY" 0 "EPB_INTERFACE_NOT_READY" ;
VAL_ 309 ESP_absBrakeEvent 1 "ACTIVE" 0 "NOT_ACTIVE" ;
VAL_ 309 ESP_brakeDiscWipingActive 1 "ACTIVE" 0 "INACTIVE" ;
VAL_ 309 ESP_brakeLamp 0 "OFF" 1 "ON" ;
VAL_ 309 ESP_espFaultLamp 0 "OFF" 1 "ON" ;
VAL_ 309 ESP_espLampFlash 1 "FLASH" 0 "OFF" ;
VAL_ 309 ESP_hillStartAssistActive 1 "ACTIVE" 0 "INACTIVE" 2 "NOT_AVAILABLE" 3 "SNA" ;
VAL_ 309 ESP_absFaultLamp 0 "OFF" 1 "ON" ;
VAL_ 309 ESP_espOffLamp 0 "OFF" 1 "ON" ;
VAL_ 309 ESP_stabilityControlSts 2 "ENGAGED" 3 "FAULTED" 5 "INIT" 4 "NOT_CONFIGURED" 0 "OFF" 1 "ON" ;
VAL_ 309 ESP_tcLampFlash 1 "FLASH" 0 "OFF" ;
VAL_ 568 UI_mapSpeedLimit 31 "SNA" 30 "UNLIMITED" 29 "LESS_OR_EQ_160" 28 "LESS_OR_EQ_150" 27 "LESS_OR_EQ_140" 26 "LESS_OR_EQ_130" 25 "LESS_OR_EQ_120" 24 "LESS_OR_EQ_115" 23 "LESS_OR_EQ_110" 22 "LESS_OR_EQ_105" 21 "LESS_OR_EQ_100" 20 "LESS_OR_EQ_95" 19 "LESS_OR_EQ_90" 18 "LESS_OR_EQ_85" 17 "LESS_OR_EQ_80" 16 "LESS_OR_EQ_75" 15 "LESS_OR_EQ_70" 14 "LESS_OR_EQ_65" 13 "LESS_OR_EQ_60" 12 "LESS_OR_EQ_55" 11 "LESS_OR_EQ_50" 10 "LESS_OR_EQ_45" 9 "LESS_OR_EQ_40" 8 "LESS_OR_EQ_35" 7 "LESS_OR_EQ_30" 6 "LESS_OR_EQ_25" 5 "LESS_OR_EQ_20" 4 "LESS_OR_EQ_15" 3 "LESS_OR_EQ_10" 2 "LESS_OR_EQ_7" 1 "LESS_OR_EQ_5" 0 "UNKNOWN" ;
VAL_ 522 driverBrakeStatus 2 "APPLIED" 1 "NOT_APPLIED" ;
VAL_ 760 UI_mapSpeedLimitUnits 1 "KPH" 0 "MPH" ;
VAL_ 760 UI_userSpeedOffsetUnits 1 "KPH" 0 "MPH" ;
VAL_ 643 AirTemp_Insd 255 "SNA" ;
VAL_ 643 AirTemp_Outsd 254 "INIT" 255 "SNA" ;
VAL_ 643 Bckl_Sw_RL_Stat_SAM_R 2 "FLT" 1 "NOT" 0 "OK" 3 "SNA" ;
VAL_ 643 Bckl_Sw_RM_Stat_SAM_R 2 "FLT" 1 "NOT" 0 "OK" 3 "SNA" ;
VAL_ 643 Bckl_Sw_RR_Stat_SAM_R 2 "FLT" 1 "NOT" 0 "OK" 3 "SNA" ;
VAL_ 643 DL_RLtch_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ;
VAL_ 643 DrRLtch_FL_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ;
VAL_ 643 DrRLtch_FR_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ;
VAL_ 643 DrRLtch_RL_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ;
VAL_ 643 DrRLtch_RR_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ;
VAL_ 643 EngHd_Stat 1 "CLS" 0 "NDEF0" 2 "OPN" 3 "SNA" ;
VAL_ 643 LgtSens_Night 0 "DAY" 1 "NIGHT" ;
VAL_ 643 MPkBrk_Stat 1 "ENGG" 0 "RELS" ;
VAL_ 643 RevGr_Engg 0 "DISENGG" 1 "ENGG" 2 "NDEF2" 3 "SNA" ;
VAL_ 643 StW_Cond_Stat 3 "BLINK" 1 "NDEF1" 0 "OFF" 2 "ON" ;
VAL_ 643 Trlr_Stat 2 "NDEF2" 0 "NONE" 1 "OK" 3 "SNA" ;
VAL_ 792 BOOT_STATE 2 "Init" 3 "SNA" 0 "closed" 1 "open" ;
VAL_ 792 CERRD 1 "CAN error detect" 0 "no Can error detected" ;
VAL_ 792 DAY 1 "Init" 0 "SNA" ;
VAL_ 792 DOOR_STATE_FL 2 "Init" 3 "SNA" 0 "closed" 1 "open" ;
VAL_ 792 DOOR_STATE_FR 2 "Init" 3 "SNA" 0 "closed" 1 "open" ;
VAL_ 792 DOOR_STATE_FrontTrunk 2 "Init" 3 "SNA" 0 "closed" 1 "open" ;
VAL_ 792 DOOR_STATE_RL 2 "Init" 3 "SNA" 0 "closed" 1 "open" ;
VAL_ 792 DOOR_STATE_RR 2 "Init" 3 "SNA" 0 "closed" 1 "open" ;
VAL_ 792 GTW_updateInProgress 1 "IN_PROGRESS" 2 "IN_PROGRESS_NOT_USED" 3 "IN_PROGRESS_SNA" 0 "NOT_IN_PROGRESS" ;
VAL_ 792 Hour 30 "Init" 31 "SNA" ;
VAL_ 792 MCU_factoryMode 1 "FACTORY_MODE" 0 "NORMAL_MODE" ;
VAL_ 792 MCU_transportModeOn 0 "NORMAL_MODE" ;
VAL_ 792 MINUTE 62 "Init" 63 "SNA" ;
VAL_ 792 MONTH 1 "Init" 15 "SNA" ;
VAL_ 792 SECOND 62 "Init" 63 "SNA" ;
VAL_ 792 YEAR 126 "Init" 127 "SNA" ;
VAL_ 872 DI_aebState 2 "ENABLED" 4 "FAULT" 7 "SNA" 1 "STANDBY" 3 "STANDSTILL" 0 "UNAVAILABLE" ;
VAL_ 872 DI_analogSpeed 4095 "SNA" ;
VAL_ 872 DI_cruiseState 2 "ENABLED" 5 "FAULT" 0 "OFF" 4 "OVERRIDE" 7 "PRE_CANCEL" 6 "PRE_FAULT" 1 "STANDBY" 3 "STANDSTILL" ;
VAL_ 872 DI_digitalSpeed 255 "SNA" ;
VAL_ 872 DI_immobilizerState 2 "AUTHENTICATING" 3 "DISARMED" 6 "FAULT" 4 "IDLE" 0 "INIT_SNA" 1 "REQUEST" 5 "RESET" ;
VAL_ 872 DI_speedUnits 1 "KPH" 0 "MPH" ;
VAL_ 872 DI_state 3 "ABORT" 4 "ENABLE" 2 "FAULT" 1 "STANDBY" 0 "UNAVAILABLE" ;
VAL_ 872 DI_systemState 3 "ABORT" 4 "ENABLE" 2 "FAULT" 1 "STANDBY" 0 "UNAVAILABLE" ;
VAL_ 872 DI_vehicleHoldState 2 "BLEND_IN" 4 "BLEND_OUT" 6 "FAULT" 7 "INIT" 5 "PARK" 1 "STANDBY" 3 "STANDSTILL" 0 "UNAVAILABLE" ;
VAL_ 880 EPAS_currentTuneMode 1 "DM_COMFORT" 3 "DM_SPORT" 2 "DM_STANDARD" 0 "FAIL_SAFE_DEFAULT" 4 "RWD_COMFORT" 6 "RWD_SPORT" 5 "RWD_STANDARD" 7 "UNAVAILABLE" ;
VAL_ 880 EPAS_eacErrorCode 14 "EAC_ERROR_EPB_INHIBIT" 3 "EAC_ERROR_HANDS_ON" 7 "EAC_ERROR_HIGH_ANGLE_RATE_REQ" 9 "EAC_ERROR_HIGH_ANGLE_RATE_SAFETY" 6 "EAC_ERROR_HIGH_ANGLE_REQ" 8 "EAC_ERROR_HIGH_ANGLE_SAFETY" 10 "EAC_ERROR_HIGH_MMOT_SAFETY" 11 "EAC_ERROR_HIGH_TORSION_SAFETY" 0 "EAC_ERROR_IDLE" 12 "EAC_ERROR_LOW_ASSIST" 2 "EAC_ERROR_MAX_SPEED" 1 "EAC_ERROR_MIN_SPEED" 13 "EAC_ERROR_PINION_VEL_DIFF" 4 "EAC_ERROR_TMP_FAULT" 5 "EAR_ERROR_MAX_STEER_DELTA" 15 "SNA" ;
VAL_ 880 EPAS_eacStatus 2 "EAC_ACTIVE" 1 "EAC_AVAILABLE" 3 "EAC_FAULT" 0 "EAC_INHIBITED" 4 "SNA" ;
VAL_ 880 EPAS_handsOnLevel 0 "0" 1 "1" 2 "2" 3 "3" ;
VAL_ 880 EPAS_steeringFault 1 "FAULT" 0 "NO_FAULT" ;
VAL_ 880 EPAS_steeringRackForce 1022 "NOT_IN_SPEC" 1023 "SNA" ;
VAL_ 880 EPAS_steeringReduced 0 "NORMAL_ASSIST" 1 "REDUCED_ASSIST" ;
VAL_ 880 EPAS_torsionBarTorque 0 "SEE_SPECIFICATION" 4095 "SNA" 4094 "UNDEFINABLE_DATA" ;
VAL_ 904 MCU_clusterReadyForDrive 0 "NO_SNA" 1 "YES" ;
VAL_ 921 autopilotStatus 5 "ACTIVE_NAVIGATE_ON_AUTOPILOT" 4 "ACTIVE_2" 3 "ACTIVE_1" 2 "AVAILABLE" 1 "UNAVAILABLE" 0 "DISABLED" ;
VAL_ 1160 DAS_steeringAngleRequest 16384 "ZERO_ANGLE" ;
VAL_ 1160 DAS_steeringControlType 1 "ANGLE_CONTROL" 3 "DISABLED" 0 "NONE" 2 "RESERVED" ;
VAL_ 1160 DAS_steeringHapticRequest 1 "ACTIVE" 0 "IDLE" ;
CM_ "CHFFR_METRIC 1160 DAS_steeringAngleRequest STEER_ANGLE 0.1098666 180; CHFFR_METRIC 264 DI_motorRPM ENGINE_RPM 1 0";

View File

@ -163,7 +163,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -196,6 +196,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -333,6 +336,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -360,6 +364,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -163,7 +163,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -196,6 +196,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -333,6 +336,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -360,6 +364,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -163,7 +163,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -196,6 +196,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -333,6 +336,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -360,6 +364,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -163,7 +163,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -196,6 +196,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -333,6 +336,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -360,6 +364,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -163,7 +163,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -196,6 +196,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -333,6 +336,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -360,6 +364,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -193,7 +193,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -226,6 +226,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -363,6 +366,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -390,6 +394,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -193,7 +193,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -226,6 +226,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -363,6 +366,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -390,6 +394,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -163,7 +163,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -196,6 +196,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -333,6 +336,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -360,6 +364,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -163,7 +163,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -196,6 +196,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -333,6 +336,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -360,6 +364,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -163,7 +163,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -196,6 +196,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -333,6 +336,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -360,6 +364,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -163,7 +163,7 @@ BO_ 742 LEAD_INFO: 8 DSU
BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ SET_ME_X01 : 23|2@0+ (1,0) [0|3] "" HCU
SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU
SG_ DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ MINI_CAR : 21|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X3 : 19|4@0+ (1,0) [0|15] "" XXX
@ -196,6 +196,9 @@ BO_ 951 ESP_CONTROL: 8 ESP
SG_ VSC_DISABLED : 12|2@0+ (1,0) [0|1] "" XXX
SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX
BO_ 1020 SOLAR_SENSOR: 8 XXX
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
BO_ 1041 ACC_HUD: 8 DSU
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
@ -333,6 +336,7 @@ CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active";
CM_ SG_ 643 COUNTER "only used on cars that use this msg for cruise control";
CM_ SG_ 643 BRAKE_STATUS "only used on cars that use this msg for cruise control";
CM_ SG_ 643 PRECOLLISION_ACTIVE "set 0.5s before any braking";
CM_ SG_ 835 ACC_TYPE "if 2, car is likely to have a permanent low speed lockout. 1 is ok";
CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG.";
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
@ -360,6 +364,7 @@ VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok";
VAL_ 614 STATE 3 "enabled" 1 "disabled";
VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";

View File

@ -1334,6 +1334,14 @@ BO_ 981 Licht_Anf_01: 8 XXX
BO_ 1440 RLS_01: 8 XXX
BO_ 870 Blinkmodi_02: 8 XXX
SG_ Hazard_Switch : 20|1@1+ (1,0) [0|1] "" XXX
SG_ Comfort_Signal_Left : 23|1@1+ (1,0) [0|1] "" XXX
SG_ Comfort_Signal_Right : 24|1@1+ (1,0) [0|1] "" XXX
SG_ Left_Turn_Exterior_Bulb_1 : 25|1@1+ (1,0) [0|1] "" XXX
SG_ Right_Turn_Exterior_Bulb_1 : 26|1@1+ (1,0) [0|1] "" XXX
SG_ Left_Turn_Exterior_Bulb_2 : 27|1@1+ (1,0) [0|1] "" XXX
SG_ Right_Turn_Exterior_Bulb_2 : 28|1@1+ (1,0) [0|1] "" XXX
SG_ Fast_Send_Rate_Active : 37|1@1+ (1,0) [0|1] "" XXX
BO_ 1385 HVEM_04: 8 XXX
@ -1364,6 +1372,14 @@ CM_ SG_ 294 254 "May be zero when sent by older cameras";
CM_ SG_ 294 Assist_Torque "Heading control input, torque";
CM_ SG_ 294 Assist_VZ "Heading control input, direction (sign)";
CM_ SG_ 294 HCA_Available "Must be 1 for steering rack to accept HCA commands";
CM_ SG_ 870 Hazard_Switch "Four-way flashers active";
CM_ SG_ 870 Comfort_Signal_Left "Comfort turn signal active, left";
CM_ SG_ 870 Comfort_Signal_Right "Comfort turn signal active, right";
CM_ SG_ 870 Left_Turn_Exterior_Bulb_1 "Probably front";
CM_ SG_ 870 Right_Turn_Exterior_Bulb_1 "Probably front";
CM_ SG_ 870 Left_Turn_Exterior_Bulb_2 "Probably rear";
CM_ SG_ 870 Right_Turn_Exterior_Bulb_2 "Probably rear";
CM_ SG_ 870 Fast_Send_Rate_Active "CAN message send rate";
CM_ SG_ 919 LDW_DLC "Probable DLC (distance to line crossing)";
CM_ SG_ 919 LDW_TLC "Probable TLC (time to line crossing)";
CM_ SG_ 919 LDW_Unknown "Might be a steering pressed / driver active flag";
@ -1383,3 +1399,4 @@ VAL_ 159 EPS_HCA_Status 0 "disabled" 1 "initializing" 2 "fault" 3 "ready" 4 "rej
VAL_ 173 GE_Fahrstufe 5 "P" 6 "R" 7 "N" 8 "D" 9 "S" 10 "E" 14 "T";
VAL_ 391 GearPosition 2 "P" 3 "R" 4 "N" 5 "D" 6 "D";
VAL_ 391 RegenBrakingMode 0 "default" 1 "B1" 2 "B2" 3 "B3";
VAL_ 870 Fast_Send_Rate_Active 0 "1 Hz" 1 "50 Hz";

View File

@ -1,16 +1,13 @@
import os
import subprocess
EON = os.path.isfile('/EON')
TICI = os.path.isfile('/TICI')
PC = not (EON or TICI)
PREFIX = "arm-none-eabi-"
BUILDER = "DEV"
if os.getenv("PEDAL"):
PROJECT = "pedal"
STARTUP_FILE = "startup_stm32f205xx.s"
STARTUP_FILE = "stm32fx/startup_stm32f205xx.s"
LINKER_SCRIPT = "stm32fx/stm32fx_flash.ld"
MAIN = "pedal/main.c"
PROJECT_FLAGS = [
"-mcpu=cortex-m3",
@ -20,10 +17,13 @@ if os.getenv("PEDAL"):
"-O2",
"-DPEDAL",
]
if os.getenv("PEDAL_USB"):
PROJECT_FLAGS.append("-DPEDAL_USB")
else:
PROJECT = "panda"
STARTUP_FILE = "startup_stm32f413xx.s"
STARTUP_FILE = "stm32fx/startup_stm32f413xx.s"
LINKER_SCRIPT = "stm32fx/stm32fx_flash.ld"
MAIN = "main.c"
PROJECT_FLAGS = [
"-mcpu=cortex-m4",
@ -34,12 +34,9 @@ else:
"-fsingle-precision-constant",
"-Os",
"-g",
"-DPANDA",
]
if not PC:
PROJECT_FLAGS += ["-DEON"]
BUILDER = "EON"
def get_version(builder, build_type):
version_file = File('../VERSION').srcnode().abspath
@ -85,7 +82,7 @@ def objcopy(source, target, env, for_signature):
return '$OBJCOPY -O binary %s %s' % (source[0], target[0])
linkerscript_fn = File("stm32_flash.ld").srcnode().abspath
linkerscript_fn = File(LINKER_SCRIPT).srcnode().abspath
flags = [
"-Wall",
@ -112,7 +109,7 @@ else:
flags += ["-DALLOW_DEBUG"]
includes = [
"inc",
"stm32fx/inc",
"..",
".",
]

View File

@ -213,9 +213,6 @@ void black_init(void) {
if (car_harness_status == HARNESS_STATUS_FLIPPED) {
can_flip_buses(0, 2);
}
// init multiplexer
can_set_obd(car_harness_status, false);
}
const harness_configuration black_harness_config = {
@ -235,6 +232,11 @@ const harness_configuration black_harness_config = {
const board board_black = {
.board_type = "Black",
.harness_config = &black_harness_config,
.has_gps = true,
.has_hw_gmlan = false,
.has_obd = true,
.has_lin = false,
.has_rtc = false,
.init = black_init,
.enable_can_transceiver = black_enable_can_transceiver,
.enable_can_transceivers = black_enable_can_transceivers,

View File

@ -18,6 +18,11 @@ typedef void (*board_set_siren)(bool enabled);
struct board {
const char *board_type;
const harness_configuration *harness_config;
const bool has_gps;
const bool has_hw_gmlan;
const bool has_obd;
const bool has_lin;
const bool has_rtc;
board_init init;
board_enable_can_transceiver enable_can_transceiver;
board_enable_can_transceivers enable_can_transceivers;
@ -69,11 +74,3 @@ struct board {
// ********************* Globals **********************
uint8_t usb_power_mode = USB_POWER_NONE;
// ************ Board function prototypes *************
bool board_has_gps(void);
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);

View File

@ -204,9 +204,6 @@ void dos_init(void) {
can_flip_buses(0, 2);
}
// 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);
}
@ -228,6 +225,11 @@ const harness_configuration dos_harness_config = {
const board board_dos = {
.board_type = "Dos",
.harness_config = &dos_harness_config,
.has_gps = false,
.has_hw_gmlan = false,
.has_obd = true,
.has_lin = false,
.has_rtc = true,
.init = dos_init,
.enable_can_transceiver = dos_enable_can_transceiver,
.enable_can_transceivers = dos_enable_can_transceivers,

View File

@ -36,6 +36,11 @@ void grey_set_gps_mode(uint8_t mode) {
const board board_grey = {
.board_type = "Grey",
.harness_config = &white_harness_config,
.has_gps = true,
.has_hw_gmlan = true,
.has_obd = false,
.has_lin = true,
.has_rtc = false,
.init = grey_init,
.enable_can_transceiver = white_enable_can_transceiver,
.enable_can_transceivers = white_enable_can_transceivers,

View File

@ -109,6 +109,11 @@ const harness_configuration pedal_harness_config = {
const board board_pedal = {
.board_type = "Pedal",
.harness_config = &pedal_harness_config,
.has_gps = false,
.has_hw_gmlan = false,
.has_obd = false,
.has_lin = false,
.has_rtc = false,
.init = pedal_init,
.enable_can_transceiver = pedal_enable_can_transceiver,
.enable_can_transceivers = pedal_enable_can_transceivers,

View File

@ -250,9 +250,6 @@ void uno_init(void) {
can_flip_buses(0, 2);
}
// init multiplexer
can_set_obd(car_harness_status, false);
// Switch to phone usb mode if harness connection is powered by less than 7V
if(adc_get_voltage() < 7000U){
uno_set_usb_switch(true);
@ -281,6 +278,11 @@ const harness_configuration uno_harness_config = {
const board board_uno = {
.board_type = "Uno",
.harness_config = &uno_harness_config,
.has_gps = true,
.has_hw_gmlan = false,
.has_obd = true,
.has_lin = false,
.has_rtc = true,
.init = uno_init,
.enable_can_transceiver = uno_enable_can_transceiver,
.enable_can_transceivers = uno_enable_can_transceivers,

View File

@ -78,13 +78,6 @@ void white_set_gps_mode(uint8_t mode) {
set_gpio_output(GPIOC, 14, 0);
set_gpio_output(GPIOC, 5, 0);
break;
#ifndef EON
case GPS_ENABLED:
// ESP ON
set_gpio_output(GPIOC, 14, 1);
set_gpio_output(GPIOC, 5, 1);
break;
#endif
case GPS_BOOTMODE:
set_gpio_output(GPIOC, 14, 1);
set_gpio_output(GPIOC, 5, 0);
@ -158,71 +151,8 @@ uint32_t white_read_current(void){
return adc_get(ADCCHAN_CURRENT);
}
uint32_t marker = 0;
void white_usb_power_mode_tick(uint32_t uptime){
// on EON or BOOTSTUB, no state machine
#if !defined(BOOTSTUB) && !defined(EON)
#define CURRENT_THRESHOLD 0xF00U
#define CLICKS 5U // 5 seconds to switch modes
uint32_t current = white_read_current();
// ~0x9a = 500 ma
// puth(current); puts("\n");
switch (usb_power_mode) {
case USB_POWER_CLIENT:
if ((uptime - marker) >= CLICKS) {
if (!is_enumerated) {
puts("USBP: didn't enumerate, switching to CDP mode\n");
// switch to CDP
white_set_usb_power_mode(USB_POWER_CDP);
marker = uptime;
}
}
// keep resetting the timer if it's enumerated
if (is_enumerated) {
marker = uptime;
}
break;
case USB_POWER_CDP:
// been CLICKS clicks since we switched to CDP
if ((uptime - marker) >= CLICKS) {
// measure current draw, if positive and no enumeration, switch to DCP
if (!is_enumerated && (current < CURRENT_THRESHOLD)) {
puts("USBP: no enumeration with current draw, switching to DCP mode\n");
white_set_usb_power_mode(USB_POWER_DCP);
marker = uptime;
}
}
// keep resetting the timer if there's no current draw in CDP
if (current >= CURRENT_THRESHOLD) {
marker = uptime;
}
break;
case USB_POWER_DCP:
// been at least CLICKS clicks since we switched to DCP
if ((uptime - marker) >= CLICKS) {
// if no current draw, switch back to CDP
if (current >= CURRENT_THRESHOLD) {
puts("USBP: no current draw, switching back to CDP mode\n");
white_set_usb_power_mode(USB_POWER_CDP);
marker = uptime;
}
}
// keep resetting the timer if there's current draw in DCP
if (current < CURRENT_THRESHOLD) {
marker = uptime;
}
break;
default:
puts("USB power mode invalid\n"); // set_usb_power_mode prevents assigning invalid values
break;
}
#else
UNUSED(uptime);
#endif
}
void white_set_ir_power(uint8_t percentage){
@ -313,7 +243,7 @@ void white_grey_common_init(void) {
// Init usb power mode
uint32_t voltage = adc_get_voltage();
// Init in CDP mode only if panda is powered by 12V.
// Otherwise a PC would not be able to flash a standalone panda with EON build
// Otherwise a PC would not be able to flash a standalone panda
if (voltage > 8000U) { // 8V threshold
white_set_usb_power_mode(USB_POWER_CDP);
} else {
@ -335,6 +265,11 @@ const harness_configuration white_harness_config = {
const board board_white = {
.board_type = "White",
.harness_config = &white_harness_config,
.has_gps = false,
.has_hw_gmlan = true,
.has_obd = false,
.has_lin = true,
.has_rtc = false,
.init = white_init,
.enable_can_transceiver = white_enable_can_transceiver,
.enable_can_transceivers = white_enable_can_transceivers,

View File

@ -3,62 +3,24 @@
#define VERS_TAG 0x53524556
#define MIN_VERSION 2
#include "config.h"
#include "obj/gitversion.h"
#ifdef STM32F4
#define PANDA
#include "stm32f4xx.h"
#include "stm32f4xx_hal_gpio_ex.h"
#else
#include "stm32f2xx.h"
#include "stm32f2xx_hal_gpio_ex.h"
#endif
// ******************** Prototypes ********************
void puts(const char *a){ UNUSED(a); }
void puth(unsigned int i){ UNUSED(i); }
void puth2(unsigned int i){ UNUSED(i); }
typedef struct board board;
typedef struct harness_configuration harness_configuration;
// No CAN support on bootloader
void can_flip_buses(uint8_t bus1, uint8_t bus2){UNUSED(bus1); UNUSED(bus2);}
void can_set_obd(int harness_orientation, bool obd){UNUSED(harness_orientation); UNUSED(obd);}
// ********************* Globals **********************
int hw_type = 0;
const board *current_board;
// ********************* Includes *********************
#include "libc.h"
#include "provision.h"
#include "critical.h"
#include "faults.h"
#include "config.h"
#include "drivers/registers.h"
#include "drivers/interrupts.h"
#include "drivers/clock.h"
#include "drivers/llgpio.h"
#include "drivers/adc.h"
#include "drivers/pwm.h"
#include "board.h"
#include "gpio.h"
#include "drivers/spi.h"
#include "drivers/usb.h"
//#include "drivers/uart.h"
#include "early_init.h"
#include "provision.h"
#include "crypto/rsa.h"
#include "crypto/sha.h"
#include "obj/cert.h"
#include "obj/gitversion.h"
#include "spi_flasher.h"
void __initialize_hardware_early(void) {
early();
early_initialization();
}
void fail(void) {
@ -77,7 +39,7 @@ int main(void) {
disable_interrupts();
clock_init();
detect_configuration();
detect_external_debug_serial();
detect_board_type();
if (enter_bootloader_mode == ENTER_SOFTLOADER_MAGIC) {
@ -121,4 +83,3 @@ good:
((void(*)(void)) _app_start[1])();
return 0;
}

View File

@ -0,0 +1,14 @@
// ******************** Prototypes ********************
void puts(const char *a){ UNUSED(a); }
void puth(uint8_t i){ UNUSED(i); }
void puth2(uint8_t i){ UNUSED(i); }
typedef struct board board;
typedef struct harness_configuration harness_configuration;
// No CAN support on bootloader
void can_flip_buses(uint8_t bus1, uint8_t bus2){UNUSED(bus1); UNUSED(bus2);}
void pwm_init(TIM_TypeDef *TIM, uint8_t channel);
void pwm_set(TIM_TypeDef *TIM, uint8_t channel, uint8_t percentage);
// ********************* Globals **********************
uint8_t hw_type = 0;
const board *current_board;

View File

@ -7,22 +7,14 @@
//#define DEBUG_SPI
//#define DEBUG_FAULTS
#ifdef STM32F4
#define PANDA
#include "stm32f4xx.h"
#else
#include "stm32f2xx.h"
#endif
#define USB_VID 0xbbaaU
#ifdef BOOTSTUB
#define USB_PID 0xddeeU
#define USB_PID 0xddeeU
#else
#define USB_PID 0xddccU
#define USB_PID 0xddccU
#endif
#include <stdbool.h>
#define NULL ((void*)0)
#define COMPILE_TIME_ASSERT(pred) ((void)sizeof(char[1 - (2 * ((int)(!(pred))))]))
@ -42,8 +34,7 @@
#define MAX_RESP_LEN 0x40U
// Around (1Mbps / 8 bits/byte / 12 bytes per message)
#define CAN_INTERRUPT_RATE 12000U
#include <stdbool.h>
#include "stm32fx/stm32fx_config.h"
#endif

View File

@ -1,6 +1,7 @@
uint8_t crc_checksum(uint8_t *dat, int len, const uint8_t poly) {
uint8_t crc = 0xFF;
int i, j;
uint8_t crc = 0xFFU;
int i;
int j;
for (i = len - 1; i >= 0; i--) {
crc ^= dat[i];
for (j = 0; j < 8; j++) {

View File

@ -18,10 +18,13 @@ uint32_t can_rx_errs = 0;
uint32_t can_send_errs = 0;
uint32_t can_fwd_errs = 0;
uint32_t gmlan_send_errs = 0;
extern int can_live, pending_can_live;
extern int can_live;
extern int pending_can_live;
// must reinit after changing these
extern int can_loopback, can_silent;
extern int can_loopback;
extern int can_silent;
extern uint32_t can_speed[4];
void can_set_forwarding(int from, int to);
@ -42,19 +45,23 @@ uint32_t ignition_can_cnt = 0U;
#define ALL_CAN_SILENT 0xFF
#define ALL_CAN_LIVE 0
int can_live = 0, pending_can_live = 0, can_loopback = 0, can_silent = ALL_CAN_SILENT;
int can_live = 0;
int pending_can_live = 0;
int can_loopback = 0;
int can_silent = ALL_CAN_SILENT;
// ********************* instantiate queues *********************
#define can_buffer(x, size) \
CAN_FIFOMailBox_TypeDef elems_##x[size]; \
can_ring can_##x = { .w_ptr = 0, .r_ptr = 0, .fifo_size = size, .elems = (CAN_FIFOMailBox_TypeDef *)&elems_##x };
can_ring can_##x = { .w_ptr = 0, .r_ptr = 0, .fifo_size = (size), .elems = (CAN_FIFOMailBox_TypeDef *)&(elems_##x) };
can_buffer(rx_q, 0x1000)
can_buffer(tx1_q, 0x100)
can_buffer(tx2_q, 0x100)
can_buffer(tx3_q, 0x100)
can_buffer(txgmlan_q, 0x100)
// FIXME:
// cppcheck-suppress misra-c2012-9.3
can_ring *can_queues[] = {&can_tx1_q, &can_tx2_q, &can_tx3_q, &can_txgmlan_q};
// global CAN stats
@ -65,7 +72,6 @@ int can_err_cnt = 0;
int can_overflow_cnt = 0;
// ********************* interrupt safe queue *********************
bool can_pop(can_ring *q, CAN_FIFOMailBox_TypeDef *elem) {
bool ret = 0;
@ -181,7 +187,7 @@ void can_flip_buses(uint8_t bus1, uint8_t bus2){
// TODO: Cleanup with new abstraction
void can_set_gmlan(uint8_t bus) {
if(board_has_gmlan()){
if(current_board->has_hw_gmlan){
// first, disable GMLAN on prev bus
uint8_t prev_bus = can_num_lookup[3];
if (bus != prev_bus) {
@ -229,34 +235,6 @@ void can_set_gmlan(uint8_t bus) {
}
}
// TODO: remove
void can_set_obd(uint8_t harness_orientation, bool obd){
if(obd){
puts("setting CAN2 to be OBD\n");
} else {
puts("setting CAN2 to be normal\n");
}
if(board_has_obd()){
if(obd != (bool)(harness_orientation == HARNESS_STATUS_NORMAL)){
// B5,B6: disable normal mode
set_gpio_mode(GPIOB, 5, MODE_INPUT);
set_gpio_mode(GPIOB, 6, MODE_INPUT);
// B12,B13: CAN2 mode
set_gpio_alternate(GPIOB, 12, GPIO_AF9_CAN2);
set_gpio_alternate(GPIOB, 13, GPIO_AF9_CAN2);
} else {
// B5,B6: CAN2 mode
set_gpio_alternate(GPIOB, 5, GPIO_AF9_CAN2);
set_gpio_alternate(GPIOB, 6, GPIO_AF9_CAN2);
// B12,B13: disable normal mode
set_gpio_mode(GPIOB, 12, MODE_INPUT);
set_gpio_mode(GPIOB, 13, MODE_INPUT);
}
} else {
puts("OBD CAN not available on this board\n");
}
}
// CAN error
void can_sce(CAN_TypeDef *CAN) {
ENTER_CRITICAL();
@ -286,7 +264,6 @@ void can_sce(CAN_TypeDef *CAN) {
}
// ***************************** CAN *****************************
void process_can(uint8_t can_number) {
if (can_number != 0xffU) {
@ -479,4 +456,3 @@ bool can_init(uint8_t can_number) {
}
return ret;
}

View File

@ -1,39 +1,14 @@
uint16_t fan_tach_counter = 0U;
uint16_t fan_rpm = 0U;
void fan_set_power(uint8_t percentage){
pwm_set(TIM3, 3, percentage);
}
uint16_t fan_tach_counter = 0U;
uint16_t fan_rpm = 0U;
// Can be way more acurate than this, but this is probably good enough for our purposes.
// Call this every second
void fan_tick(void){
// 4 interrupts per rotation
fan_rpm = fan_tach_counter * 15U;
fan_tach_counter = 0U;
}
// TACH interrupt handler
void EXTI2_IRQ_Handler(void) {
volatile unsigned int pr = EXTI->PR & (1U << 2);
if ((pr & (1U << 2)) != 0U) {
fan_tach_counter++;
}
EXTI->PR = (1U << 2);
}
void fan_init(void){
// 5000RPM * 4 tach edges / 60 seconds
REGISTER_INTERRUPT(EXTI2_IRQn, EXTI2_IRQ_Handler, 700U, FAULT_INTERRUPT_RATE_TACH)
// Init PWM speed control
pwm_init(TIM3, 3);
// Init TACH interrupt
register_set(&(SYSCFG->EXTICR[0]), SYSCFG_EXTICR1_EXTI2_PD, 0xF00U);
register_set_bits(&(EXTI->IMR), (1U << 2));
register_set_bits(&(EXTI->RTSR), (1U << 2));
register_set_bits(&(EXTI->FTSR), (1U << 2));
NVIC_EnableIRQ(EXTI2_IRQn);
}

View File

@ -288,4 +288,3 @@ bool bitbang_gmlan(CAN_FIFOMailBox_TypeDef *to_bang) {
}
return gmlan_send_ok;
}

View File

@ -63,3 +63,13 @@ int get_gpio_input(GPIO_TypeDef *GPIO, unsigned int pin) {
return (GPIO->IDR & (1U << pin)) == (1U << pin);
}
// Detection with internal pullup
#define PULL_EFFECTIVE_DELAY 4096
bool detect_with_pull(GPIO_TypeDef *GPIO, int pin, int mode) {
set_gpio_mode(GPIO, pin, MODE_INPUT);
set_gpio_pullup(GPIO, pin, mode);
for (volatile int i=0; i<PULL_EFFECTIVE_DELAY; i++);
bool ret = get_gpio_input(GPIO, pin);
set_gpio_pullup(GPIO, pin, PULL_NONE);
return ret;
}

View File

@ -3,9 +3,6 @@ uint8_t car_harness_status = 0U;
#define HARNESS_STATUS_NORMAL 1U
#define HARNESS_STATUS_FLIPPED 2U
// Threshold voltage (mV) for either of the SBUs to be below before deciding harness is connected
#define HARNESS_CONNECTED_THRESHOLD 2500U
struct harness_configuration {
const bool has_harness;
GPIO_TypeDef *GPIO_SBU1;

View File

@ -6,21 +6,22 @@ typedef struct interrupt {
uint32_t call_rate_fault;
} interrupt;
void interrupt_timer_init(void);
void unused_interrupt_handler(void) {
// Something is wrong if this handler is called!
puts("Unused interrupt handler called!\n");
fault_occurred(FAULT_UNUSED_INTERRUPT_HANDLED);
}
#define NUM_INTERRUPTS 102U // There are 102 external interrupt sources (see stm32f413.h)
interrupt interrupts[NUM_INTERRUPTS];
#define REGISTER_INTERRUPT(irq_num, func_ptr, call_rate, rate_fault) \
interrupts[irq_num].irq_type = irq_num; \
interrupts[irq_num].handler = func_ptr; \
interrupts[irq_num].irq_type = (irq_num); \
interrupts[irq_num].handler = (func_ptr); \
interrupts[irq_num].call_counter = 0U; \
interrupts[irq_num].max_call_rate = call_rate; \
interrupts[irq_num].call_rate_fault = rate_fault;
interrupts[irq_num].max_call_rate = (call_rate); \
interrupts[irq_num].call_rate_fault = (rate_fault);
bool check_interrupt_rate = false;
@ -36,13 +37,13 @@ void handle_interrupt(IRQn_Type irq_type){
}
// Reset interrupt counter every second
void TIM6_DAC_IRQ_Handler(void) {
if (TIM6->SR != 0) {
void interrupt_timer_handler(void) {
if (INTERRUPT_TIMER->SR != 0) {
for(uint16_t i=0U; i<NUM_INTERRUPTS; i++){
interrupts[i].call_counter = 0U;
}
}
TIM6->SR = 0;
INTERRUPT_TIMER->SR = 0;
}
void init_interrupts(bool check_rate_limit){
@ -52,113 +53,6 @@ void init_interrupts(bool check_rate_limit){
interrupts[i].handler = unused_interrupt_handler;
}
// Init timer 10 for a 1s interval
register_set_bits(&(RCC->APB1ENR), RCC_APB1ENR_TIM6EN); // Enable interrupt timer peripheral
REGISTER_INTERRUPT(TIM6_DAC_IRQn, TIM6_DAC_IRQ_Handler, 1, FAULT_INTERRUPT_RATE_INTERRUPTS)
register_set(&(TIM6->PSC), (732-1), 0xFFFFU);
register_set(&(TIM6->DIER), TIM_DIER_UIE, 0x5F5FU);
register_set(&(TIM6->CR1), TIM_CR1_CEN, 0x3FU);
TIM6->SR = 0;
NVIC_EnableIRQ(TIM6_DAC_IRQn);
// Init interrupt timer for a 1s interval
interrupt_timer_init();
}
// ********************* Bare interrupt handlers *********************
// Only implemented the STM32F413 interrupts for now, the STM32F203 specific ones do not fall into the scope of SIL2
void WWDG_IRQHandler(void) {handle_interrupt(WWDG_IRQn);}
void PVD_IRQHandler(void) {handle_interrupt(PVD_IRQn);}
void TAMP_STAMP_IRQHandler(void) {handle_interrupt(TAMP_STAMP_IRQn);}
void RTC_WKUP_IRQHandler(void) {handle_interrupt(RTC_WKUP_IRQn);}
void FLASH_IRQHandler(void) {handle_interrupt(FLASH_IRQn);}
void RCC_IRQHandler(void) {handle_interrupt(RCC_IRQn);}
void EXTI0_IRQHandler(void) {handle_interrupt(EXTI0_IRQn);}
void EXTI1_IRQHandler(void) {handle_interrupt(EXTI1_IRQn);}
void EXTI2_IRQHandler(void) {handle_interrupt(EXTI2_IRQn);}
void EXTI3_IRQHandler(void) {handle_interrupt(EXTI3_IRQn);}
void EXTI4_IRQHandler(void) {handle_interrupt(EXTI4_IRQn);}
void DMA1_Stream0_IRQHandler(void) {handle_interrupt(DMA1_Stream0_IRQn);}
void DMA1_Stream1_IRQHandler(void) {handle_interrupt(DMA1_Stream1_IRQn);}
void DMA1_Stream2_IRQHandler(void) {handle_interrupt(DMA1_Stream2_IRQn);}
void DMA1_Stream3_IRQHandler(void) {handle_interrupt(DMA1_Stream3_IRQn);}
void DMA1_Stream4_IRQHandler(void) {handle_interrupt(DMA1_Stream4_IRQn);}
void DMA1_Stream5_IRQHandler(void) {handle_interrupt(DMA1_Stream5_IRQn);}
void DMA1_Stream6_IRQHandler(void) {handle_interrupt(DMA1_Stream6_IRQn);}
void ADC_IRQHandler(void) {handle_interrupt(ADC_IRQn);}
void CAN1_TX_IRQHandler(void) {handle_interrupt(CAN1_TX_IRQn);}
void CAN1_RX0_IRQHandler(void) {handle_interrupt(CAN1_RX0_IRQn);}
void CAN1_RX1_IRQHandler(void) {handle_interrupt(CAN1_RX1_IRQn);}
void CAN1_SCE_IRQHandler(void) {handle_interrupt(CAN1_SCE_IRQn);}
void EXTI9_5_IRQHandler(void) {handle_interrupt(EXTI9_5_IRQn);}
void TIM1_BRK_TIM9_IRQHandler(void) {handle_interrupt(TIM1_BRK_TIM9_IRQn);}
void TIM1_UP_TIM10_IRQHandler(void) {handle_interrupt(TIM1_UP_TIM10_IRQn);}
void TIM1_TRG_COM_TIM11_IRQHandler(void) {handle_interrupt(TIM1_TRG_COM_TIM11_IRQn);}
void TIM1_CC_IRQHandler(void) {handle_interrupt(TIM1_CC_IRQn);}
void TIM2_IRQHandler(void) {handle_interrupt(TIM2_IRQn);}
void TIM3_IRQHandler(void) {handle_interrupt(TIM3_IRQn);}
void TIM4_IRQHandler(void) {handle_interrupt(TIM4_IRQn);}
void I2C1_EV_IRQHandler(void) {handle_interrupt(I2C1_EV_IRQn);}
void I2C1_ER_IRQHandler(void) {handle_interrupt(I2C1_ER_IRQn);}
void I2C2_EV_IRQHandler(void) {handle_interrupt(I2C2_EV_IRQn);}
void I2C2_ER_IRQHandler(void) {handle_interrupt(I2C2_ER_IRQn);}
void SPI1_IRQHandler(void) {handle_interrupt(SPI1_IRQn);}
void SPI2_IRQHandler(void) {handle_interrupt(SPI2_IRQn);}
void USART1_IRQHandler(void) {handle_interrupt(USART1_IRQn);}
void USART2_IRQHandler(void) {handle_interrupt(USART2_IRQn);}
void USART3_IRQHandler(void) {handle_interrupt(USART3_IRQn);}
void EXTI15_10_IRQHandler(void) {handle_interrupt(EXTI15_10_IRQn);}
void RTC_Alarm_IRQHandler(void) {handle_interrupt(RTC_Alarm_IRQn);}
void OTG_FS_WKUP_IRQHandler(void) {handle_interrupt(OTG_FS_WKUP_IRQn);}
void TIM8_BRK_TIM12_IRQHandler(void) {handle_interrupt(TIM8_BRK_TIM12_IRQn);}
void TIM8_UP_TIM13_IRQHandler(void) {handle_interrupt(TIM8_UP_TIM13_IRQn);}
void TIM8_TRG_COM_TIM14_IRQHandler(void) {handle_interrupt(TIM8_TRG_COM_TIM14_IRQn);}
void TIM8_CC_IRQHandler(void) {handle_interrupt(TIM8_CC_IRQn);}
void DMA1_Stream7_IRQHandler(void) {handle_interrupt(DMA1_Stream7_IRQn);}
void FSMC_IRQHandler(void) {handle_interrupt(FSMC_IRQn);}
void SDIO_IRQHandler(void) {handle_interrupt(SDIO_IRQn);}
void TIM5_IRQHandler(void) {handle_interrupt(TIM5_IRQn);}
void SPI3_IRQHandler(void) {handle_interrupt(SPI3_IRQn);}
void UART4_IRQHandler(void) {handle_interrupt(UART4_IRQn);}
void UART5_IRQHandler(void) {handle_interrupt(UART5_IRQn);}
void TIM6_DAC_IRQHandler(void) {handle_interrupt(TIM6_DAC_IRQn);}
void TIM7_IRQHandler(void) {handle_interrupt(TIM7_IRQn);}
void DMA2_Stream0_IRQHandler(void) {handle_interrupt(DMA2_Stream0_IRQn);}
void DMA2_Stream1_IRQHandler(void) {handle_interrupt(DMA2_Stream1_IRQn);}
void DMA2_Stream2_IRQHandler(void) {handle_interrupt(DMA2_Stream2_IRQn);}
void DMA2_Stream3_IRQHandler(void) {handle_interrupt(DMA2_Stream3_IRQn);}
void DMA2_Stream4_IRQHandler(void) {handle_interrupt(DMA2_Stream4_IRQn);}
void CAN2_TX_IRQHandler(void) {handle_interrupt(CAN2_TX_IRQn);}
void CAN2_RX0_IRQHandler(void) {handle_interrupt(CAN2_RX0_IRQn);}
void CAN2_RX1_IRQHandler(void) {handle_interrupt(CAN2_RX1_IRQn);}
void CAN2_SCE_IRQHandler(void) {handle_interrupt(CAN2_SCE_IRQn);}
void OTG_FS_IRQHandler(void) {handle_interrupt(OTG_FS_IRQn);}
void DMA2_Stream5_IRQHandler(void) {handle_interrupt(DMA2_Stream5_IRQn);}
void DMA2_Stream6_IRQHandler(void) {handle_interrupt(DMA2_Stream6_IRQn);}
void DMA2_Stream7_IRQHandler(void) {handle_interrupt(DMA2_Stream7_IRQn);}
void USART6_IRQHandler(void) {handle_interrupt(USART6_IRQn);}
void I2C3_EV_IRQHandler(void) {handle_interrupt(I2C3_EV_IRQn);}
void I2C3_ER_IRQHandler(void) {handle_interrupt(I2C3_ER_IRQn);}
#ifdef STM32F4
void DFSDM1_FLT0_IRQHandler(void) {handle_interrupt(DFSDM1_FLT0_IRQn);}
void DFSDM1_FLT1_IRQHandler(void) {handle_interrupt(DFSDM1_FLT1_IRQn);}
void CAN3_TX_IRQHandler(void) {handle_interrupt(CAN3_TX_IRQn);}
void CAN3_RX0_IRQHandler(void) {handle_interrupt(CAN3_RX0_IRQn);}
void CAN3_RX1_IRQHandler(void) {handle_interrupt(CAN3_RX1_IRQn);}
void CAN3_SCE_IRQHandler(void) {handle_interrupt(CAN3_SCE_IRQn);}
void RNG_IRQHandler(void) {handle_interrupt(RNG_IRQn);}
void FPU_IRQHandler(void) {handle_interrupt(FPU_IRQn);}
void UART7_IRQHandler(void) {handle_interrupt(UART7_IRQn);}
void UART8_IRQHandler(void) {handle_interrupt(UART8_IRQn);}
void SPI4_IRQHandler(void) {handle_interrupt(SPI4_IRQn);}
void SPI5_IRQHandler(void) {handle_interrupt(SPI5_IRQn);}
void SAI1_IRQHandler(void) {handle_interrupt(SAI1_IRQn);}
void UART9_IRQHandler(void) {handle_interrupt(UART9_IRQn);}
void UART10_IRQHandler(void) {handle_interrupt(UART10_IRQn);}
void QUADSPI_IRQHandler(void) {handle_interrupt(QUADSPI_IRQn);}
void FMPI2C1_EV_IRQHandler(void) {handle_interrupt(FMPI2C1_EV_IRQn);}
void FMPI2C1_ER_IRQHandler(void) {handle_interrupt(FMPI2C1_ER_IRQn);}
void LPTIM1_IRQHandler(void) {handle_interrupt(LPTIM1_IRQn);}
void DFSDM2_FLT0_IRQHandler(void) {handle_interrupt(DFSDM2_FLT0_IRQn);}
void DFSDM2_FLT1_IRQHandler(void) {handle_interrupt(DFSDM2_FLT1_IRQn);}
void DFSDM2_FLT2_IRQHandler(void) {handle_interrupt(DFSDM2_FLT2_IRQn);}
void DFSDM2_FLT3_IRQHandler(void) {handle_interrupt(DFSDM2_FLT3_IRQn);}
#endif

View File

@ -53,4 +53,4 @@ void pwm_set(TIM_TypeDef *TIM, uint8_t channel, uint8_t percentage){
default:
break;
}
}
}

View File

@ -8,7 +8,7 @@ typedef struct reg {
// 10 bit hash with 23 as a prime
#define REGISTER_MAP_SIZE 0x3FFU
#define HASHING_PRIME 23U
#define CHECK_COLLISION(hash, addr) (((uint32_t) register_map[hash].address != 0U) && (register_map[hash].address != addr))
#define CHECK_COLLISION(hash, addr) (((uint32_t) register_map[hash].address != 0U) && (register_map[hash].address != (addr)))
reg register_map[REGISTER_MAP_SIZE];
@ -78,4 +78,4 @@ void init_registers(void) {
register_map[i].address = (volatile uint32_t *) 0U;
register_map[i].check_mask = 0U;
}
}
}

View File

@ -1,5 +1,4 @@
#define RCC_BDCR_OPTIONS (RCC_BDCR_RTCEN | RCC_BDCR_RTCSEL_0 | RCC_BDCR_LSEON)
#define RCC_BDCR_MASK (RCC_BDCR_RTCEN | RCC_BDCR_RTCSEL | RCC_BDCR_LSEMOD | RCC_BDCR_LSEBYP | RCC_BDCR_LSEON)
#define YEAR_OFFSET 2000U
@ -14,95 +13,95 @@ typedef struct __attribute__((packed)) timestamp_t {
} timestamp_t;
uint8_t to_bcd(uint16_t value){
return (((value / 10U) & 0x0FU) << 4U) | ((value % 10U) & 0x0FU);
return (((value / 10U) & 0x0FU) << 4U) | ((value % 10U) & 0x0FU);
}
uint16_t from_bcd(uint8_t value){
return (((value & 0xF0U) >> 4U) * 10U) + (value & 0x0FU);
return (((value & 0xF0U) >> 4U) * 10U) + (value & 0x0FU);
}
void rtc_init(void){
if(board_has_rtc()){
// Initialize RTC module and clock if not done already.
if((RCC->BDCR & RCC_BDCR_MASK) != RCC_BDCR_OPTIONS){
puts("Initializing RTC\n");
// Reset backup domain
register_set_bits(&(RCC->BDCR), RCC_BDCR_BDRST);
if(current_board->has_rtc){
// Initialize RTC module and clock if not done already.
if((RCC->BDCR & RCC_BDCR_MASK) != RCC_BDCR_OPTIONS){
puts("Initializing RTC\n");
// Reset backup domain
register_set_bits(&(RCC->BDCR), RCC_BDCR_BDRST);
// Disable write protection
register_set_bits(&(PWR->CR), PWR_CR_DBP);
// Disable write protection
disable_bdomain_protection();
// Clear backup domain reset
register_clear_bits(&(RCC->BDCR), RCC_BDCR_BDRST);
// Clear backup domain reset
register_clear_bits(&(RCC->BDCR), RCC_BDCR_BDRST);
// Set RTC options
register_set(&(RCC->BDCR), RCC_BDCR_OPTIONS, RCC_BDCR_MASK);
// Set RTC options
register_set(&(RCC->BDCR), RCC_BDCR_OPTIONS, RCC_BDCR_MASK);
// Enable write protection
register_clear_bits(&(PWR->CR), PWR_CR_DBP);
}
// Enable write protection
enable_bdomain_protection();
}
}
}
void rtc_set_time(timestamp_t time){
if(board_has_rtc()){
puts("Setting RTC time\n");
if(current_board->has_rtc){
puts("Setting RTC time\n");
// Disable write protection
register_set_bits(&(PWR->CR), PWR_CR_DBP);
RTC->WPR = 0xCA;
RTC->WPR = 0x53;
// Disable write protection
disable_bdomain_protection();
RTC->WPR = 0xCA;
RTC->WPR = 0x53;
// Enable initialization mode
register_set_bits(&(RTC->ISR), RTC_ISR_INIT);
while((RTC->ISR & RTC_ISR_INITF) == 0){}
// Enable initialization mode
register_set_bits(&(RTC->ISR), RTC_ISR_INIT);
while((RTC->ISR & RTC_ISR_INITF) == 0){}
// Set time
RTC->TR = (to_bcd(time.hour) << RTC_TR_HU_Pos) | (to_bcd(time.minute) << RTC_TR_MNU_Pos) | (to_bcd(time.second) << RTC_TR_SU_Pos);
RTC->DR = (to_bcd(time.year - YEAR_OFFSET) << RTC_DR_YU_Pos) | (time.weekday << RTC_DR_WDU_Pos) | (to_bcd(time.month) << RTC_DR_MU_Pos) | (to_bcd(time.day) << RTC_DR_DU_Pos);
// Set time
RTC->TR = (to_bcd(time.hour) << RTC_TR_HU_Pos) | (to_bcd(time.minute) << RTC_TR_MNU_Pos) | (to_bcd(time.second) << RTC_TR_SU_Pos);
RTC->DR = (to_bcd(time.year - YEAR_OFFSET) << RTC_DR_YU_Pos) | (time.weekday << RTC_DR_WDU_Pos) | (to_bcd(time.month) << RTC_DR_MU_Pos) | (to_bcd(time.day) << RTC_DR_DU_Pos);
// Set options
register_set(&(RTC->CR), 0U, 0xFCFFFFU);
// Set options
register_set(&(RTC->CR), 0U, 0xFCFFFFU);
// Disable initalization mode
register_clear_bits(&(RTC->ISR), RTC_ISR_INIT);
// Disable initalization mode
register_clear_bits(&(RTC->ISR), RTC_ISR_INIT);
// Wait for synchronization
while((RTC->ISR & RTC_ISR_RSF) == 0){}
// Wait for synchronization
while((RTC->ISR & RTC_ISR_RSF) == 0){}
// Re-enable write protection
RTC->WPR = 0x00;
register_clear_bits(&(PWR->CR), PWR_CR_DBP);
}
// Re-enable write protection
RTC->WPR = 0x00;
enable_bdomain_protection();
}
}
timestamp_t rtc_get_time(void){
timestamp_t result;
// Init with zero values in case there is no RTC running
result.year = 0U;
result.month = 0U;
result.day = 0U;
result.weekday = 0U;
result.hour = 0U;
result.minute = 0U;
result.second = 0U;
timestamp_t result;
// Init with zero values in case there is no RTC running
result.year = 0U;
result.month = 0U;
result.day = 0U;
result.weekday = 0U;
result.hour = 0U;
result.minute = 0U;
result.second = 0U;
if(board_has_rtc()){
// Wait until the register sync flag is set
while((RTC->ISR & RTC_ISR_RSF) == 0){}
if(current_board->has_rtc){
// Wait until the register sync flag is set
while((RTC->ISR & RTC_ISR_RSF) == 0){}
// Read time and date registers. Since our HSE > 7*LSE, this should be fine.
uint32_t time = RTC->TR;
uint32_t date = RTC->DR;
// Read time and date registers. Since our HSE > 7*LSE, this should be fine.
uint32_t time = RTC->TR;
uint32_t date = RTC->DR;
// Parse values
result.year = from_bcd((date & (RTC_DR_YT | RTC_DR_YU)) >> RTC_DR_YU_Pos) + YEAR_OFFSET;
result.month = from_bcd((date & (RTC_DR_MT | RTC_DR_MU)) >> RTC_DR_MU_Pos);
result.day = from_bcd((date & (RTC_DR_DT | RTC_DR_DU)) >> RTC_DR_DU_Pos);
result.weekday = ((date & RTC_DR_WDU) >> RTC_DR_WDU_Pos);
result.hour = from_bcd((time & (RTC_TR_HT | RTC_TR_HU)) >> RTC_TR_HU_Pos);
result.minute = from_bcd((time & (RTC_TR_MNT | RTC_TR_MNU)) >> RTC_TR_MNU_Pos);
result.second = from_bcd((time & (RTC_TR_ST | RTC_TR_SU)) >> RTC_TR_SU_Pos);
}
return result;
}
// Parse values
result.year = from_bcd((date & (RTC_DR_YT | RTC_DR_YU)) >> RTC_DR_YU_Pos) + YEAR_OFFSET;
result.month = from_bcd((date & (RTC_DR_MT | RTC_DR_MU)) >> RTC_DR_MU_Pos);
result.day = from_bcd((date & (RTC_DR_DT | RTC_DR_DU)) >> RTC_DR_DU_Pos);
result.weekday = ((date & RTC_DR_WDU) >> RTC_DR_WDU_Pos);
result.hour = from_bcd((time & (RTC_TR_HT | RTC_TR_HU)) >> RTC_TR_HU_Pos);
result.minute = from_bcd((time & (RTC_TR_MNT | RTC_TR_MNU)) >> RTC_TR_MNU_Pos);
result.second = from_bcd((time & (RTC_TR_ST | RTC_TR_SU)) >> RTC_TR_SU_Pos);
}
return result;
}

View File

@ -1,7 +0,0 @@
void timer_init(TIM_TypeDef *TIM, int psc) {
register_set(&(TIM->PSC), (psc-1), 0xFFFFU);
register_set(&(TIM->DIER), TIM_DIER_UIE, 0x5F5FU);
register_set(&(TIM->CR1), TIM_CR1_CEN, 0x3FU);
TIM->SR = 0;
}

View File

@ -0,0 +1,31 @@
void timer_init(TIM_TypeDef *TIM, int psc) {
register_set(&(TIM->PSC), (psc-1), 0xFFFFU);
register_set(&(TIM->DIER), TIM_DIER_UIE, 0x5F5FU);
register_set(&(TIM->CR1), TIM_CR1_CEN, 0x3FU);
TIM->SR = 0;
}
void microsecond_timer_init(void) {
MICROSECOND_TIMER->PSC = (APB1_FREQ)-1U;
MICROSECOND_TIMER->CR1 = TIM_CR1_CEN;
MICROSECOND_TIMER->EGR = TIM_EGR_UG;
}
uint32_t microsecond_timer_get(void) {
return MICROSECOND_TIMER->CNT;
}
void interrupt_timer_init(void) {
enable_interrupt_timer();
REGISTER_INTERRUPT(INTERRUPT_TIMER_IRQ, interrupt_timer_handler, 1, FAULT_INTERRUPT_RATE_INTERRUPTS)
register_set(&(INTERRUPT_TIMER->PSC), ((uint16_t)(15.25*APB1_FREQ)-1U), 0xFFFFU);
register_set(&(INTERRUPT_TIMER->DIER), TIM_DIER_UIE, 0x5F5FU);
register_set(&(INTERRUPT_TIMER->CR1), TIM_CR1_CEN, 0x3FU);
INTERRUPT_TIMER->SR = 0;
NVIC_EnableIRQ(INTERRUPT_TIMER_IRQ);
}
void tick_timer_init(void) {
timer_init(TICK_TIMER, (uint16_t)((15.25*APB2_FREQ)/8U));
NVIC_EnableIRQ(TICK_TIMER_IRQ);
}

View File

@ -24,29 +24,20 @@ typedef struct uart_ring {
uart_ring uart_ring_##x = { \
.w_ptr_tx = 0, \
.r_ptr_tx = 0, \
.elems_tx = ((uint8_t *)&elems_tx_##x), \
.tx_fifo_size = size_tx, \
.elems_tx = ((uint8_t *)&(elems_tx_##x)), \
.tx_fifo_size = (size_tx), \
.w_ptr_rx = 0, \
.r_ptr_rx = 0, \
.elems_rx = ((uint8_t *)&elems_rx_##x), \
.rx_fifo_size = size_rx, \
.uart = uart_ptr, \
.callback = callback_ptr, \
.dma_rx = rx_dma \
.elems_rx = ((uint8_t *)&(elems_rx_##x)), \
.rx_fifo_size = (size_rx), \
.uart = (uart_ptr), \
.callback = (callback_ptr), \
.dma_rx = (rx_dma) \
};
// ***************************** Function prototypes *****************************
void uart_init(uart_ring *q, int baud);
bool getc(uart_ring *q, char *elem);
bool putc(uart_ring *q, char elem);
void puts(const char *a);
void puth(unsigned int i);
void hexdump(const void *a, int l);
void debug_ring_callback(uart_ring *ring);
void uart_tx_ring(uart_ring *q);
// ******************************** UART buffers ********************************
@ -83,239 +74,7 @@ uart_ring *get_ring_by_number(int a) {
return ring;
}
// ***************************** Interrupt handlers *****************************
void uart_tx_ring(uart_ring *q){
ENTER_CRITICAL();
// Send out next byte of TX buffer
if (q->w_ptr_tx != q->r_ptr_tx) {
// Only send if transmit register is empty (aka last byte has been sent)
if ((q->uart->SR & USART_SR_TXE) != 0) {
q->uart->DR = q->elems_tx[q->r_ptr_tx]; // This clears TXE
q->r_ptr_tx = (q->r_ptr_tx + 1U) % q->tx_fifo_size;
}
// Enable TXE interrupt if there is still data to be sent
if(q->r_ptr_tx != q->w_ptr_tx){
q->uart->CR1 |= USART_CR1_TXEIE;
} else {
q->uart->CR1 &= ~USART_CR1_TXEIE;
}
}
EXIT_CRITICAL();
}
void uart_rx_ring(uart_ring *q){
// Do not read out directly if DMA enabled
if (q->dma_rx == false) {
ENTER_CRITICAL();
// Read out RX buffer
uint8_t c = q->uart->DR; // This read after reading SR clears a bunch of interrupts
uint16_t next_w_ptr = (q->w_ptr_rx + 1U) % q->rx_fifo_size;
// Do not overwrite buffer data
if (next_w_ptr != q->r_ptr_rx) {
q->elems_rx[q->w_ptr_rx] = c;
q->w_ptr_rx = next_w_ptr;
if (q->callback != NULL) {
q->callback(q);
}
}
EXIT_CRITICAL();
}
}
// This function should be called on:
// * Half-transfer DMA interrupt
// * Full-transfer DMA interrupt
// * UART IDLE detection
uint32_t prev_w_index = 0;
void dma_pointer_handler(uart_ring *q, uint32_t dma_ndtr) {
ENTER_CRITICAL();
uint32_t w_index = (q->rx_fifo_size - dma_ndtr);
// Check for new data
if (w_index != prev_w_index){
// Check for overflow
if (
((prev_w_index < q->r_ptr_rx) && (q->r_ptr_rx <= w_index)) || // No rollover
((w_index < prev_w_index) && ((q->r_ptr_rx <= w_index) || (prev_w_index < q->r_ptr_rx))) // Rollover
){
// We lost data. Set the new read pointer to the oldest byte still available
q->r_ptr_rx = (w_index + 1U) % q->rx_fifo_size;
}
// Set write pointer
q->w_ptr_rx = w_index;
}
prev_w_index = w_index;
EXIT_CRITICAL();
}
// This read after reading SR clears all error interrupts. We don't want compiler warnings, nor optimizations
#define UART_READ_DR(uart) volatile uint8_t t = (uart)->DR; UNUSED(t);
void uart_interrupt_handler(uart_ring *q) {
ENTER_CRITICAL();
// Read UART status. This is also the first step necessary in clearing most interrupts
uint32_t status = q->uart->SR;
// If RXNE is set, perform a read. This clears RXNE, ORE, IDLE, NF and FE
if((status & USART_SR_RXNE) != 0U){
uart_rx_ring(q);
}
// Detect errors and clear them
uint32_t err = (status & USART_SR_ORE) | (status & USART_SR_NE) | (status & USART_SR_FE) | (status & USART_SR_PE);
if(err != 0U){
#ifdef DEBUG_UART
puts("Encountered UART error: "); puth(err); puts("\n");
#endif
UART_READ_DR(q->uart)
}
// Send if necessary
uart_tx_ring(q);
// Run DMA pointer handler if the line is idle
if(q->dma_rx && (status & USART_SR_IDLE)){
// Reset IDLE flag
UART_READ_DR(q->uart)
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.");
#endif
}
}
EXIT_CRITICAL();
}
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); }
void DMA2_Stream5_IRQ_Handler(void) {
ENTER_CRITICAL();
// Handle errors
if((DMA2->HISR & DMA_HISR_TEIF5) || (DMA2->HISR & DMA_HISR_DMEIF5) || (DMA2->HISR & DMA_HISR_FEIF5)){
#ifdef DEBUG_UART
puts("Encountered UART DMA error. Clearing and restarting DMA...\n");
#endif
// Clear flags
DMA2->HIFCR = DMA_HIFCR_CTEIF5 | DMA_HIFCR_CDMEIF5 | DMA_HIFCR_CFEIF5;
// Re-enable the DMA if necessary
DMA2_Stream5->CR |= DMA_SxCR_EN;
}
// Re-calculate write pointer and reset flags
dma_pointer_handler(&uart_ring_gps, DMA2_Stream5->NDTR);
DMA2->HIFCR = DMA_HIFCR_CTCIF5 | DMA_HIFCR_CHTIF5;
EXIT_CRITICAL();
}
// ***************************** Hardware setup *****************************
void dma_rx_init(uart_ring *q) {
// Initialization is UART-dependent
if(q == &uart_ring_gps){
// DMA2, stream 5, channel 4
// Disable FIFO mode (enable direct)
DMA2_Stream5->FCR &= ~DMA_SxFCR_DMDIS;
// Setup addresses
DMA2_Stream5->PAR = (uint32_t)&(USART1->DR); // Source
DMA2_Stream5->M0AR = (uint32_t)q->elems_rx; // Destination
DMA2_Stream5->NDTR = q->rx_fifo_size; // Number of bytes to copy
// Circular, Increment memory, byte size, periph -> memory, enable
// Transfer complete, half transfer, transfer error and direct mode error interrupt enable
DMA2_Stream5->CR = DMA_SxCR_CHSEL_2 | DMA_SxCR_MINC | DMA_SxCR_CIRC | DMA_SxCR_HTIE | DMA_SxCR_TCIE | DMA_SxCR_TEIE | DMA_SxCR_DMEIE | DMA_SxCR_EN;
// Enable DMA receiver in UART
q->uart->CR3 |= USART_CR3_DMAR;
// Enable UART IDLE interrupt
q->uart->CR1 |= USART_CR1_IDLEIE;
// Enable interrupt
NVIC_EnableIRQ(DMA2_Stream5_IRQn);
} else {
puts("Tried to initialize RX DMA for an unsupported UART\n");
}
}
#define __DIV(_PCLK_, _BAUD_) (((_PCLK_) * 25U) / (4U * (_BAUD_)))
#define __DIVMANT(_PCLK_, _BAUD_) (__DIV((_PCLK_), (_BAUD_)) / 100U)
#define __DIVFRAQ(_PCLK_, _BAUD_) ((((__DIV((_PCLK_), (_BAUD_)) - (__DIVMANT((_PCLK_), (_BAUD_)) * 100U)) * 16U) + 50U) / 100U)
#define __USART_BRR(_PCLK_, _BAUD_) ((__DIVMANT((_PCLK_), (_BAUD_)) << 4) | (__DIVFRAQ((_PCLK_), (_BAUD_)) & 0x0FU))
void uart_set_baud(USART_TypeDef *u, unsigned int baud) {
if (u == USART1) {
// USART1 is on APB2
u->BRR = __USART_BRR(48000000U, baud);
} else {
u->BRR = __USART_BRR(24000000U, baud);
}
}
void uart_init(uart_ring *q, int baud) {
// Register interrupts (max data rate: 115200 baud)
if(q->uart == USART1){
REGISTER_INTERRUPT(USART1_IRQn, USART1_IRQ_Handler, 150000U, FAULT_INTERRUPT_RATE_UART_1)
} else if (q->uart == USART2){
REGISTER_INTERRUPT(USART2_IRQn, USART2_IRQ_Handler, 150000U, FAULT_INTERRUPT_RATE_UART_2)
} else if (q->uart == USART3){
REGISTER_INTERRUPT(USART3_IRQn, USART3_IRQ_Handler, 150000U, FAULT_INTERRUPT_RATE_UART_3)
} else if (q->uart == UART5){
REGISTER_INTERRUPT(UART5_IRQn, UART5_IRQ_Handler, 150000U, FAULT_INTERRUPT_RATE_UART_5)
} else {
// UART not used. Skip registering interrupts
}
if(q->dma_rx){
REGISTER_INTERRUPT(DMA2_Stream5_IRQn, DMA2_Stream5_IRQ_Handler, 100U, FAULT_INTERRUPT_RATE_UART_DMA) // Called twice per buffer
}
// Set baud and enable peripheral with TX and RX mode
uart_set_baud(q->uart, baud);
q->uart->CR1 = USART_CR1_UE | USART_CR1_TE | USART_CR1_RE;
if ((q->uart == USART2) || (q->uart == USART3) || (q->uart == UART5)) {
q->uart->CR1 |= USART_CR1_RXNEIE;
}
// Enable UART interrupts
if(q->uart == USART1){
NVIC_EnableIRQ(USART1_IRQn);
} else if (q->uart == USART2){
NVIC_EnableIRQ(USART2_IRQn);
} else if (q->uart == USART3){
NVIC_EnableIRQ(USART3_IRQn);
} else if (q->uart == UART5){
NVIC_EnableIRQ(UART5_IRQn);
} else {
// UART not used. Skip enabling interrupts
}
// Initialise RX DMA if used
if(q->dma_rx){
dma_rx_init(q);
}
}
// ************************* Low-level buffer functions *************************
bool getc(uart_ring *q, char *elem) {
bool ret = false;
@ -427,14 +186,14 @@ void putui(uint32_t i) {
}
void puth(unsigned int i) {
char c[] = "0123456789abcdef";
const char c[] = "0123456789abcdef";
for (int pos = 28; pos != -4; pos -= 4) {
putch(c[(i >> (unsigned int)(pos)) & 0xFU]);
}
}
void puth2(unsigned int i) {
char c[] = "0123456789abcdef";
const char c[] = "0123456789abcdef";
for (int pos = 4; pos != -4; pos -= 4) {
putch(c[(i >> (unsigned int)(pos)) & 0xFU]);
}

View File

@ -38,22 +38,6 @@ void usb_outep3_resume_if_paused(void);
// **** supporting defines ****
typedef struct
{
__IO uint32_t HPRT;
}
USB_OTG_HostPortTypeDef;
USB_OTG_GlobalTypeDef *USBx = USB_OTG_FS;
#define USBx_HOST ((USB_OTG_HostTypeDef *)((uint32_t)USBx + USB_OTG_HOST_BASE))
#define USBx_HOST_PORT ((USB_OTG_HostPortTypeDef *)((uint32_t)USBx + USB_OTG_HOST_PORT_BASE))
#define USBx_DEVICE ((USB_OTG_DeviceTypeDef *)((uint32_t)USBx + USB_OTG_DEVICE_BASE))
#define USBx_INEP(i) ((USB_OTG_INEndpointTypeDef *)((uint32_t)USBx + USB_OTG_IN_ENDPOINT_BASE + ((i) * USB_OTG_EP_REG_SIZE)))
#define USBx_OUTEP(i) ((USB_OTG_OUTEndpointTypeDef *)((uint32_t)USBx + USB_OTG_OUT_ENDPOINT_BASE + ((i) * USB_OTG_EP_REG_SIZE)))
#define USBx_DFIFO(i) *(__IO uint32_t *)((uint32_t)USBx + USB_OTG_FIFO_BASE + ((i) * USB_OTG_FIFO_SIZE))
#define USBx_PCGCCTL *(__IO uint32_t *)((uint32_t)USBx + USB_OTG_PCGCCTL_BASE)
#define USB_REQ_GET_STATUS 0x00
#define USB_REQ_CLEAR_FEATURE 0x01
#define USB_REQ_SET_FEATURE 0x03
@ -102,10 +86,6 @@ USB_OTG_GlobalTypeDef *USBx = USB_OTG_FS;
#define STS_SETUP_COMP 4
#define STS_SETUP_UPDT 6
#define USBD_FS_TRDT_VALUE 5U
#define USB_OTG_SPEED_FULL 3
uint8_t resp[MAX_RESP_LEN];
// for the repeating interfaces
@ -143,11 +123,7 @@ uint8_t device_desc[] = {
0xFF, 0xFF, 0xFF, 0x40, // Class, Subclass, Protocol, Max Packet Size
TOUSBORDER(USB_VID), // idVendor
TOUSBORDER(USB_PID), // idProduct
#ifdef STM32F4
0x00, 0x23, // bcdDevice
#else
0x00, 0x22, // bcdDevice
#endif
0x01, 0x02, // Manufacturer, Product
0x03, 0x01 // Serial Number, Num Configurations
};
@ -410,7 +386,7 @@ void USB_WritePacket(const void *src, uint16_t len, uint32_t ep) {
hexdump(src, len);
#endif
uint8_t numpacket = (len + (MAX_RESP_LEN - 1U)) / MAX_RESP_LEN;
uint32_t numpacket = (len + (MAX_RESP_LEN - 1U)) / MAX_RESP_LEN;
uint32_t count32b = 0;
count32b = (len + 3U) / 4U;
@ -420,10 +396,12 @@ void USB_WritePacket(const void *src, uint16_t len, uint32_t ep) {
USBx_INEP(ep)->DIEPCTL |= (USB_OTG_DIEPCTL_CNAK | USB_OTG_DIEPCTL_EPENA);
// load the FIFO
const uint32_t *src_copy = (const uint32_t *)src;
for (uint32_t i = 0; i < count32b; i++) {
USBx_DFIFO(ep) = *src_copy;
src_copy++;
if (src != NULL) {
const uint32_t *src_copy = (const uint32_t *)src;
for (uint32_t i = 0; i < count32b; i++) {
USBx_DFIFO(ep) = *src_copy;
src_copy++;
}
}
}
@ -949,7 +927,7 @@ void usb_irqhandler(void) {
//USBx->GINTMSK = 0xFFFFFFFF & ~(USB_OTG_GINTMSK_NPTXFEM | USB_OTG_GINTMSK_PTXFEM | USB_OTG_GINTSTS_SOF | USB_OTG_GINTSTS_EOPF);
}
void usb_outep3_resume_if_paused() {
void usb_outep3_resume_if_paused(void) {
ENTER_CRITICAL();
if (!outep3_processing && (USBx_OUTEP(3)->DOEPCTL & USB_OTG_DOEPCTL_NAKSTS) != 0) {
USBx_OUTEP(3)->DOEPTSIZ = (1U << 19) | 0x40U;
@ -958,14 +936,6 @@ void usb_outep3_resume_if_paused() {
EXIT_CRITICAL();
}
void OTG_FS_IRQ_Handler(void) {
NVIC_DisableIRQ(OTG_FS_IRQn);
//__disable_irq();
usb_irqhandler();
//__enable_irq();
NVIC_EnableIRQ(OTG_FS_IRQn);
}
bool usb_enumerated(void) {
// This relies on the USB being suspended after no activity for 3ms.
// Seems pretty stable in combination with the EOPF to reject noise.
@ -977,78 +947,3 @@ bool usb_enumerated(void) {
usb_eopf_detected = false;
return ret;
}
// ***************************** USB init *****************************
void usb_init(void) {
REGISTER_INTERRUPT(OTG_FS_IRQn, OTG_FS_IRQ_Handler, 1500000U, FAULT_INTERRUPT_RATE_USB) //TODO: Find out a better rate limit for USB. Now it's the 1.5MB/s rate
// full speed PHY, do reset and remove power down
/*puth(USBx->GRSTCTL);
puts(" resetting PHY\n");*/
while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_AHBIDL) == 0);
//puts("AHB idle\n");
// reset PHY here
USBx->GRSTCTL |= USB_OTG_GRSTCTL_CSRST;
while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_CSRST) == USB_OTG_GRSTCTL_CSRST);
//puts("reset done\n");
// internal PHY, force device mode
USBx->GUSBCFG = USB_OTG_GUSBCFG_PHYSEL | USB_OTG_GUSBCFG_FDMOD;
// slowest timings
USBx->GUSBCFG |= ((USBD_FS_TRDT_VALUE << 10) & USB_OTG_GUSBCFG_TRDT);
// power up the PHY
#ifdef STM32F4
USBx->GCCFG = USB_OTG_GCCFG_PWRDWN;
//USBx->GCCFG |= USB_OTG_GCCFG_VBDEN | USB_OTG_GCCFG_SDEN |USB_OTG_GCCFG_PDEN | USB_OTG_GCCFG_DCDEN;
/* B-peripheral session valid override enable*/
USBx->GOTGCTL |= USB_OTG_GOTGCTL_BVALOVAL;
USBx->GOTGCTL |= USB_OTG_GOTGCTL_BVALOEN;
#else
USBx->GCCFG = USB_OTG_GCCFG_PWRDWN | USB_OTG_GCCFG_NOVBUSSENS;
#endif
// be a device, slowest timings
//USBx->GUSBCFG = USB_OTG_GUSBCFG_FDMOD | USB_OTG_GUSBCFG_PHYSEL | USB_OTG_GUSBCFG_TRDT | USB_OTG_GUSBCFG_TOCAL;
//USBx->GUSBCFG |= (uint32_t)((USBD_FS_TRDT_VALUE << 10) & USB_OTG_GUSBCFG_TRDT);
//USBx->GUSBCFG = USB_OTG_GUSBCFG_PHYSEL | USB_OTG_GUSBCFG_TRDT | USB_OTG_GUSBCFG_TOCAL;
// **** for debugging, doesn't seem to work ****
//USBx->GUSBCFG |= USB_OTG_GUSBCFG_CTXPKT;
// reset PHY clock
USBx_PCGCCTL = 0;
// enable the fancy OTG things
// DCFG_FRAME_INTERVAL_80 is 0
//USBx->GUSBCFG |= USB_OTG_GUSBCFG_HNPCAP | USB_OTG_GUSBCFG_SRPCAP;
USBx_DEVICE->DCFG |= USB_OTG_SPEED_FULL | USB_OTG_DCFG_NZLSOHSK;
//USBx_DEVICE->DCFG = USB_OTG_DCFG_NZLSOHSK | USB_OTG_DCFG_DSPD;
//USBx_DEVICE->DCFG = USB_OTG_DCFG_DSPD;
// clear pending interrupts
USBx->GINTSTS = 0xBFFFFFFFU;
// setup USB interrupts
// all interrupts except TXFIFO EMPTY
//USBx->GINTMSK = 0xFFFFFFFF & ~(USB_OTG_GINTMSK_NPTXFEM | USB_OTG_GINTMSK_PTXFEM | USB_OTG_GINTSTS_SOF | USB_OTG_GINTSTS_EOPF);
//USBx->GINTMSK = 0xFFFFFFFF & ~(USB_OTG_GINTMSK_NPTXFEM | USB_OTG_GINTMSK_PTXFEM);
USBx->GINTMSK = USB_OTG_GINTMSK_USBRST | USB_OTG_GINTMSK_ENUMDNEM | USB_OTG_GINTMSK_OTGINT |
USB_OTG_GINTMSK_RXFLVLM | USB_OTG_GINTMSK_GONAKEFFM | USB_OTG_GINTMSK_GINAKEFFM |
USB_OTG_GINTMSK_OEPINT | USB_OTG_GINTMSK_IEPINT | USB_OTG_GINTMSK_USBSUSPM |
USB_OTG_GINTMSK_CIDSCHGM | USB_OTG_GINTMSK_SRQIM | USB_OTG_GINTMSK_MMISM | USB_OTG_GINTMSK_EOPFM;
USBx->GAHBCFG = USB_OTG_GAHBCFG_GINT;
// DCTL startup value is 2 on new chip, 0 on old chip
USBx_DEVICE->DCTL = 0;
// enable the IRQ
NVIC_EnableIRQ(OTG_FS_IRQn);
}

View File

@ -1,7 +1,7 @@
// Early bringup
#define ENTER_BOOTLOADER_MAGIC 0xdeadbeef
#define ENTER_SOFTLOADER_MAGIC 0xdeadc0de
#define BOOT_NORMAL 0xdeadb111
#define ENTER_BOOTLOADER_MAGIC 0xdeadbeefU
#define ENTER_SOFTLOADER_MAGIC 0xdeadc0deU
#define BOOT_NORMAL 0xdeadb111U
extern void *g_pfnVectors;
extern uint32_t enter_bootloader_mode;
@ -9,7 +9,7 @@ extern uint32_t enter_bootloader_mode;
void jump_to_bootloader(void) {
// do enter bootloader
enter_bootloader_mode = 0;
void (*bootloader)(void) = (void (*)(void)) (*((uint32_t *)0x1fff0004));
void (*bootloader)(void) = (void (*)(void)) (*((uint32_t *)BOOTLOADER_ADDRESS));
// jump to bootloader
enable_interrupts();
@ -20,7 +20,7 @@ void jump_to_bootloader(void) {
NVIC_SystemReset();
}
void early(void) {
void early_initialization(void) {
// Reset global critical depth
disable_interrupts();
global_critical_depth = 0;
@ -38,27 +38,17 @@ void early(void) {
// if wrong chip, reboot
volatile unsigned int id = DBGMCU->IDCODE;
#ifdef STM32F4
if ((id & 0xFFFU) != 0x463U) {
if ((id & 0xFFFU) != MCU_IDCODE) {
enter_bootloader_mode = ENTER_BOOTLOADER_MAGIC;
}
#else
if ((id & 0xFFFU) != 0x411U) {
enter_bootloader_mode = ENTER_BOOTLOADER_MAGIC;
}
#endif
// setup interrupt table
SCB->VTOR = (uint32_t)&g_pfnVectors;
// early GPIOs float everything
RCC->AHB1ENR = RCC_AHB1ENR_GPIOAEN | RCC_AHB1ENR_GPIOBEN | RCC_AHB1ENR_GPIOCEN;
early_gpio_float();
GPIOA->MODER = 0; GPIOB->MODER = 0; GPIOC->MODER = 0;
GPIOA->ODR = 0; GPIOB->ODR = 0; GPIOC->ODR = 0;
GPIOA->PUPDR = 0; GPIOB->PUPDR = 0; GPIOC->PUPDR = 0;
detect_configuration();
detect_external_debug_serial();
detect_board_type();
if (enter_bootloader_mode == ENTER_BOOTLOADER_MAGIC) {

View File

@ -24,7 +24,7 @@
#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)
#define FAULT_INTERRUPT_RATE_TICK (1U << 21)
// Permanent faults
#define PERMANENT_FAULTS 0U
@ -49,4 +49,4 @@ void fault_recovered(uint32_t fault) {
} else {
puts("Cannot recover from a permanent fault!\n");
}
}
}

View File

@ -39,4 +39,3 @@ int memcmp(const void * ptr1, const void * ptr2, unsigned int num) {
}
return ret;
}

View File

@ -1,45 +1,21 @@
//#define EON
//#define PANDA
// ********************* Includes *********************
#include "config.h"
#include "obj/gitversion.h"
#include "main_declarations.h"
#include "critical.h"
#include "libc.h"
#include "provision.h"
#include "faults.h"
#include "drivers/registers.h"
#include "drivers/interrupts.h"
#include "drivers/llcan.h"
#include "drivers/llgpio.h"
#include "drivers/adc.h"
#include "drivers/pwm.h"
#include "board.h"
#include "drivers/uart.h"
#include "drivers/usb.h"
#include "drivers/gmlan_alt.h"
#include "drivers/kline_init.h"
#include "drivers/timer.h"
#include "drivers/clock.h"
#include "gpio.h"
#ifndef EON
#include "drivers/spi.h"
#endif
#include "early_init.h"
#include "provision.h"
#include "power_saving.h"
#include "safety.h"
#include "drivers/can.h"
#include "obj/gitversion.h"
extern int _app_start[0xc000]; // Only first 3 sectors of size 0x4000 are used
// When changing this struct, boardd and python/__init__.py needs to be kept up to date!
@ -127,14 +103,14 @@ void set_safety_mode(uint16_t mode, int16_t param) {
switch (mode_copy) {
case SAFETY_SILENT:
set_intercept_relay(false);
if (board_has_obd()) {
if (current_board->has_obd) {
current_board->set_can_mode(CAN_MODE_NORMAL);
}
can_silent = ALL_CAN_SILENT;
break;
case SAFETY_NOOUTPUT:
set_intercept_relay(false);
if (board_has_obd()) {
if (current_board->has_obd) {
current_board->set_can_mode(CAN_MODE_NORMAL);
}
can_silent = ALL_CAN_LIVE;
@ -143,8 +119,12 @@ void set_safety_mode(uint16_t mode, int16_t param) {
set_intercept_relay(false);
heartbeat_counter = 0U;
heartbeat_lost = false;
if (board_has_obd()) {
current_board->set_can_mode(CAN_MODE_OBD_CAN2);
if (current_board->has_obd) {
if (param == 0) {
current_board->set_can_mode(CAN_MODE_OBD_CAN2);
} else {
current_board->set_can_mode(CAN_MODE_NORMAL);
}
}
can_silent = ALL_CAN_LIVE;
break;
@ -152,7 +132,7 @@ void set_safety_mode(uint16_t mode, int16_t param) {
set_intercept_relay(true);
heartbeat_counter = 0U;
heartbeat_lost = false;
if (board_has_obd()) {
if (current_board->has_obd) {
current_board->set_can_mode(CAN_MODE_NORMAL);
}
can_silent = ALL_CAN_LIVE;
@ -161,6 +141,12 @@ void set_safety_mode(uint16_t mode, int16_t param) {
can_init_all();
}
bool is_car_safety_mode(uint16_t mode) {
return (mode != SAFETY_SILENT) &&
(mode != SAFETY_NOOUTPUT) &&
(mode != SAFETY_ELM327);
}
// ***************************** USB port *****************************
int get_health_pkt(void *dat) {
@ -243,13 +229,13 @@ void usb_cb_ep3_out(void *usbdata, int len, bool hardwired) {
}
}
void usb_cb_ep3_out_complete() {
void usb_cb_ep3_out_complete(void) {
if (can_tx_check_min_slots_free(MAX_CAN_MSGS_PER_BULK_TRANSFER)) {
usb_outep3_resume_if_paused();
}
}
void usb_cb_enumeration_complete() {
void usb_cb_enumeration_complete(void) {
puts("USB enumeration complete\n");
is_enumerated = 1;
}
@ -340,7 +326,7 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
case 0xd0:
// addresses are OTP
if (setup->b.wValue.w == 1U) {
(void)memcpy(resp, (uint8_t *)0x1fff79c0, 0x10);
(void)memcpy(resp, (uint8_t *)DEVICE_SERIAL_NUMBER_ADDRESS, 0x10);
resp_len = 0x10;
} else {
get_provision_chunk(resp);
@ -428,7 +414,7 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
break;
// **** 0xdb: set GMLAN (white/grey) or OBD CAN (black) multiplexing mode
case 0xdb:
if(board_has_obd()){
if(current_board->has_obd){
if (setup->b.wValue.w == 1U) {
// Enable OBD CAN
current_board->set_can_mode(CAN_MODE_OBD_CAN2);
@ -486,9 +472,7 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
// **** 0xdf: set unsafe mode
case 0xdf:
// you can only set this if you are in a non car safety mode
if ((current_safety_mode == SAFETY_SILENT) ||
(current_safety_mode == SAFETY_NOOUTPUT) ||
(current_safety_mode == SAFETY_ELM327)) {
if (!is_car_safety_mode(current_safety_mode)) {
unsafe_mode = setup->b.wValue.w;
}
break;
@ -566,7 +550,7 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
break;
// **** 0xf0: k-line/l-line wake-up pulse for KWP2000 fast initialization
case 0xf0:
if(board_has_lin()) {
if(current_board->has_lin) {
bool k = (setup->b.wValue.w == 0U) || (setup->b.wValue.w == 2U);
bool l = (setup->b.wValue.w == 1U) || (setup->b.wValue.w == 2U);
if (bitbang_wakeup(k, l)) {
@ -601,11 +585,12 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
{
heartbeat_counter = 0U;
heartbeat_lost = false;
heartbeat_disabled = false;
break;
}
// **** 0xf4: k-line/l-line 5 baud initialization
case 0xf4:
if(board_has_lin()) {
if(current_board->has_lin) {
bool k = (setup->b.wValue.w == 0U) || (setup->b.wValue.w == 2U);
bool l = (setup->b.wValue.w == 1U) || (setup->b.wValue.w == 2U);
uint8_t five_baud_addr = (setup->b.wIndex.w & 0xFFU);
@ -626,6 +611,12 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
case 0xf7:
green_led_enabled = (setup->b.wValue.w != 0U);
break;
#ifdef ALLOW_DEBUG
// **** 0xf8: disable heartbeat checks
case 0xf8:
heartbeat_disabled = true;
break;
#endif
default:
puts("NO HANDLER ");
puth(setup->b.bRequest);
@ -635,43 +626,11 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
return resp_len;
}
#ifndef EON
int spi_cb_rx(uint8_t *data, int len, uint8_t *data_out) {
// data[0] = endpoint
// data[2] = length
// data[4:] = data
UNUSED(len);
int resp_len = 0;
switch (data[0]) {
case 0:
// control transfer
resp_len = usb_cb_control_msg((USB_Setup_TypeDef *)(data+4), data_out, 0);
break;
case 1:
// ep 1, read
resp_len = usb_cb_ep1_in(data_out, 0x40, 0);
break;
case 2:
// ep 2, send serial
usb_cb_ep2_out(data+4, data[2], 0);
break;
case 3:
// ep 3, send CAN
usb_cb_ep3_out(data+4, data[2], 0);
break;
default:
puts("SPI data invalid");
break;
}
return resp_len;
}
#endif
// ***************************** main code *****************************
// cppcheck-suppress unusedFunction ; used in headers not included in cppcheck
void __initialize_hardware_early(void) {
early();
early_initialization();
}
void __attribute__ ((noinline)) enable_fpu(void) {
@ -679,19 +638,19 @@ void __attribute__ ((noinline)) enable_fpu(void) {
SCB->CPACR |= ((3UL << (10U * 2U)) | (3UL << (11U * 2U)));
}
// go into SILENT when the EON does not send a heartbeat for this amount of seconds.
#define EON_HEARTBEAT_IGNITION_CNT_ON 5U
#define EON_HEARTBEAT_IGNITION_CNT_OFF 2U
// go into SILENT when heartbeat isn't received for this amount of seconds.
#define HEARTBEAT_IGNITION_CNT_ON 5U
#define HEARTBEAT_IGNITION_CNT_OFF 2U
// called at 8Hz
uint8_t loop_counter = 0U;
void TIM1_BRK_TIM9_IRQ_Handler(void) {
if (TIM9->SR != 0) {
void tick_handler(void) {
if (TICK_TIMER->SR != 0) {
// siren
current_board->set_siren((loop_counter & 1U) && siren_enabled);
current_board->set_siren((loop_counter & 1U) && (siren_enabled || (siren_countdown > 0U)));
// decimated to 1Hz
if(loop_counter == 0U){
if (loop_counter == 0U) {
can_live = pending_can_live;
current_board->usb_power_mode_tick(uptime_cnt);
@ -724,39 +683,49 @@ void TIM1_BRK_TIM9_IRQ_Handler(void) {
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);
}
if (power_save_status != POWER_SAVE_STATUS_ENABLED) {
set_power_save_state(POWER_SAVE_STATUS_ENABLED);
}
// set flag to indicate the heartbeat was lost
heartbeat_lost = true;
// 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);
}
if (siren_countdown > 0U) {
siren_countdown -= 1U;
}
// 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);
if (!heartbeat_disabled) {
// if the heartbeat has been gone for a while, go to SILENT safety mode and enter power save
if (heartbeat_counter >= (check_started() ? HEARTBEAT_IGNITION_CNT_ON : HEARTBEAT_IGNITION_CNT_OFF)) {
puts("device hasn't sent a heartbeat for 0x");
puth(heartbeat_counter);
puts(" seconds. Safety is set to SILENT mode.\n");
if (controls_allowed) {
siren_countdown = 5U;
}
// set flag to indicate the heartbeat was lost
if (is_car_safety_mode(current_safety_mode)) {
heartbeat_lost = true;
}
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);
}
// 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();
@ -764,7 +733,7 @@ void TIM1_BRK_TIM9_IRQ_Handler(void) {
// 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;
@ -778,24 +747,21 @@ void TIM1_BRK_TIM9_IRQ_Handler(void) {
loop_counter++;
loop_counter %= 8U;
}
TIM9->SR = 0;
TICK_TIMER->SR = 0;
}
#define MAX_FADE 8192U
int main(void) {
// Init interrupt table
init_interrupts(true);
// 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();
// init early devices
clock_init();
peripherals_init();
detect_configuration();
detect_external_debug_serial();
detect_board_type();
adc_init();
@ -825,14 +791,14 @@ int main(void) {
uart_init(&uart_ring_debug, 115200);
}
if (board_has_gps()) {
if (current_board->has_gps) {
uart_init(&uart_ring_gps, 9600);
} else {
// enable ESP uart
uart_init(&uart_ring_gps, 115200);
}
if(board_has_lin()){
if(current_board->has_lin){
// enable LIN
uart_init(&uart_ring_lin1, 10400);
UART5->CR2 |= USART_CR2_LINEN;
@ -840,13 +806,7 @@ int main(void) {
USART3->CR2 |= USART_CR2_LINEN;
}
// init microsecond system timer
// increments 1000000 times per second
// generate an update to set the prescaler
TIM2->PSC = 48-1;
TIM2->CR1 = TIM_CR1_CEN;
TIM2->EGR = TIM_EGR_UG;
// use TIM2->CNT to read
microsecond_timer_init();
// init to SILENT and can silent
set_safety_mode(SAFETY_SILENT, 0);
@ -854,13 +814,9 @@ int main(void) {
// enable CAN TXs
current_board->enable_can_transceivers(true);
#ifndef EON
spi_init();
#endif
// 8hz
timer_init(TIM9, 183);
NVIC_EnableIRQ(TIM1_BRK_TIM9_IRQn);
// 8Hz timer
REGISTER_INTERRUPT(TICK_TIMER_IRQ, tick_handler, 10U, FAULT_INTERRUPT_RATE_TICK)
tick_timer_init();
#ifdef DEBUG
puts("DEBUG ENABLED\n");
@ -882,18 +838,18 @@ int main(void) {
uint32_t div_mode = ((usb_power_mode == USB_POWER_DCP) ? 4U : 1U);
// useful for debugging, fade breaks = panda is overloaded
for(uint32_t fade = 0U; fade < MAX_FADE; fade += div_mode){
for(uint32_t fade = 0U; fade < MAX_LED_FADE; fade += div_mode){
current_board->set_led(LED_RED, true);
delay(fade >> 4);
current_board->set_led(LED_RED, false);
delay((MAX_FADE - fade) >> 4);
delay((MAX_LED_FADE - fade) >> 4);
}
for(uint32_t fade = MAX_FADE; fade > 0U; fade -= div_mode){
for(uint32_t fade = MAX_LED_FADE; fade > 0U; fade -= div_mode){
current_board->set_led(LED_RED, true);
delay(fade >> 4);
current_board->set_led(LED_RED, false);
delay((MAX_FADE - fade) >> 4);
delay((MAX_LED_FADE - fade) >> 4);
}
#ifdef DEBUG_FAULTS

View File

@ -5,7 +5,8 @@ void puth2(unsigned int i);
typedef struct board board;
typedef struct harness_configuration harness_configuration;
void can_flip_buses(uint8_t bus1, uint8_t bus2);
void can_set_obd(uint8_t harness_orientation, bool obd);
void pwm_init(TIM_TypeDef *TIM, uint8_t channel);
void pwm_set(TIM_TypeDef *TIM, uint8_t channel, uint8_t percentage);
// ********************* Globals **********************
uint8_t hw_type = 0;
@ -14,5 +15,7 @@ bool is_enumerated = 0;
uint32_t heartbeat_counter = 0;
uint32_t uptime_cnt = 0;
bool heartbeat_lost = false;
bool heartbeat_disabled = false;
bool siren_enabled = false;
uint32_t siren_countdown = 0;
bool green_led_enabled = false;

View File

@ -1,32 +1,13 @@
// ********************* Includes *********************
//#define PEDAL_USB
#include "../config.h"
#include "libc.h"
#include "main_declarations.h"
#include "critical.h"
#include "faults.h"
#include "drivers/registers.h"
#include "drivers/interrupts.h"
#include "drivers/llcan.h"
#include "drivers/llgpio.h"
#include "drivers/adc.h"
#include "board.h"
#include "drivers/clock.h"
#include "drivers/dac.h"
#include "drivers/timer.h"
#include "gpio.h"
#include "early_init.h"
#include "crc.h"
#define CAN CAN1
//#define PEDAL_USB
#ifdef PEDAL_USB
#include "drivers/uart.h"
#include "drivers/usb.h"
#else
// no serial either
@ -41,12 +22,12 @@
}
#endif
#define ENTER_BOOTLOADER_MAGIC 0xdeadbeef
#define ENTER_BOOTLOADER_MAGIC 0xdeadbeefU
uint32_t enter_bootloader_mode;
// cppcheck-suppress unusedFunction ; used in headers not included in cppcheck
void __initialize_hardware_early(void) {
early();
early_initialization();
}
// ********************* serial debugging *********************
@ -84,6 +65,11 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
unsigned int resp_len = 0;
uart_ring *ur = NULL;
switch (setup->b.bRequest) {
// **** 0xc1: get hardware type
case 0xc1:
resp[0] = hw_type;
resp_len = 1;
break;
// **** 0xe0: uart read
case 0xe0:
ur = get_ring_by_number(setup->b.wValue.w);
@ -136,8 +122,7 @@ uint32_t current_index = 0;
#define FAULT_TIMEOUT 5U
#define FAULT_INVALID 6U
uint8_t state = FAULT_STARTUP;
const uint8_t crc_poly = 0xD5; // standard crc8
const uint8_t crc_poly = 0xD5U; // standard crc8
void CAN1_RX0_IRQ_Handler(void) {
while ((CAN->RF0R & CAN_RF0R_FMP0) != 0) {
@ -286,7 +271,7 @@ int main(void) {
REGISTER_INTERRUPT(CAN1_TX_IRQn, CAN1_TX_IRQ_Handler, CAN_INTERRUPT_RATE, FAULT_INTERRUPT_RATE_CAN_1)
REGISTER_INTERRUPT(CAN1_RX0_IRQn, CAN1_RX0_IRQ_Handler, CAN_INTERRUPT_RATE, FAULT_INTERRUPT_RATE_CAN_1)
REGISTER_INTERRUPT(CAN1_SCE_IRQn, CAN1_SCE_IRQ_Handler, CAN_INTERRUPT_RATE, FAULT_INTERRUPT_RATE_CAN_1)
// Should run at around 732Hz (see init below)
REGISTER_INTERRUPT(TIM3_IRQn, TIM3_IRQ_Handler, 1000U, FAULT_INTERRUPT_RATE_TIM3)
@ -295,7 +280,7 @@ int main(void) {
// init devices
clock_init();
peripherals_init();
detect_configuration();
detect_external_debug_serial();
detect_board_type();
// init board

View File

@ -8,4 +8,4 @@ typedef struct harness_configuration harness_configuration;
// ********************* Globals **********************
uint8_t hw_type = 0;
const board *current_board;
bool is_enumerated = 0;
bool is_enumerated = 0;

View File

@ -13,15 +13,15 @@ void set_power_save_state(int state) {
bool enable = false;
if (state == POWER_SAVE_STATUS_ENABLED) {
puts("enable power savings\n");
if (board_has_gps()) {
char UBLOX_SLEEP_MSG[] = "\xb5\x62\x06\x04\x04\x00\x01\x00\x08\x00\x17\x78";
if (current_board->has_gps) {
const char UBLOX_SLEEP_MSG[] = "\xb5\x62\x06\x04\x04\x00\x01\x00\x08\x00\x17\x78";
uart_ring *ur = get_ring_by_number(1);
for (unsigned int i = 0; i < sizeof(UBLOX_SLEEP_MSG) - 1U; i++) while (!putc(ur, UBLOX_SLEEP_MSG[i]));
}
} else {
puts("disable power savings\n");
if (board_has_gps()) {
char UBLOX_WAKE_MSG[] = "\xb5\x62\x06\x04\x04\x00\x01\x00\x09\x00\x18\x7a";
if (current_board->has_gps) {
const char UBLOX_WAKE_MSG[] = "\xb5\x62\x06\x04\x04\x00\x01\x00\x09\x00\x18\x7a";
uart_ring *ur = get_ring_by_number(1);
for (unsigned int i = 0; i < sizeof(UBLOX_WAKE_MSG) - 1U; i++) while (!putc(ur, UBLOX_WAKE_MSG[i]));
}
@ -37,13 +37,13 @@ void set_power_save_state(int state) {
current_board->set_gps_mode(GPS_DISABLED);
}
if(board_has_gmlan()){
if(current_board->has_hw_gmlan){
// turn on GMLAN
set_gpio_output(GPIOB, 14, enable);
set_gpio_output(GPIOB, 15, enable);
}
if(board_has_lin()){
if(current_board->has_lin){
// turn on LIN
set_gpio_output(GPIOB, 7, enable);
set_gpio_output(GPIOA, 14, enable);

View File

@ -5,7 +5,7 @@
// SHA1 checksum = 0x1C - 0x20
void get_provision_chunk(uint8_t *resp) {
(void)memcpy(resp, (uint8_t *)0x1fff79e0, PROVISION_CHUNK_LEN);
(void)memcpy(resp, (uint8_t *)PROVISION_CHUNK_ADDRESS, PROVISION_CHUNK_LEN);
if (memcmp(resp, "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0x20) == 0) {
(void)memcpy(resp, "unprovisioned\x00\x00\x00testing123\x00\x00\xa3\xa6\x99\xec", 0x20);
}
@ -13,7 +13,6 @@ void get_provision_chunk(uint8_t *resp) {
uint8_t chunk[PROVISION_CHUNK_LEN];
bool is_provisioned(void) {
(void)memcpy(chunk, (uint8_t *)0x1fff79e0, PROVISION_CHUNK_LEN);
(void)memcpy(chunk, (uint8_t *)PROVISION_CHUNK_ADDRESS, PROVISION_CHUNK_LEN);
return (memcmp(chunk, "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", 0x20) != 0);
}

View File

@ -127,7 +127,7 @@ int get_addr_check_index(CAN_FIFOMailBox_TypeDef *to_push, AddrCheckStruct addr_
// 1Hz safety function called by main. Now just a check for lagging safety messages
void safety_tick(const safety_hooks *hooks) {
uint32_t ts = TIM2->CNT;
uint32_t ts = microsecond_timer_get();
if (hooks->addr_check != NULL) {
for (int i=0; i < hooks->addr_check_len; i++) {
uint32_t elapsed_time = get_ts_elapsed(ts, hooks->addr_check[i].last_timestamp);
@ -165,7 +165,7 @@ bool is_msg_valid(AddrCheckStruct addr_list[], int index) {
void update_addr_timestamp(AddrCheckStruct addr_list[], int index) {
if (index != -1) {
uint32_t ts = TIM2->CNT;
uint32_t ts = microsecond_timer_get();
addr_list[index].last_timestamp = ts;
}
}
@ -251,10 +251,10 @@ const safety_hook_config safety_hook_registry[] = {
{SAFETY_NOOUTPUT, &nooutput_hooks},
{SAFETY_HYUNDAI_LEGACY, &hyundai_legacy_hooks},
#ifdef ALLOW_DEBUG
{SAFETY_TESLA, &tesla_hooks},
{SAFETY_MAZDA, &mazda_hooks},
{SAFETY_SUBARU_LEGACY, &subaru_legacy_hooks},
{SAFETY_VOLKSWAGEN_PQ, &volkswagen_pq_hooks},
{SAFETY_TESLA, &tesla_hooks},
{SAFETY_ALLOUTPUT, &alloutput_hooks},
{SAFETY_GM_ASCM, &gm_ascm_hooks},
{SAFETY_FORD, &ford_hooks},

View File

@ -9,11 +9,11 @@ const int CHRYSLER_STANDSTILL_THRSLD = 10; // about 1m/s
const CanMsg CHRYSLER_TX_MSGS[] = {{571, 0, 3}, {658, 0, 6}, {678, 0, 8}};
AddrCheckStruct chrysler_rx_checks[] = {
{.msg = {{544, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 10000U}}},
{.msg = {{514, 0, 8, .check_checksum = false, .max_counter = 0U, .expected_timestep = 10000U}}},
{.msg = {{500, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}}},
{.msg = {{308, 0, 8, .check_checksum = false, .max_counter = 15U, .expected_timestep = 20000U}}},
{.msg = {{320, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}}},
{.msg = {{544, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 10000U}, { 0 }, { 0 }}},
{.msg = {{514, 0, 8, .check_checksum = false, .max_counter = 0U, .expected_timestep = 10000U}, { 0 }, { 0 }}},
{.msg = {{500, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}, { 0 }, { 0 }}},
{.msg = {{308, 0, 8, .check_checksum = false, .max_counter = 15U, .expected_timestep = 20000U}, { 0 }, { 0 }}},
{.msg = {{320, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}, { 0 }, { 0 }}},
};
const int CHRYSLER_RX_CHECK_LEN = sizeof(chrysler_rx_checks) / sizeof(chrysler_rx_checks[0]);
@ -25,10 +25,10 @@ static uint8_t chrysler_get_checksum(CAN_FIFOMailBox_TypeDef *to_push) {
static uint8_t chrysler_compute_checksum(CAN_FIFOMailBox_TypeDef *to_push) {
/* This function does not want the checksum byte in the input data.
jeep chrysler canbus checksum from http://illmatics.com/Remote%20Car%20Hacking.pdf */
uint8_t checksum = 0xFF;
uint8_t checksum = 0xFFU;
int len = GET_LEN(to_push);
for (int j = 0; j < (len - 1); j++) {
uint8_t shift = 0x80;
uint8_t shift = 0x80U;
uint8_t curr = (uint8_t)GET_BYTE(to_push, j);
for (int i=0; i<8; i++) {
uint8_t bit_sum = curr & shift;
@ -132,7 +132,7 @@ static int chrysler_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
// LKA STEER
if (addr == 0x292) {
int desired_torque = ((GET_BYTE(to_send, 0) & 0x7U) << 8) + GET_BYTE(to_send, 1) - 1024U;
uint32_t ts = TIM2->CNT;
uint32_t ts = microsecond_timer_get();
bool violation = 0;
if (controls_allowed) {

View File

@ -33,6 +33,7 @@ static int elm327_tx_lin_hook(int lin_num, uint8_t *data, int len) {
return tx;
}
// If current_board->has_obd and safety_param == 0, bus 1 is multiplexed to the OBD-II port
const safety_hooks elm327_hooks = {
.init = nooutput_init,
.rx = default_rx_hook,

View File

@ -24,12 +24,13 @@ const CanMsg GM_TX_MSGS[] = {{384, 0, 4}, {1033, 0, 7}, {1034, 0, 7}, {715, 0, 8
{0x104c006c, 3, 3}, {0x10400060, 3, 5}}; // gmlan
// TODO: do checksum and counter checks. Add correct timestep, 0.1s for now.
AddrCheckStruct gm_rx_checks[] = {
{.msg = {{388, 0, 8, .expected_timestep = 100000U}}},
{.msg = {{842, 0, 5, .expected_timestep = 100000U}}},
{.msg = {{481, 0, 7, .expected_timestep = 100000U}}},
{.msg = {{241, 0, 6, .expected_timestep = 100000U}}},
{.msg = {{417, 0, 7, .expected_timestep = 100000U}}},
{.msg = {{388, 0, 8, .expected_timestep = 100000U}, { 0 }, { 0 }}},
{.msg = {{842, 0, 5, .expected_timestep = 100000U}, { 0 }, { 0 }}},
{.msg = {{481, 0, 7, .expected_timestep = 100000U}, { 0 }, { 0 }}},
{.msg = {{241, 0, 6, .expected_timestep = 100000U}, { 0 }, { 0 }}},
{.msg = {{417, 0, 7, .expected_timestep = 100000U}, { 0 }, { 0 }}},
};
const int GM_RX_CHECK_LEN = sizeof(gm_rx_checks) / sizeof(gm_rx_checks[0]);
@ -143,7 +144,7 @@ static int gm_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
// LKA STEER: safety check
if (addr == 384) {
int desired_torque = ((GET_BYTE(to_send, 0) & 0x7U) << 8) + GET_BYTE(to_send, 1);
uint32_t ts = TIM2->CNT;
uint32_t ts = microsecond_timer_get();
bool violation = 0;
desired_torque = to_signed(desired_torque, 11);

View File

@ -27,18 +27,18 @@ const int HONDA_BOSCH_ACCEL_MIN = -350; // max braking == -3.5m/s2
// Nidec and Bosch giraffe have pt on bus 0
AddrCheckStruct honda_rx_checks[] = {
{.msg = {{0x1A6, 0, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 40000U},
{0x296, 0, 4, .check_checksum = true, .max_counter = 3U, .expected_timestep = 40000U}}},
{.msg = {{0x158, 0, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 10000U}}},
{.msg = {{0x17C, 0, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 10000U}}},
{0x296, 0, 4, .check_checksum = true, .max_counter = 3U, .expected_timestep = 40000U},{ 0 }}},
{.msg = {{0x158, 0, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 10000U}, { 0 }, { 0 }}},
{.msg = {{0x17C, 0, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 10000U}, { 0 }, { 0 }}},
};
const int HONDA_RX_CHECKS_LEN = sizeof(honda_rx_checks) / sizeof(honda_rx_checks[0]);
// Bosch harness has pt on bus 1
AddrCheckStruct honda_bh_rx_checks[] = {
{.msg = {{0x296, 1, 4, .check_checksum = true, .max_counter = 3U, .expected_timestep = 40000U}}},
{.msg = {{0x158, 1, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 10000U}}},
{.msg = {{0x296, 1, 4, .check_checksum = true, .max_counter = 3U, .expected_timestep = 40000U}, { 0 }, { 0 }}},
{.msg = {{0x158, 1, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 10000U}, { 0 }, { 0 }}},
{.msg = {{0x17C, 1, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 10000U},
{0x1BE, 1, 3, .check_checksum = true, .max_counter = 3U, .expected_timestep = 20000U}}},
{0x1BE, 1, 3, .check_checksum = true, .max_counter = 3U, .expected_timestep = 20000U}, { 0 }}},
};
const int HONDA_BH_RX_CHECKS_LEN = sizeof(honda_bh_rx_checks) / sizeof(honda_bh_rx_checks[0]);
@ -161,16 +161,25 @@ static int honda_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {
}
}
// if steering controls messages are received on the destination bus, it's an indication
// that the relay might be malfunctioning
bool stock_ecu_detected = false;
int bus_rdr_car = (honda_hw == HONDA_BH_HW) ? 0 : 2; // radar bus, car side
if ((safety_mode_cnt > RELAY_TRNS_TIMEOUT) && ((addr == 0xE4) || (addr == 0x194))) {
if (((honda_hw != HONDA_N_HW) && (bus == bus_rdr_car)) ||
((honda_hw == HONDA_N_HW) && (bus == 0))) {
int pt_bus = (honda_hw == HONDA_BH_HW) ? 1 : 0;
if (safety_mode_cnt > RELAY_TRNS_TIMEOUT) {
// If steering controls messages are received on the destination bus, it's an indication
// that the relay might be malfunctioning
if ((addr == 0xE4) || (addr == 0x194)) {
if (((honda_hw != HONDA_N_HW) && (bus == bus_rdr_car)) || ((honda_hw == HONDA_N_HW) && (bus == 0))) {
stock_ecu_detected = true;
}
}
// If Honda Bosch longitudinal mode is selected we need to ensure the radar is turned off
// Verify this by ensuring ACC_CONTROL (0x1DF) is not received on the PT bus
if (honda_bosch_long && (bus == pt_bus) && (addr == 0x1DF)) {
stock_ecu_detected = true;
}
}
generic_rx_checks(stock_ecu_detected);
}
return valid;
@ -290,6 +299,13 @@ static int honda_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
}
}
// Only tester present ("\x02\x3E\x80\x00\x00\x00\x00\x00") allowed on diagnostics address
if (addr == 0x18DAB0F1) {
if ((GET_BYTES_04(to_send) != 0x00803E02) || (GET_BYTES_48(to_send) != 0x0)) {
tx = 0;
}
}
// 1 allows the message through
return tx;
}

View File

@ -18,24 +18,30 @@ const CanMsg HYUNDAI_TX_MSGS[] = {
};
AddrCheckStruct hyundai_rx_checks[] = {
{.msg = {{608, 0, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 10000U}}},
{.msg = {{902, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 10000U}}},
{.msg = {{916, 0, 8, .check_checksum = true, .max_counter = 7U, .expected_timestep = 10000U}}},
{.msg = {{1057, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}}},
{.msg = {{608, 0, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 10000U},
{881, 0, 8, .expected_timestep = 10000U}, { 0 }}},
{.msg = {{902, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 10000U}, { 0 }, { 0 }}},
{.msg = {{916, 0, 8, .check_checksum = true, .max_counter = 7U, .expected_timestep = 10000U}, { 0 }, { 0 }}},
{.msg = {{1057, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}, { 0 }, { 0 }}},
};
const int HYUNDAI_RX_CHECK_LEN = sizeof(hyundai_rx_checks) / sizeof(hyundai_rx_checks[0]);
// older hyundai models have less checks due to missing counters and checksums
AddrCheckStruct hyundai_legacy_rx_checks[] = {
{.msg = {{608, 0, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 10000U},
{881, 0, 8, .expected_timestep = 10000U}}},
{.msg = {{902, 0, 8, .expected_timestep = 10000U}}},
{.msg = {{916, 0, 8, .expected_timestep = 10000U}}},
{.msg = {{1057, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}}},
{881, 0, 8, .expected_timestep = 10000U}, { 0 }}},
{.msg = {{902, 0, 8, .expected_timestep = 10000U}, { 0 }, { 0 }}},
{.msg = {{916, 0, 8, .expected_timestep = 10000U}, { 0 }, { 0 }}},
{.msg = {{1057, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}, { 0 }, { 0 }}},
};
const int HYUNDAI_LEGACY_RX_CHECK_LEN = sizeof(hyundai_legacy_rx_checks) / sizeof(hyundai_legacy_rx_checks[0]);
const int HYUNDAI_PARAM_EV_GAS = 1;
const int HYUNDAI_PARAM_HYBRID_GAS = 2;
bool hyundai_legacy = false;
bool hyundai_ev_gas_signal = false;
bool hyundai_hybrid_gas_signal = false;
static uint8_t hyundai_get_counter(CAN_FIFOMailBox_TypeDef *to_push) {
int addr = GET_ADDR(to_push);
@ -145,12 +151,14 @@ static int hyundai_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {
cruise_engaged_prev = cruise_engaged;
}
if ((addr == 608) || (hyundai_legacy && (addr == 881))) {
if (addr == 608) {
gas_pressed = (GET_BYTE(to_push, 7) >> 6) != 0;
} else {
gas_pressed = (((GET_BYTE(to_push, 4) & 0x7F) << 1) | GET_BYTE(to_push, 3) >> 7) != 0;
}
// read gas pressed signal
if ((addr == 881) && hyundai_ev_gas_signal) {
gas_pressed = (((GET_BYTE(to_push, 4) & 0x7F) << 1) | GET_BYTE(to_push, 3) >> 7) != 0;
} else if ((addr == 881) && hyundai_hybrid_gas_signal) {
gas_pressed = GET_BYTE(to_push, 7) != 0;
} else if (addr == 608) { // ICE
gas_pressed = (GET_BYTE(to_push, 7) >> 6) != 0;
} else {
}
// sample wheel speed, averaging opposite corners
@ -186,7 +194,7 @@ static int hyundai_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
// LKA STEER: safety check
if (addr == 832) {
int desired_torque = ((GET_BYTES_04(to_send) >> 16) & 0x7ff) - 1024;
uint32_t ts = TIM2->CNT;
uint32_t ts = microsecond_timer_get();
bool violation = 0;
if (controls_allowed) {
@ -260,19 +268,21 @@ static int hyundai_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) {
}
static void hyundai_init(int16_t param) {
UNUSED(param);
controls_allowed = false;
relay_malfunction_reset();
hyundai_legacy = false;
hyundai_ev_gas_signal = GET_FLAG(param, HYUNDAI_PARAM_EV_GAS);
hyundai_hybrid_gas_signal = !hyundai_ev_gas_signal && GET_FLAG(param, HYUNDAI_PARAM_HYBRID_GAS);
}
static void hyundai_legacy_init(int16_t param) {
UNUSED(param);
controls_allowed = false;
relay_malfunction_reset();
hyundai_legacy = true;
hyundai_ev_gas_signal = GET_FLAG(param, HYUNDAI_PARAM_EV_GAS);
hyundai_hybrid_gas_signal = !hyundai_ev_gas_signal && GET_FLAG(param, HYUNDAI_PARAM_HYBRID_GAS);
}
const safety_hooks hyundai_hooks = {

View File

@ -31,11 +31,11 @@ const CanMsg MAZDA_TX_MSGS[] = {{MAZDA_LKAS, 0, 8}, {MAZDA_CRZ_BTNS, 0, 8}};
bool mazda_lkas_allowed = false;
AddrCheckStruct mazda_rx_checks[] = {
{.msg = {{MAZDA_CRZ_CTRL, 0, 8, .expected_timestep = 20000U}}},
{.msg = {{MAZDA_CRZ_BTNS, 0, 8, .expected_timestep = 100000U}}},
{.msg = {{MAZDA_STEER_TORQUE, 0, 8, .expected_timestep = 12000U}}},
{.msg = {{MAZDA_ENGINE_DATA, 0, 8, .expected_timestep = 10000U}}},
{.msg = {{MAZDA_PEDALS, 0, 8, .expected_timestep = 20000U}}},
{.msg = {{MAZDA_CRZ_CTRL, 0, 8, .expected_timestep = 20000U}, { 0 }, { 0 }}},
{.msg = {{MAZDA_CRZ_BTNS, 0, 8, .expected_timestep = 100000U}, { 0 }, { 0 }}},
{.msg = {{MAZDA_STEER_TORQUE, 0, 8, .expected_timestep = 12000U}, { 0 }, { 0 }}},
{.msg = {{MAZDA_ENGINE_DATA, 0, 8, .expected_timestep = 10000U}, { 0 }, { 0 }}},
{.msg = {{MAZDA_PEDALS, 0, 8, .expected_timestep = 20000U}, { 0 }, { 0 }}},
};
const int MAZDA_RX_CHECKS_LEN = sizeof(mazda_rx_checks) / sizeof(mazda_rx_checks[0]);
@ -120,7 +120,7 @@ static int mazda_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
if (addr == MAZDA_LKAS) {
int desired_torque = (((GET_BYTE(to_send, 0) & 0x0f) << 8) | GET_BYTE(to_send, 1)) - MAZDA_MAX_STEER;
bool violation = 0;
uint32_t ts = TIM2->CNT;
uint32_t ts = microsecond_timer_get();
if (controls_allowed) {

View File

@ -16,11 +16,11 @@ const CanMsg NISSAN_TX_MSGS[] = {{0x169, 0, 8}, {0x2b1, 0, 8}, {0x4cc, 0, 8}, {0
// Signals duplicated below due to the fact that these messages can come in on either CAN bus, depending on car model.
AddrCheckStruct nissan_rx_checks[] = {
{.msg = {{0x2, 0, 5, .expected_timestep = 10000U},
{0x2, 1, 5, .expected_timestep = 10000U}}}, // STEER_ANGLE_SENSOR (100Hz)
{0x2, 1, 5, .expected_timestep = 10000U}, { 0 }}}, // STEER_ANGLE_SENSOR (100Hz)
{.msg = {{0x285, 0, 8, .expected_timestep = 20000U},
{0x285, 1, 8, .expected_timestep = 20000U}}}, // WHEEL_SPEEDS_REAR (50Hz)
{0x285, 1, 8, .expected_timestep = 20000U}, { 0 }}}, // WHEEL_SPEEDS_REAR (50Hz)
{.msg = {{0x30f, 2, 3, .expected_timestep = 100000U},
{0x30f, 1, 3, .expected_timestep = 100000U}}}, // CRUISE_STATE (10Hz)
{0x30f, 1, 3, .expected_timestep = 100000U}, { 0 }}}, // CRUISE_STATE (10Hz)
{.msg = {{0x15c, 0, 8, .expected_timestep = 20000U},
{0x15c, 1, 8, .expected_timestep = 20000U},
{0x239, 0, 8, .expected_timestep = 20000U}}}, // GAS_PEDAL (100Hz / 50Hz)

View File

@ -16,11 +16,11 @@ const CanMsg SUBARU_TX_MSGS[] = {{0x122, 0, 8}, {0x221, 0, 8}, {0x322, 0, 8}};
const int SUBARU_TX_MSGS_LEN = sizeof(SUBARU_TX_MSGS) / sizeof(SUBARU_TX_MSGS[0]);
AddrCheckStruct subaru_rx_checks[] = {
{.msg = {{ 0x40, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 10000U}}},
{.msg = {{0x119, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}}},
{.msg = {{0x139, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}}},
{.msg = {{0x13a, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}}},
{.msg = {{0x240, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 50000U}}},
{.msg = {{ 0x40, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 10000U}, { 0 }, { 0 }}},
{.msg = {{0x119, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}, { 0 }, { 0 }}},
{.msg = {{0x139, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}, { 0 }, { 0 }}},
{.msg = {{0x13a, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}, { 0 }, { 0 }}},
{.msg = {{0x240, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 50000U}, { 0 }, { 0 }}},
};
const int SUBARU_RX_CHECK_LEN = sizeof(subaru_rx_checks) / sizeof(subaru_rx_checks[0]);
@ -29,9 +29,9 @@ const int SUBARU_L_TX_MSGS_LEN = sizeof(SUBARU_L_TX_MSGS) / sizeof(SUBARU_L_TX_M
// TODO: do checksum and counter checks after adding the signals to the outback dbc file
AddrCheckStruct subaru_l_rx_checks[] = {
{.msg = {{0x140, 0, 8, .expected_timestep = 10000U}}},
{.msg = {{0x371, 0, 8, .expected_timestep = 20000U}}},
{.msg = {{0x144, 0, 8, .expected_timestep = 50000U}}},
{.msg = {{0x140, 0, 8, .expected_timestep = 10000U}, { 0 }, { 0 }}},
{.msg = {{0x371, 0, 8, .expected_timestep = 20000U}, { 0 }, { 0 }}},
{.msg = {{0x144, 0, 8, .expected_timestep = 50000U}, { 0 }, { 0 }}},
};
const int SUBARU_L_RX_CHECK_LEN = sizeof(subaru_l_rx_checks) / sizeof(subaru_l_rx_checks[0]);
@ -163,7 +163,7 @@ static int subaru_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
if (addr == 0x122) {
int desired_torque = ((GET_BYTES_04(to_send) >> 16) & 0x1FFF);
bool violation = 0;
uint32_t ts = TIM2->CNT;
uint32_t ts = microsecond_timer_get();
desired_torque = -1 * to_signed(desired_torque, 13);
@ -227,7 +227,7 @@ static int subaru_legacy_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
if (addr == 0x164) {
int desired_torque = ((GET_BYTES_04(to_send) >> 8) & 0x1FFF);
bool violation = 0;
uint32_t ts = TIM2->CNT;
uint32_t ts = microsecond_timer_get();
desired_torque = -1 * to_signed(desired_torque, 13);

View File

@ -1,18 +1,3 @@
// board enforces
// in-state
// accel set/resume
// out-state
// cancel button
// regen paddle
// accel rising edge
// brake rising edge
// brake > 0mph
//
bool fmax_limit_check(float val, const float MAX_VAL, const float MIN_VAL) {
return (val > MAX_VAL) || (val < MIN_VAL);
}
// 2m/s are added to be less restrictive
const struct lookup_t TESLA_LOOKUP_ANGLE_RATE_UP = {
{2., 7., 17.},
{5., .8, .25}};
@ -21,186 +6,193 @@ const struct lookup_t TESLA_LOOKUP_ANGLE_RATE_DOWN = {
{2., 7., 17.},
{5., 3.5, .8}};
const struct lookup_t TESLA_LOOKUP_MAX_ANGLE = {
{2., 29., 38.},
{410., 92., 36.}};
const int TESLA_DEG_TO_CAN = 10;
const uint32_t TESLA_RT_INTERVAL = 250000; // 250ms between real time checks
const CanMsg TESLA_TX_MSGS[] = {
{0x488, 0, 4}, // DAS_steeringControl
{0x45, 0, 8}, // STW_ACTN_RQ
{0x45, 2, 8}, // STW_ACTN_RQ
};
// state of angle limits
float tesla_desired_angle_last = 0; // last desired steer angle
float tesla_rt_angle_last = 0.; // last real time angle
float tesla_ts_angle_last = 0;
int tesla_controls_allowed_last = 0;
int tesla_speed = 0;
int eac_status = 0;
void set_gmlan_digital_output(int to_set);
void reset_gmlan_switch_timeout(void);
void gmlan_switch_init(int timeout_enable);
AddrCheckStruct tesla_rx_checks[] = {
{.msg = {{0x370, 0, 8, .expected_timestep = 40000U}, { 0 }, { 0 }}}, // EPAS_sysStatus (25Hz)
{.msg = {{0x108, 0, 8, .expected_timestep = 10000U}, { 0 }, { 0 }}}, // DI_torque1 (100Hz)
{.msg = {{0x118, 0, 6, .expected_timestep = 10000U}, { 0 }, { 0 }}}, // DI_torque2 (100Hz)
{.msg = {{0x155, 0, 8, .expected_timestep = 20000U}, { 0 }, { 0 }}}, // ESP_B (50Hz)
{.msg = {{0x20a, 0, 8, .expected_timestep = 20000U}, { 0 }, { 0 }}}, // BrakeMessage (50Hz)
{.msg = {{0x368, 0, 8, .expected_timestep = 100000U}, { 0 }, { 0 }}}, // DI_state (10Hz)
{.msg = {{0x318, 0, 8, .expected_timestep = 100000U}, { 0 }, { 0 }}}, // GTW_carState (10Hz)
};
#define TESLA_RX_CHECK_LEN (sizeof(tesla_rx_checks) / sizeof(tesla_rx_checks[0]))
bool autopilot_enabled = false;
static int tesla_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {
set_gmlan_digital_output(0); // #define GMLAN_HIGH 0
reset_gmlan_switch_timeout(); //we're still in tesla safety mode, reset the timeout counter and make sure our output is enabled
bool valid = addr_safety_check(to_push, tesla_rx_checks, TESLA_RX_CHECK_LEN,
NULL, NULL, NULL);
int addr = GET_ADDR(to_push);
if(valid) {
int bus = GET_BUS(to_push);
int addr = GET_ADDR(to_push);
if (addr == 0x45) {
// 6 bits starting at position 0
int lever_position = GET_BYTE(to_push, 0) & 0x3F;
if (lever_position == 2) { // pull forward
// activate openpilot
controls_allowed = 1;
if(bus == 0) {
if(addr == 0x370) {
// Steering angle: (0.1 * val) - 819.2 in deg.
// Store it 1/10 deg to match steering request
int angle_meas_new = (((GET_BYTE(to_push, 4) & 0x3F) << 8) | GET_BYTE(to_push, 5)) - 8192;
update_sample(&angle_meas, angle_meas_new);
}
if(addr == 0x155) {
// Vehicle speed: (0.01 * val) * KPH_TO_MPS
vehicle_speed = ((GET_BYTE(to_push, 5) << 8) | (GET_BYTE(to_push, 6))) * 0.01 / 3.6;
vehicle_moving = vehicle_speed > 0.;
}
if(addr == 0x108) {
// Gas pressed
gas_pressed = (GET_BYTE(to_push, 6) != 0);
}
if(addr == 0x20a) {
// Brake pressed
brake_pressed = (((GET_BYTE(to_push, 0) & 0x0C) >> 2) != 1);
}
if(addr == 0x368) {
// Cruise state
int cruise_state = (GET_BYTE(to_push, 1) >> 4);
bool cruise_engaged = (cruise_state == 2) || // ENABLED
(cruise_state == 3) || // STANDSTILL
(cruise_state == 4) || // OVERRIDE
(cruise_state == 6) || // PRE_FAULT
(cruise_state == 7); // PRE_CANCEL
if(cruise_engaged && !cruise_engaged_prev) {
controls_allowed = 1;
}
if(!cruise_engaged) {
controls_allowed = 0;
}
cruise_engaged_prev = cruise_engaged;
}
}
if (lever_position == 1) { // push towards the back
// deactivate openpilot
controls_allowed = 0;
if (bus == 2) {
if (addr == 0x399) {
// Autopilot status
int autopilot_status = (GET_BYTE(to_push, 0) & 0xF);
autopilot_enabled = (autopilot_status == 3) || // ACTIVE_1
(autopilot_status == 4) || // ACTIVE_2
(autopilot_status == 5); // ACTIVE_NAVIGATE_ON_AUTOPILOT
if (autopilot_enabled) {
controls_allowed = 0;
}
}
}
// 0x488: DAS_steeringControl should not be received on bus 0
generic_rx_checks((addr == 0x488) && (bus == 0));
}
// exit controls on brake press
// DI_torque2::DI_brakePedal 0x118
if (addr == 0x118) {
// 1 bit at position 16
if ((GET_BYTE(to_push, 1) & 0x80) != 0) {
// disable break cancel by commenting line below
controls_allowed = 0;
}
//get vehicle speed in m/s. Tesla gives MPH
tesla_speed = (((((GET_BYTE(to_push, 3) & 0xF) << 8) + GET_BYTE(to_push, 2)) * 0.05) - 25) * 1.609 / 3.6;
if (tesla_speed < 0) {
tesla_speed = 0;
}
}
// exit controls on EPAS error
// EPAS_sysStatus::EPAS_eacStatus 0x370
if (addr == 0x370) {
// if EPAS_eacStatus is not 1 or 2, disable control
eac_status = (GET_BYTE(to_push, 6) >> 5) & 0x7;
// For human steering override we must not disable controls when eac_status == 0
// Additional safety: we could only allow eac_status == 0 when we have human steering allowed
if (controls_allowed && (eac_status != 0) && (eac_status != 1) && (eac_status != 2)) {
controls_allowed = 0;
//puts("EPAS error! \n");
}
}
//get latest steering wheel angle
if (addr == 0x00E) {
float angle_meas_now = (int)(((((GET_BYTE(to_push, 0) & 0x3F) << 8) + GET_BYTE(to_push, 1)) * 0.1) - 819.2);
uint32_t ts = TIM2->CNT;
uint32_t ts_elapsed = get_ts_elapsed(ts, tesla_ts_angle_last);
// *** angle real time check
// add 1 to not false trigger the violation and multiply by 25 since the check is done every 250 ms and steer angle is updated at 100Hz
float rt_delta_angle_up = (interpolate(TESLA_LOOKUP_ANGLE_RATE_UP, tesla_speed) * 25.) + 1.;
float rt_delta_angle_down = (interpolate(TESLA_LOOKUP_ANGLE_RATE_DOWN, tesla_speed) * 25.) + 1.;
float highest_rt_angle = tesla_rt_angle_last + ((tesla_rt_angle_last > 0.) ? rt_delta_angle_up : rt_delta_angle_down);
float lowest_rt_angle = tesla_rt_angle_last - ((tesla_rt_angle_last > 0.) ? rt_delta_angle_down : rt_delta_angle_up);
if ((ts_elapsed > TESLA_RT_INTERVAL) || (controls_allowed && !tesla_controls_allowed_last)) {
tesla_rt_angle_last = angle_meas_now;
tesla_ts_angle_last = ts;
}
// check for violation;
if (fmax_limit_check(angle_meas_now, highest_rt_angle, lowest_rt_angle)) {
// We should not be able to STEER under these conditions
// Other sending is fine (to allow human override)
controls_allowed = 0;
//puts("WARN: RT Angle - No steer allowed! \n");
} else {
controls_allowed = 1;
}
tesla_controls_allowed_last = controls_allowed;
}
return 1;
return valid;
}
// all commands: gas/regen, friction brake and steering
// if controls_allowed and no pedals pressed
// allow all commands up to limit
// else
// block all commands that produce actuation
static int tesla_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
int tx = 1;
int addr = GET_ADDR(to_send);
bool violation = false;
// do not transmit CAN message if steering angle too high
// DAS_steeringControl::DAS_steeringAngleRequest
if (addr == 0x488) {
float angle_raw = ((GET_BYTE(to_send, 0) & 0x7F) << 8) + GET_BYTE(to_send, 1);
float desired_angle = (angle_raw * 0.1) - 1638.35;
bool violation = 0;
int st_enabled = GET_BYTE(to_send, 2) & 0x40;
if(!msg_allowed(to_send, TESLA_TX_MSGS, sizeof(TESLA_TX_MSGS) / sizeof(TESLA_TX_MSGS[0]))) {
tx = 0;
}
if (st_enabled == 0) {
//steering is not enabled, do not check angles and do send
tesla_desired_angle_last = desired_angle;
} else if (controls_allowed) {
// add 1 to not false trigger the violation
float delta_angle_up = interpolate(TESLA_LOOKUP_ANGLE_RATE_UP, tesla_speed) + 1.;
float delta_angle_down = interpolate(TESLA_LOOKUP_ANGLE_RATE_DOWN, tesla_speed) + 1.;
float highest_desired_angle = tesla_desired_angle_last + ((tesla_desired_angle_last > 0.) ? delta_angle_up : delta_angle_down);
float lowest_desired_angle = tesla_desired_angle_last - ((tesla_desired_angle_last > 0.) ? delta_angle_down : delta_angle_up);
float TESLA_MAX_ANGLE = interpolate(TESLA_LOOKUP_MAX_ANGLE, tesla_speed) + 1.;
if(relay_malfunction) {
tx = 0;
}
//check for max angles
violation |= fmax_limit_check(desired_angle, TESLA_MAX_ANGLE, -TESLA_MAX_ANGLE);
if(addr == 0x488) {
// Steering control: (0.1 * val) - 1638.35 in deg.
// We use 1/10 deg as a unit here
int raw_angle_can = (((GET_BYTE(to_send, 0) & 0x7F) << 8) | GET_BYTE(to_send, 1));
int desired_angle = raw_angle_can - 16384;
int steer_control_type = GET_BYTE(to_send, 2) >> 6;
bool steer_control_enabled = (steer_control_type != 0) && // NONE
(steer_control_type != 3); // DISABLED
//check for angle delta changes
violation |= fmax_limit_check(desired_angle, highest_desired_angle, lowest_desired_angle);
// Rate limit while steering
if(controls_allowed && steer_control_enabled) {
// Add 1 to not false trigger the violation
float delta_angle_float;
delta_angle_float = (interpolate(TESLA_LOOKUP_ANGLE_RATE_UP, vehicle_speed) * TESLA_DEG_TO_CAN);
int delta_angle_up = (int)(delta_angle_float) + 1;
delta_angle_float = (interpolate(TESLA_LOOKUP_ANGLE_RATE_DOWN, vehicle_speed) * TESLA_DEG_TO_CAN);
int delta_angle_down = (int)(delta_angle_float) + 1;
int highest_desired_angle = desired_angle_last + ((desired_angle_last > 0) ? delta_angle_up : delta_angle_down);
int lowest_desired_angle = desired_angle_last - ((desired_angle_last >= 0) ? delta_angle_down : delta_angle_up);
if (violation) {
controls_allowed = 0;
tx = 0;
}
tesla_desired_angle_last = desired_angle;
} else {
tx = 0;
// Check for violation;
violation |= max_limit_check(desired_angle, highest_desired_angle, lowest_desired_angle);
}
desired_angle_last = desired_angle;
// Angle should be the same as current angle while not steering
if(!controls_allowed && ((desired_angle < (angle_meas.min - 1)) || (desired_angle > (angle_meas.max + 1)))) {
violation = true;
}
// No angle control allowed when controls are not allowed
if(!controls_allowed && steer_control_enabled) {
violation = true;
}
}
if(addr == 0x45) {
// No button other than cancel can be sent by us
int control_lever_status = (GET_BYTE(to_send, 0) & 0x3F);
if((control_lever_status != 0) && (control_lever_status != 1)) {
violation = true;
}
}
if(violation) {
controls_allowed = 0;
tx = 0;
}
return tx;
}
static int tesla_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) {
int bus_fwd = -1;
int addr = GET_ADDR(to_fwd);
if(bus_num == 0) {
// Chassis to autopilot
bus_fwd = 2;
}
if(bus_num == 2) {
// Autopilot to chassis
bool block_msg = ((addr == 0x488) && !autopilot_enabled);
if(!block_msg) {
bus_fwd = 0;
}
}
if(relay_malfunction) {
bus_fwd = -1;
}
return bus_fwd;
}
static void tesla_init(int16_t param) {
UNUSED(param);
controls_allowed = 0;
gmlan_switch_init(1); //init the gmlan switch with 1s timeout enabled
}
static int tesla_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) {
int bus_fwd = -1;
int addr = GET_ADDR(to_fwd);
if (bus_num == 0) {
// change inhibit of GTW_epasControl
if (addr != 0x214) {
// remove EPB_epasControl
bus_fwd = 2; // Custom EPAS bus
}
if (addr == 0x101) {
to_fwd->RDLR = GET_BYTES_04(to_fwd) | 0x4000; // 0x4000: WITH_ANGLE, 0xC000: WITH_BOTH (angle and torque)
uint32_t checksum = (GET_BYTE(to_fwd, 1) + GET_BYTE(to_fwd, 0) + 2) & 0xFF;
to_fwd->RDLR = GET_BYTES_04(to_fwd) & 0xFFFF;
to_fwd->RDLR = GET_BYTES_04(to_fwd) + (checksum << 16);
}
}
if (bus_num == 2) {
// remove GTW_epasControl in forwards
if (addr != 0x101) {
bus_fwd = 0; // Chassis CAN
}
}
return bus_fwd;
relay_malfunction_reset();
}
const safety_hooks tesla_hooks = {
@ -209,4 +201,6 @@ const safety_hooks tesla_hooks = {
.tx = tesla_tx_hook,
.tx_lin = nooutput_tx_lin_hook,
.fwd = tesla_fwd_hook,
.addr_check = tesla_rx_checks,
.addr_check_len = TESLA_RX_CHECK_LEN,
};

View File

@ -35,11 +35,11 @@ const CanMsg TOYOTA_TX_MSGS[] = {{0x283, 0, 7}, {0x2E6, 0, 8}, {0x2E7, 0, 8}, {0
{0x200, 0, 6}}; // interceptor
AddrCheckStruct toyota_rx_checks[] = {
{.msg = {{ 0xaa, 0, 8, .check_checksum = false, .expected_timestep = 12000U}}},
{.msg = {{0x260, 0, 8, .check_checksum = true, .expected_timestep = 20000U}}},
{.msg = {{0x1D2, 0, 8, .check_checksum = true, .expected_timestep = 30000U}}},
{.msg = {{ 0xaa, 0, 8, .check_checksum = false, .expected_timestep = 12000U}, { 0 }, { 0 }}},
{.msg = {{0x260, 0, 8, .check_checksum = true, .expected_timestep = 20000U}, { 0 }, { 0 }}},
{.msg = {{0x1D2, 0, 8, .check_checksum = true, .expected_timestep = 30000U}, { 0 }, { 0 }}},
{.msg = {{0x224, 0, 8, .check_checksum = false, .expected_timestep = 25000U},
{0x226, 0, 8, .check_checksum = false, .expected_timestep = 25000U}}},
{0x226, 0, 8, .check_checksum = false, .expected_timestep = 25000U}, { 0 }}},
};
const int TOYOTA_RX_CHECKS_LEN = sizeof(toyota_rx_checks) / sizeof(toyota_rx_checks[0]);
@ -201,7 +201,7 @@ static int toyota_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
desired_torque = to_signed(desired_torque, 16);
bool violation = 0;
uint32_t ts = TIM2->CNT;
uint32_t ts = microsecond_timer_get();
if (controls_allowed) {

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