Commit Graph

1078 Commits

Author SHA1 Message Date
Willem Melching
d1b104950a Toyota: always allow -3.5 to 2.0 m/s^2 according to ISO 15622:2018 (#714) 2021-09-06 16:36:30 -07:00
Jason Young
033170750f VW MQB and PQ: Fix controls entry conditions and tests (#707)
* use common tests for cruise and ACC state

* enter controls on rising edge of ACC

* oops

* remove old comment

* another

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-09-01 16:46:10 -07:00
Adeeb Shihadeh
8c687ecfb4 Revert "Honda Bosch: Support extended LKAS_HUD IDs (#615)" (#708)
This reverts commit 46593af619.
2021-08-28 21:11:37 -07:00
Chris Souers
46593af619 Honda Bosch: Support extended LKAS_HUD IDs (#615)
* Add support for new Honda Bosch vehicles

- Support extended LKAS_HUD IDs on Honda Bosch

- Support extended ID checksum on incoming frames in safety hook (currently unused).

condense

Cleaner. Don't need to store the value in checksum at the return.

Co-Authored-By: Adeeb Shihadeh <adeebshihadeh@users.noreply.github.com>

* revert checksum change

* use full space

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@users.noreply.github.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-08-21 23:34:51 -07:00
Igor Biletskyy
ad90646001 Support for STM32H7 and Red Panda (#694)
* H7 drivers

* Include H7 into the code

* fix flash write for H7

* get serial from flasher.h from F4 and H7

* flash.sh and recover.sh for gen3

* add set_data_speed for BRS CAN FD

* build all fws

* gen3 to panda lib

* gen3 name in scons project

* disable fd can and brs

* gen3 to CI tests

* jenkins fix for new tests and build_all

* fix pedal test

* pedal in panda tests again...

* cleanup llfdcan.h

* cleanup clock.h

* Add LDORDY bit check instead of delay

* missing define in stm32h735xx.h lib

* board_id helper

* enable debug detection again

* clean gpio inits

* fix board_id helper, make cleaner

* comment MCUs in stm lib for faster misra

* target MCU

* misra-5.5

* improve headers and misra speed

* cleanup CI tests

* change naming from gen3 to h7

* readable if statement

* cleanup llusb.h

* only cycle one transceifer in bus-off

* move unused funcs to common header

* bus_off_err reset

* misra 10.4 fdcan

* extern to can_data_speed variable

* limit can_data_speed array size to 3

* reinit fd can on data speed change

* Improve test with ELM327 and extaddr check

* bugfix for fdcan

* panda python config naming

* abstracted init request in llfdcan

* misra fdcan

* Improve llusb.h for H7
2021-08-02 20:26:15 -07:00
Igor
da8a76f1b3 Deprecate bcdDevice and legacy mode from panda lib and tests (#692) 2021-07-14 13:30:59 -07:00
Igor
9f781e9e7e Abstract MICROSECOND_TIMER (#690) 2021-07-14 10:59:28 -07:00
Igor
ada4f7e177 Add pedal tests to CI (#680)
* Add pedal tests to CI

* Organized as unittest

* Linter and imports

* Ignore 'none' serials

* Force into DFU

* Check in softloader mode

* Pin jungle commit

* Add silent mode to pedal

* Move pedal serial to const

* split CIs

* full path to canhandle

* Revert adding silent mode to pedal

* improve

* increase timeout pedal test
2021-07-06 20:29:51 -07:00
Igor
7d93e5a202 Refactor HAL (#656)
* Let refactoring begin!

* Fix pedal build

* Fix pedal safety tests

* Forgot few TIM2 instances

* Try this way with misra

* More misras...

* More misras...

* Still fighting with misra blindfolded

* Almost got it!

* Last misra error..

* Last misra error..

* Misra works locally..

* Maybe this?

* Looks like it was cppcheck bug, revert changes

* Suggested changes and reverts

* File structure change

* revert includes

* remove spaces

* remove timer delay

* endings

* more typing

* rename early to early_initialization

* Remove delay_us

* Revert RTC default values

* Revert initialization sequence

* Fix quotes

* Revert

* Return TIM6EN

* Alias slow timer to TICK_TIMER

* Refactor files structure

* Remove definition of PANDA

* Abstract timers

* Fix include

* tick_timer_init

* Split usb driver

* Move LL stuff: adc

* Move LL stuff: usb

* Fix include again...

* Will check pedal builds also locally..

* Move LL stuff: CAN

* Move LL stuff: clock

* Rename common to peripherals and move

* Move board HAL

* Change include, not needed for pedal

* llgpio to gpio and new lines fix

* remove board_has_relay, not used

* Remove board_functions.h and add to board struct

* Move include

* Fk MISRA...

* has_onboard_gmlan to has_hw_gmlan

* Typos

* Move board_declarations include

* Shuffle

* More abstraction

* fix paths, fix cppcheck test

* Fix for pedal build with USB
2021-07-02 18:25:35 -07:00
robbederks
d8385413c3 New tesla safety (#629)
* WIP: new tesla safety

* fix misra

* add unit test

* use | instead of +

* other angle sensor

* change brake message

* fix cancel safety violation

* fix bus for cancel message

* add support for autopilot passthrough and fix cancel message

* fix tests

* this check fails

* fix build

* fix build on c2

* cleanup

* add back AP status to the check

* bus 2

* this check is dumb

* try this?

* add route to do replay on

* cleanup

Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
2021-06-23 12:41:43 +02:00
Willem Melching
d7b3ae0282 Extra checks for Honda Bosch Longitudinal (#662)
* only allow tester present

* ensure radar is not sending messages

* cleanup

* add honda flags

* Constrain tester present message exactly

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* little endian

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-06-22 15:29:47 +02:00
Adeeb Shihadeh
78c24982a9 Remove non-EON panda build (#671)
* Remove non-EON panda build

* missed that

* fixup readme

* more readme

* simplify ci

* add USB command to disable heartbeat checks in debug mode

* clean that up too

* more cleanup

* fix path

* disable heartbeat in set_safety_mode

* more red

* remove one more EON ref
2021-06-21 13:54:09 -07:00
Igor
ddc25b0611 Update cppcheck and misra, suppress for now (#663)
* Update cppcheck and misra, suppress for now

* Add FIXME to suppression tags

* Missed one spot
2021-06-18 14:24:15 -07:00
ShaneSmiskol
ad12330d50 Hyundai: add gas pressed signal for hybrids (#655)
* detect safety param and get gas pressed for PHEVs

* misra guidelines

* else no action

* use explicit safety param

* update for full test coverage

* full hyundai gas press test coverage

* panda's out of date

* update commit?

* need to check out all

* need rednose too

* works without

* override _gas_msg method for each class

* update safety

* is define okay?

* misra

* like this convention better

* convention and fixes

* bump to openpilot master

* simplify

* add to non legacy rx checks

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-06-10 00:21:54 -07:00
Adeeb Shihadeh
3cf5b473c8 CI fixups (#657) 2021-06-09 18:36:07 -07:00
Adeeb Shihadeh
7d9fdd1108 Toyota: whitelist LTA message (#638)
* Toyota: whitelist LTA message

* LTA safety

* simple test

* little more test

* misra
2021-04-06 16:56:03 -07:00
Greg Hogan
c416419c16 hyundai: TCS13 checksum (#623) 2021-04-05 08:44:16 -07:00
Greg Hogan
a3b95dc26d hyundai: WHL_SPD11 checksum (#622)
* WHL_SPD11 checksum

* update comments
2021-03-31 18:39:13 -07:00
Adeeb Shihadeh
596344e48b build libpandasafety with scons (#639)
* build libpandasafety with scons

* remove makefile

* fix that
2021-03-31 18:35:47 -07:00
Willem Melching
ad9ecefe65 Switch panda to scons builder (#635)
* add scons builder

* cleanup 1

* remove building from python code

* add pedal build

* fixup flags

* add EON flag

* change github actions to scons

* fixup automated tests

* move flashing scripts

* fix indent

* remove version.mk

* fix not in git

* fix linker script filename

* untested pedal flashing scripts

* add release option

* better asserts

* swap condition

* enable usb and fix flash script

* usb flash is not supported

* use button to enable dfu mode

* no usb because misra

* remove sleep
2021-03-24 14:44:32 +01:00
Jason Young
9108b82fb0 VW MQB: Updated message and signal data, round 1 (#632)
* EPS_01 -> LH_EPS_03

* Bump openpilot commit ref

* made echo test more stable

* update python to 3.8.5

* Revert "Bump openpilot commit ref"

This reverts commit 75ec1a0c

* Bump openpilot commit ref

* Bump openpilot commit ref

* Update Dockerfile.panda

* fixed torque signal name

* Signal naming fix, round 2

* fix CI

Co-authored-by: Robbe Derks <robbe.derks@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-03-14 16:24:53 -07:00
Robbe Derks
08eec16960 made echo test more stable 2021-03-10 16:56:09 +01:00
Adeeb Shihadeh
9fb584b20c Hyundai: increase max torque (#602)
* increase max hyundai torque

* update test threshold
2020-10-01 12:03:23 -07:00
Adeeb Shihadeh
8b41ed3b81 Deprecate ESP (#592)
* remove unused wifi tests

* remove that one too

* no bootmode from ESP

* clean that up

* remove two more wifi tests

* remove boardesp and esptool

* esp_gps -> gps

* missed those

* remove esptool refs

* remove esp certs

* no more wifi

* that was old

* cleanup jenkins dockerfile

* fix linter

* remove more wifi refs

* clone panda jungle from github

* no copy

* always default esp to off
2020-08-26 15:37:50 -07:00
Tici
f7089b71b9 relay test 2020-08-17 10:15:17 +00:00
Adeeb Shihadeh
ecef0a19d0 add dos to safety tests 2020-08-12 13:32:33 -07:00
Andre Volmensky
3a8430b9d5 Updating X-Trail/Rogue gas_pressed threshold (#585) 2020-08-08 11:10:32 -07:00
martinl
32199b2e49 Replace pycrypto with pycryptodome (#581)
* replace pycrypto with pycryptodome

* replace all instances with pycryptodome
2020-08-05 12:58:43 -07:00
Adeeb Shihadeh
b88f96e72a fix linter 2020-07-30 14:36:39 -07:00
Robbe
8bdacca123 Make the gmlan test a little easier to use 2020-07-29 13:10:53 -07:00
martinl
c55e84bf56 Change Subaru safety test to use generated dbc (#575)
* Change Subaru test to use generated dbc

* update openpilot pinned commit
2020-07-23 13:06:11 -07:00
Adeeb Shihadeh
0d97b6d4eb Safety Test: ensure TX msgs for other cars are blocked (#521) 2020-06-21 23:25:54 -07:00
Adeeb Shihadeh
5b14945140 Abstract RX checks for gas, brakes, and relay malfunction (#556)
* abstract gas, brake, and relay RX checks

* toyota

* mazda

* vw and subaru

* gm, honda, nissan

* chrysler

* rename

* revert that
2020-06-16 02:01:00 -07:00
Adeeb Shihadeh
086be906d7 Add test routes for Hyundai legacy and Subaru legacy safety modes (#558)
* add subaru legacy route to safety replay

* hyundai legacy routet push
2020-06-15 18:15:49 -07:00
Adeeb
d0442fd1e4 add hyundai legacy safety mode (#554) 2020-06-12 18:03:31 -07:00
Adeeb Shihadeh
abeafb6256 fix linter 2020-06-11 17:06:53 -07:00
Robbe
5d6fcbb422 gmlan harness test 2020-06-11 16:44:37 -07:00
martinl
b2c86eb66b Subaru safety refactoring (#532)
* Update subaru safety tx messages

* Add Subaru preglobal driver torque limits

* fix preglobal desired_torque

* fix subaru preglobal torque rate limit and tx messages

* readability update for desired_torque

* fix preglobal tests

* Subaru safety refactoring, added missing legacy checks and updated test

* Remove subaru_global check from tests

* Reorder legacy constants, remove subaru_init

* Update Subaru legacy safety and tests to match dbc scaling factors

* remove scaling factor from torque_driver

* Change preglobal driver torque scaling factor

* Change driver torque factor to 10

* Fix preglobal dbc name

* Fix Subaru legacy safety test

* update openpilot commit

* init valid with one line
2020-06-11 15:51:05 -07:00
Adeeb Shihadeh
9eee6ca556 update safety tests after DBC changes 2020-06-09 16:51:08 -07:00
Adeeb
35bff5db51 Speed up misra test in CI (#552) 2020-06-07 21:42:23 -07:00
Adeeb Shihadeh
6848c7576b use same flake8 config as openpilot 2020-06-03 16:22:30 -07:00
Willem Melching
e0a706e4f0 Stricter pylint (#550)
* stricter pylint

* Add as argument
2020-06-02 16:27:07 -07:00
Adeeb
d7f7b14118 Enable almost all Flake8 checks (#548)
* fix W391

* E262

* E703

* W293

* some E

* E231

* some more E

* E225

* more E

* E252

* no tabs

* more tabs

* E701

* uds.py

* almost all of them

* only e265 left

* not sure why this is triggering on commented out code

* ignore esptool
2020-06-01 01:49:26 -07:00
Adeeb Shihadeh
eba113cb67 backslash is redundant between brackets 2020-05-31 17:39:42 -07:00
Adeeb Shihadeh
275e76c2b2 fix linter complaint about too many blank lines 2020-05-31 17:20:47 -07:00
Adeeb Shihadeh
9102c16118 two spaces before inline comment 2020-05-31 14:07:01 -07:00
Adeeb Shihadeh
3a85f4c25c use whole route when running safety replay from CLI 2020-05-30 21:31:18 -07:00
Willem Melching
b8267341a1 Add pre commit checks + CI (#545)
* Add pre commit checks

* untested but should work

* fix typo in dockerfile

* add sqlite

* add pylintrc to ignore usb1 members

* Typo in stage name

* Move to requirements
2020-05-29 11:52:03 -07:00
Jafar Al-Gharaibeh
89658d0bde Mazda: safety tests add missing safety checks (#525)
* Mazda: add safety test

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* Update mazda safety to capture more events

    * gas press
    * brake press
    * speed - lkas on/off

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* Customize safety tests

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* Add RX checks

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* Format

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* Set lkas enable speed at 52 kph

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* Test case when speed<enable_lkas_speed

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* Be consistent with names in other places

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* Add test case for lkas on when speed dips below lkas enable speed

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* Make sure lkas disabled

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* Use car's speed signal instead of wheel speed

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* Allow acc cancel msg

  When gas is pressed OP disenages stock cruise doesn't get disengaged.
panda needs to know when OP engages again. OP re-enageges on cruise button
presses. This commit uses the same re-enage logic in panda.

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* rebase

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* allow acc_cancel in safety tests

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>

* rename variable, fix comment

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>
2020-05-28 13:09:54 -07:00
robbederks
b48c74c2e9 Adding UNO to automated tests (#538)
* Added UNO to automated tests

* Longer wait for uno while resetting?

* Increased wrong timeout

* this fixes it locally
2020-05-26 15:35:51 -07:00