Commit Graph

1522 Commits

Author SHA1 Message Date
Shane Smiskol 7c84475410
safety: use address check helper (#1721)
use SET_ADDR_CHECKS
2023-11-16 22:36:05 -08:00
Shane Smiskol 57e280ad29
safety: add body safety tests (#1716)
* partial body safety tests

* cmt

* test this flasher msg

* move

* address check on can flashing msg

* no other test tests this, valid when we rx one

* this is more reflective on the current behavior

* better test

* clean up

* stash

* clean up

* revert

* Update board/safety/safety_body.h

* fix misra
2023-11-10 19:02:32 -08:00
Shane Smiskol 55946a060d
safety tests: more coverage (#1714)
* more coverage

* we don't check the counter of this ford message

* there are no messages with these lengths to check
2023-11-10 01:53:41 -08:00
Shane Smiskol 5e22e87cf6
Hyundai CAN: update driver braking signal (#1713)
* use DriverOverride

* Update board/safety/safety_hyundai.h
2023-11-10 01:03:33 -08:00
Adeeb Shihadeh a1d699b87d
SOM boot recovery (#1712)
* reset

* simpler

* only once per panda boot

* cleanup

* also check serial
2023-11-09 18:01:46 -08:00
Adeeb Shihadeh d2ea9ad293
refactor bootkick (#1690)
* bootkick refactor + reset

* simplify

* revert reset stuff

* cleanup

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-11-08 22:54:55 -08:00
Jason Wen 3f25ccabd6
Subaru Pre-Global: Reverse driver torque signal for certain platforms (#1648)
* Subaru Pre-Global: Reverse driver torque signal for certain platforms

* added flag

* fix tests

* use dbc instead

* duplicate

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Justin Newberry <jnewberry0502@gmail.com>
Co-authored-by: Justin Newberry <justin@comma.ai>
2023-11-08 15:27:20 -08:00
Shane Smiskol fa04f47600
safety tests: support multiple relay malfunction addresses (#1707)
* gm: test the other relay malfunction addr when using long with gmcam (ASCMGasRegenCmd)

* make it a dict

* might want to split these changes

* messy

* Revert "messy"

This reverts commit 25cd68fcab.

* some more

* ford: check longitudinal addr

* chrysler

* fix ford!

* gm and subaru

* common

* draft

* clean up

* clean up check

* rm line

* clean up

* add context

* apparently None isn't optional

* conventional test

* Revert "conventional test"

This reverts commit 4b265ad4ab.

* whoops, clean that up

* more clean up

* add a helpful cmt

* more hlpfl cmt

* can remove this test now

* hyundai cmts

* not really needed
2023-11-07 19:03:08 -08:00
Shane Smiskol 2560349fbb
safety: use CLAMP for update_counter (#1706)
Update safety.h
2023-11-06 22:08:24 -08:00
Shane Smiskol d2f9e14062
Honda: add latching AEB test (#1704)
* use get bit

* simplify parsing

* add get_honda_fwd_brake for latching test

rm print

* can also test with txing brake

* Revert "can also test with txing brake"

This reverts commit f75eb6eb56.

* rm this
2023-10-31 21:20:59 -07:00
Shane Smiskol bc69d25335
safety tests: clean up state reset (#1703)
* this is already reset in set_safety_hooks

* move these car-specific variables into their own init hooks
2023-10-31 21:19:55 -07:00
Shane Smiskol f62d1723fd
Hyundai CAN: fix driver torque safety scaling (#1695)
* how does this/did that pass?!

* fix misra

* add comment

* we could do this

* or could do what eps torque does

* another pr

* not unused

* need this for special gm

* support testing integer torque

cmt

* there we go

* stash again

* Revert "stash again"

This reverts commit 4ecf6cc91c.

* this works!

* clean up

* cmt

* ugh this test was broken

* add some comments for this behemoth, and switch to rxing real msgs

* for now, no measurement test since we don't have any info about driver torque on can. for ex:

max value, factor on CAN, etc.

clean up

* more clean up

* just use it everywhere

* better cmt

* cmt
2023-10-24 23:20:33 -07:00
Adeeb Shihadeh aaa1172fa2
HITL bootkick tests (#1685)
* HITL bootkick tests

* both bootkick cases

* more

* som use gpio

* cleanup

* pretty reliable now
2023-10-06 13:38:35 -07:00
Adeeb Shihadeh f42b65ca32
skip flash if up to date (#1686)
* skip flash if up to date

* fix
2023-10-05 13:13:40 -07:00
Igor Biletskyy 5778c0ae5d
H7: fix GMLAN bitbang timer (#1542)
* init

* move Adeeb's test

* bitbang expected to fail can_health
2023-10-03 13:14:14 -07:00
Shane Smiskol 43af1df79e
safety: sample_t is not fully reset on safety mode init (#1376)
* found another bug!

* update test

* why does toyota add 1 but not chrysler?!

* test/fix others

* clean up

* more

* global

* clean up

* one function to reset AND update

* without abs and only negative values: this is not caught (since negative error < 1)

* ugly draft

* clean up, tests work

* now only should use this function

* better cmt

* better loc

* constant in python too!

* actually duplicate comment
2023-10-03 03:15:16 -07:00
Shane Smiskol 635db84095
Subaru: consider true angle sign in safety (#1681)
* this fails

* this doesn't!
2023-10-03 02:18:10 -07:00
Shane Smiskol 9fd1b268b4
Nissan: consider true sign in safety (#1680)
* works

* simpler

* cmt again

* better
2023-10-03 01:50:37 -07:00
Jason Wen 7af336244c
Hyundai CAN-FD: Move CRC compute function to common Hyundai safety (#1634)
* HKG CAN-FD: Move CRC lookup function to common Hyundai safety

* cleanup

* declare in common

* Subaru: gen2 long safety (#1594)

gen2 long safety

* VW MQB: Check steer req bit (#1631)

vq mqb

* cleanup

* more cleanup

---------

Co-authored-by: Justin Newberry <justin@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-10-02 21:32:13 -07:00
Adeeb Shihadeh b6e37f25b6
Remove flash logging (#1674)
* Revert "Disable flash logging (#1667)"

This reverts commit 62db60595b.

* Revert "Faster log retrieval (#1484)"

This reverts commit 694aae9c26.

* Revert "Flash bounds checking outside of bootstub (#1459)"

This reverts commit 054344de6b.

* Revert "Logging (#1445)"

This reverts commit 0cc91a7f7b.

* cleanup

* cleanup
2023-09-30 12:49:46 -07:00
Igor Biletskyy b12b9b9c97
jungle v2: control power individually per port (#1669)
* init

* better api
2023-09-25 17:58:11 -07:00
Adeeb Shihadeh 62db60595b
Disable flash logging (#1667)
* disable logging to flash

* update tests

* fix hitl
2023-09-21 15:28:19 -07:00
Shane Smiskol 546087125f
GM: change ignition signal (#1662)
* GM: change ignition signal

* Update board/drivers/can_common.h
2023-09-15 02:04:51 -07:00
Justin Newberry d4e63daf34
VW PQ: Check steer req bit (#1630)
* vw pq

* misra
2023-09-11 13:59:30 -07:00
Jason Wen 428b303e26
Hyundai CAN-FD: move HDA2 flag to common Hyundai safety (#1638) 2023-09-11 13:57:54 -07:00
Shane Smiskol 8e8aa5acf6
Hyundai CAN: utilize macros for common address checks (#1655)
* common addrs behind macros

* draft so far

* Revert "draft so far"

This reverts commit e41b796a00.

* MISRA

* use new SET_ADDR_CHECKS macro
2023-09-08 00:41:11 -07:00
Shane Smiskol e9a0987617
Hyundai CAN FD: utilize macros for common address checks (#1658)
* draft

* now clean up old comments

* no more special broken ice addr checks

* revert

* fix

* add test for ICE HDA1

* Revert "add test for ICE HDA1"

This reverts commit 76d2b0f066.

* can be separate

* macro for addr check struct

* add checks for alt buttons (fixes race condition)

* add macro for array len

* add comment

* misra

* comments to help separate

* can't put parenthesis around array item

* review suggestions

* no intermediary macros for making the structs (remove misra violation)

* Update board/safety/safety_hyundai_canfd.h

* single lines

* can avoid double checking hda2 since we have addr checks for it now
2023-09-07 23:52:27 -07:00
Adeeb Shihadeh e98639b752 increase not booted log timeout 2023-09-07 16:33:36 -07:00
Justin Newberry cb0cd1bfaa
Subaru: add safety around cutting steer req bit (#1632)
* wip

* steer bit

* add tolerance

* increase a bit more

* test too

* Had that backwards

* Here too

* review suggestions

* minimal diff

* minimal diff

* add type hints

* spacing

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* update test name

* add tolerance comment

Co-authored-by: Shane Smiskol <shane@smiskol.com>

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-09-06 20:34:24 -07:00
Igor Biletskyy 394b61cd16
H7: reset CAN core on bus off state (#1615)
* init

* misra

* merge
2023-09-06 09:50:13 -07:00
Jason Wen 39bc5a4886
Nissan Altima: add a param for alternate EPS bus (#1649)
* Nissan Altima: Specify panda flag for alt bus safety config

* test this safety mode

* test this safety mode

* rm

* nl

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-09-06 00:46:33 -07:00
Shane Smiskol 0b6adad9c8
Nissan: test alternate EPS bus param (#1651)
* test this safety mode

* test this safety mode

* use int

* clean up

* clean up
2023-09-06 00:36:25 -07:00
Igor Biletskyy 3ab4f43de0
enable red and green leds until USB/SPI init (#1647)
* init

* add green
2023-09-05 13:36:13 -07:00
Justin Newberry 72f1603a89
VW MQB: Check steer req bit (#1631)
vq mqb
2023-09-01 16:32:08 -07:00
Justin Newberry 62bb0c2e33
Subaru: gen2 long safety (#1594)
gen2 long safety
2023-09-01 13:08:04 -07:00
Jason Wen afb241ab1c
Safety: Convert message addresses from decimal to hexadecimal (#1623)
* Safety: Convert message addresses from decimal to hexadecimal

* unit tests

* fix

* In another PR
2023-08-31 20:12:59 -07:00
Justin Newberry ef1a9338a1
Chrysler: check steer bit (#1628)
* chrysler

* misra
2023-08-31 16:01:16 -07:00
Justin Newberry fbe81a1753
GM: check steer req bit (#1629)
for gm
2023-08-31 16:01:05 -07:00
Justin Newberry f4d0904d94
Subaru: preglobal check steer req bit (#1626) 2023-08-31 14:26:51 -07:00
Igor Biletskyy 3efa31a804
F4: fix GMLAN clocks (#1624)
* init

* misra
2023-08-31 09:55:12 -07:00
Igor Biletskyy f89207328b
F4: fix wrong PCLK value (#1608)
* fix mistake

* clean
2023-08-31 09:35:25 -07:00
Justin Newberry e30ba9547c
Subaru: add steer req bit test (#1613)
add active bit test
2023-08-30 01:29:27 -07:00
Jason Wen e6c1648835
Hyundai CAN-FD: Alternate `LKAS` steering message (#1504)
* new steering message!

* fix

* check tx

* fix var

* allow all tx to test LFA suppression

* Attempt to block laneline information to suppress LFA

* Try 0x364

* Block all bus 2/6 messages

* Final test to block LFA

* Fix tx

* in another PR

* cleanup

* lint

* Add new tx to unit test

* linter

* Apply suggestions

* Revert to this

* Unnecessary

* clean up

* rename to hda2

* prototype

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-29 23:40:14 -07:00
Jason Wen 48632d9e0b
Hyundai CAN FD: fix boolean types in fwd hook (#1620)
* Safety: Utilize boolean values for message block checks in forward hooks

* Revert "Safety: Utilize boolean values for message block checks in forward hooks"

This reverts commit ee9809dbd3.

* others

* Revert "others"

This reverts commit f64cc1c76a.

* just do hyundai

* function to get steering address

* unclear if this is cleaner

Revert "function to get steering address"

This reverts commit 2a2b972a20.

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-29 20:23:41 -07:00
Igor Biletksyy d41a0abef6 H7: comments for RAM organization reasoning 2023-08-29 16:10:50 -07:00
Igor Biletskyy 91d457cbb1
H7: reorganize RAM (#1619)
init
2023-08-29 13:04:27 -07:00
Igor Biletskyy 687e9feeb1
H7: decrease FDCAN TX FIFOs to 1 (#1614)
init
2023-08-29 13:04:20 -07:00
Shane Smiskol ca9d8675b9
Revert "Toyota: ACC message relay check (#1612)" (#1617)
This reverts commit 5a9d8cfaaf.
2023-08-28 23:18:42 -07:00
Shane Smiskol 5a9d8cfaaf
Toyota: ACC message relay check (#1612)
* toyota: add safety for tester present

* block ACC_HUD

* check stock ECU

* clean up

* not this

* test new addr

* comment

* rm

* cmt
2023-08-27 15:43:59 -07:00
briskspirit f7a1daab74 jungle: force CAN core reset on bus off detection 2023-08-25 17:58:10 -07:00
Shane Smiskol cca252c8d4
Honda: match openpilot button enable check (#1607)
* NONE -> not BUTTON

* update test and fix safety

* cleaner
2023-08-25 16:11:08 -07:00
Igor Biletksyy 8ed82d3899 jungle: fix can_health update on request 2023-08-25 15:42:39 -07:00
Adeeb Shihadeh 09cd81752d
python lib: close USB context properly (#1606)
* python lib: close USB context properly

* fix jungle

* rm that

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-08-24 19:15:37 -07:00
Igor Biletskyy 0a32b17513
H7: few more Kb of RAM found (#1605)
* init

* remove discard
2023-08-24 16:56:31 -07:00
Igor Biletskyy 737030a8a5
F4: fix UART clocks (#1588)
init
2023-08-23 15:38:59 -07:00
Igor Biletskyy c3c8d8f5de
peripherals.h clean and duplicates removal (#1599)
* init

* ULPI disable

* not related to clocks
2023-08-23 15:17:06 -07:00
Justin Newberry 04df95db1c
Subaru: add new angle LKAS message definitions (#1602)
* just add the lkas message to start

* added to tests too

* default parameter
2023-08-23 13:17:36 -07:00
Igor Biletskyy ee2f9dfd9c
H7: clean up peripherals.h (#1597)
init
2023-08-23 10:22:38 -07:00
Justin Newberry 3d91d78018
Revert "Subaru: infrastructure to support the new angle based control… (#1601)
Revert "Subaru: infrastructure to support the new angle based controllers (#1590)"

This reverts commit ea16a54166.
2023-08-22 17:30:11 -07:00
Justin Newberry ea16a54166
Subaru: infrastructure to support the new angle based controllers (#1590) 2023-08-22 00:21:19 -07:00
Igor Biletskyy b47b8259ef
unify CAN/FDCAN odjects naming (#1596)
* init

* happy MISRA
2023-08-21 16:09:31 -07:00
Jason Wen 1d874be2b7
Safety: unify `controls_allowed` with boolean (#1589) 2023-08-18 13:22:04 -07:00
Adeeb Shihadeh aed103d537 Revert "Subaru: gen2 long safety (#1587)"
This reverts commit 2ae2567d8d.
2023-08-17 15:58:45 -07:00
Shane Smiskol d916357a3c
body: set vehicle_moving (#1591)
* add vehicle_moving

* Update board/safety/safety_body.h
2023-08-17 15:51:42 -07:00
Justin Newberry 2ae2567d8d
Subaru: gen2 long safety (#1587)
* setup proper safety for gen2 long

* whitespace

* misra

* alt bus

* high beam assist

* better names

* whitespace

* whitespace

* whitespace
2023-08-17 01:32:34 -07:00
Shane Smiskol 1f475a8aff
Hyundai: match openpilot standstill check (#1586)
* checks that we can replicate in openpilot

* clean up

* fix test

* can simplify this

* can also simplify this
2023-08-16 23:51:07 -07:00
Justin Newberry 02bcd14376
Subaru: cleanup to prepare for angle controller (#1585)
cleanup prepare for angle
2023-08-16 12:40:29 -07:00
Shane Smiskol b25810670e
Hyundai CAN FD: fix PCM cruise check (#1584)
* add pcm

* fix

* NA

* explicitly check cruise status

* comment and misra
2023-08-16 00:08:07 -07:00
Justin Newberry 8bd3e93813
Subaru: Global gen1 longitudinal safety (#1500)
* Add subaru long TX and RX messages

* misra c2012 fix

* fix tests

* Reorder signals

* increase max steering torque

* merge fix

* merge fix, remove cnt from test

* Move subaru logitudinal behind flag, add safety test

* update subaru_longitudinal checks

* cleanup

* Add subaru longitudinal checks

* misra fix

* Add subaru rpm and throttle rate limit checks

* temporary disable cruise throttle and cruise rpm checks

* update subaru long test

* update longitudinal safety and add tests

* fix tests

* fix misra

* subaru long signals limits checks

* Add controls_allowed to long tests

* remove unused variables

* Add AEB passthru and tests

* Add bus

* Update AEB logic

* Add GEN2 AEB support

* syntax fix

* Update AEB tests

* Add comment for subaru_aeb

* Do not check cruise_throttle and cruise_rpm limits when gas pressed

* use long limits struct

* Subaru: longitudinal checks only when controls_allowed, use ES_LKAS_State LKAS_Alert for AEB

* fix misra, set controls_allowed for es_brake test

* fix misra

* Fix es_brake violation check

* Add 0x323 to longitudinal test

* Remove stock fcw from aeb signals

* Use GET_BYTES

* Revert "export FW_PATH"

This reverts commit 2a5058d858.

* Revert "cleanup fw filename conventions (#1434)"

This reverts commit 4dd2735e38.

* Revert "Revert "export FW_PATH""

This reverts commit 86e8d321d0.

* Revert "Revert "cleanup fw filename conventions (#1434)""

This reverts commit 5aae6716fa.

* cleaned up safety

* cleanup subaru long safety

* subaru_aeb -> stock_aeb for other platforms

* fix unittests

* pretty

* need to upload this route

* remove AEB stuff for now

* remove unrequired rpm checks

* add comment

* added comment about acceleration and use throttle limit for rpm too

* inactive_throttle_fix

* Update board/safety/safety_subaru.h

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* added comments about long limits

* increase max brake

* revert that

* cleanup

* rename throttle to gas

* add safety replay

* remove todo

* rename throttle to gas

* move subaru stuff out of common test

* PR cleanup

* added min gas

* reduce initial complexity by not intercepting cruisecontrol or brake_status

* create common gas brake safety test

* remove unrelated subaru reference

* also test below min_value

* fix fwd hook test

* better name and hardcoded

* use same as acceleration limits

* revert gm

* remove callable

* also limit rpm

* remove safety replay for now

* revert unrelated changes

* pr cleanup

* remove unused gasbrake safety test

* fix ruff linter

* PR cleanup

* pr cleanup?

* added common brake test and moved generic test to base safety class

* remove duplicate test

* wip

* wip

* rename longitudinalaccelsafety

* revert limits correct test

* fix controls allowed test

* move gm over to long gas brake test

* assert that limits are reasonable

* fix typing

* fix linter again

* fix linter again

* fix linter again

* like to make it clear

* typo

* fix from merge

* clearer names

* dont need thesemore

* subaru: use common test

* fix merge issue

* inactive gas from long limits

* fix tests

* linter

* fix gen2

* fix linter

* also test torque when doing long control

* renamre transmision rpm

* consistent whitespace

* rename declarations too

* rename transmission rpm

* same line

* actually is transmission rpm

---------

Co-authored-by: Martin Lillepuu <martin@mlp.ee>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-15 18:51:13 -07:00
Justin Newberry f4e63e7da5
Safety: Rename alt transmission rpm (#1583)
* renamre transmision rpm

* consistent whitespace

* rename declarations too
2023-08-15 17:25:44 -07:00
Igor Biletskyy ab70a3c867
jungle: add pin header control (#1581)
* init

* style

* clean + gpio output
2023-08-14 19:38:38 -07:00
Justin Newberry 4ea50fbb09
Ruff: propgate config from OP (#1579) 2023-08-14 12:52:02 -07:00
Justin Newberry 05295dc42a
Safety: alternate longitudinal limits (#1577)
alt limits
2023-08-12 19:34:53 -07:00
Justin Newberry a0344a11e7
Subaru: cancel safety (#1576)
* subaru cancel safety

* misra
2023-08-12 17:16:28 -07:00
Igor Biletskyy 413f430f4e
jungle: add back set_can_sinent() (#1571)
init
2023-08-10 16:25:56 -07:00
Igor Biletskyy 83c000e1a4
panda: disable transceivers while doing CAN multiplexing (#1556)
init
2023-08-07 12:24:16 -07:00
Justin Newberry 5801582baf
Subaru: convert measured angle to centigrees (#1567)
convert to centigrees
2023-08-07 09:29:34 -07:00
Adeeb Shihadeh 3dc3b58e20
ruff: enable bugbear checks (#1565) 2023-08-06 14:59:22 -07:00
Adeeb Shihadeh 33a95d6bea
pedal: fix warning on invalid serial (#1563)
* pedal: fix warning on invalid serial

* fix

* fix:

* shouldn't need that

* fix

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-08-06 13:47:37 -07:00
Adeeb Shihadeh c66b98b2a6
finish esp/gps removal (#1559) 2023-08-06 12:29:54 -07:00
Robbe Derks d2d207b88d
In-circuit debugging (#1560)
* openocd script and readme

* do not disable SWD on boot
2023-08-05 16:04:09 -07:00
Igor Biletskyy 3e21991ce2
jungle: disable transceivers while doing CAN multiplexing (#1555)
* init

* keep unneeded trans off

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-08-04 22:47:10 -07:00
Adeeb Shihadeh 6e1d35b033
more complete jungle reflash (#1557)
* more complete jungle reflash

* no spi!

* mv flash

* mv that
2023-08-04 21:51:09 -07:00
Justin Newberry 2a72404ccb
Subaru: Add measured steering angle and vehicle speed (#1528)
* correct vehicle speed and add measured angle

* misra

* misra

* common test for angle

* PR cleanup

* use subaru prefix

* clean it up a bit

* minimize whitespace diff

* need float for deg_to_can
2023-08-04 17:16:35 -07:00
Adeeb Shihadeh 43bde4138d
jungle: SBU provisioning tests (#1553)
* jungle: SBU provisioning tests

* update can_send

* cleanup

* fix misra

* space
2023-08-04 14:28:23 -07:00
Adeeb Shihadeh 1950ba6f83 cleanup bus count constant 2023-08-04 10:47:03 -07:00
Adeeb Shihadeh 977d702770
cleanup old pedal stuff (#1552) 2023-08-04 10:40:53 -07:00
Adeeb Shihadeh d7120be904
panda jungle (#1547)
* mv jungle

* match pedal style

* fix linter

* fix fw path

* fix paths

* safety!
2023-08-03 23:55:13 -07:00
Adeeb Shihadeh 5af25e2a67 fix paths when building with different SConstruct 2023-08-03 22:24:20 -07:00
Adeeb Shihadeh f37f8d90ba
cleanup build, prep for jungle (#1549)
* cleanup build, prep for jungle

* cleanup

* update pedal obj path
2023-08-03 19:07:41 -07:00
Shane Smiskol 3e429ac0f8
Honda: remove duplicated relay transition time check (#1544)
already checked
2023-08-02 21:09:09 -07:00
Justin Newberry 1154eb2d75
Subaru: cleanup panda logic (#1543)
cleanup subaru
2023-08-02 15:13:01 -07:00
Robbe Derks feef2e6c71
Harness tick at 8Hz (#1541)
harness tick at 8Hz

Co-authored-by: Comma Device <device@comma.ai>
2023-08-01 21:31:15 -07:00
Robbe Derks b4700a876f
Stable ADC on H7 (#1540)
* 256x oversampling

* reduce to 128x

* fix misra

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-08-01 20:48:10 -07:00
Robbe Derks a945053ade
Force relay drive (#1539)
force drive

Co-authored-by: Comma Device <device@comma.ai>
2023-08-01 16:33:34 -07:00
Adeeb Shihadeh 7f1944cf43
debug endpoint for custom clock source period (#1538)
* debug endpoint for custom clock source period

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-08-01 16:17:42 -07:00
Adeeb Shihadeh ed8ff7e48a
H7: explicitly disable GMLAN for now (#1532) 2023-07-24 15:01:19 -07:00
Adeeb Shihadeh 8258d18e87 spi: bump version 2023-07-20 11:15:01 -07:00
Justin Newberry 72032e2850
Subaru: use generator for limits (#1527)
* generator

* remove torque reference

* fix misra

* misra
2023-07-19 23:32:31 -07:00
Adeeb Shihadeh b2741013f6
instructions for flashing internal panda (#1521)
* instructions for flashing internal panda

* Update board/README.md
2023-07-17 20:17:18 -07:00
Adeeb Shihadeh e8da4eab2e SPI: increase buffer size on H7 2023-07-16 12:56:05 -07:00
Cameron Clough 0c33554624
Ford CAN FD safety (#1455) 2023-07-16 15:09:37 +01:00
Cameron Clough 6e5009125a
Ford: namespaced constants (#1516) 2023-07-16 12:13:09 +01:00
Igor Biletskyy a9a3227008
can_health: remove enter and exit critical calls from health updater (#1513)
init
2023-07-14 19:36:04 -07:00
Igor Biletskyy ad9ec716ac
H7: CAN core reset on no ACK and high transmit error counter (#1502)
* init

* comment
2023-07-14 19:00:43 -07:00
Justin Newberry 6d2b70a147
Subaru: Use macros for gen1/gen2 (#1505)
* macro

* revert these for first PR
2023-07-13 19:01:45 -07:00
Adeeb Shihadeh 6b9b448259
log device boot time (#1503)
* log device boot time

* misra

* only log real boots

* set gpio

* true

* initial

* log bootkick

* fix RPv2

---------

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Igor Biletksyy <bs@privacy.im>
2023-07-12 20:34:46 -07:00
Justin Newberry 8ba5683881
Subaru: improve readability in panda code (#1380)
* improve readability

* cleanup for PR

* switch to #define

* i guess i forgot how #define works

* fix #define

* improve for preglobal too

* rename because of conflicts

* rename with subaru in name

* missed some

* missed that one too

* made it pretty

* whitespace

* infotainment match opendbc

* whitespace

* whitespace

* parameterize the bus too

* fix that

* fix misra violation

* multiline

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-07-07 01:48:30 -07:00
Shane Smiskol c1e79333fb
angle safety: make angle conversion factor a float (#1498)
* make this a float

* no need to cast to float now
2023-07-06 17:06:31 -07:00
Shane Smiskol c97f572208
safety_toyota: use GET_BIT (#1496)
* use GET_BIT

* same for gas pressed

* brake pressed too

* fix

* another fix
2023-07-06 15:31:40 -07:00
Adeeb Shihadeh a687b183ee
SPI: update max IRQ rate (#1493) 2023-07-03 22:06:35 -07:00
Adeeb Shihadeh 14fd5ff5a3
SPI: send bootstub status in version request (#1492)
* mv first

* switch to crc8

* bootstub

* test

* cleanup

* little more

* misra

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-07-03 15:23:12 -07:00
Adeeb Shihadeh d693e89df2
SPI: send hw type with version (#1490)
Co-authored-by: Comma Device <device@comma.ai>
2023-07-02 23:50:30 -07:00
Adeeb Shihadeh abcbfb44b4
SPI: send serial with protocol version (#1489)
* SPI: send serial with protocol version

* misra

* fix test

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-07-02 23:13:57 -07:00
Adeeb Shihadeh 5abb2b58da
SPI: add protcol version request (#1488)
* SPI: add protcol version request

* quick test

* fix linter

* misra

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-07-02 15:51:35 -07:00
Adeeb Shihadeh 1f50a84b86
update old comment (#1282) 2023-07-01 18:57:53 -07:00
Robbe Derks 694aae9c26
Faster log retrieval (#1484)
improve get_logs
2023-06-30 17:26:39 +02:00
Igor Biletskyy a35e9a1edb
CAN health: add IRQ call and core reset counters (#1453)
* initial

* old method

* comment
2023-06-28 14:40:00 -07:00
Igor Biletksyy 8a8bcb865e H7: clear irqs on reset 2023-06-28 12:39:47 -07:00
Igor Biletskyy 73798d7dce
Disable CAN irqs when transceivers are disabled in power save mode (#1485)
init test

MISRA 15.7
2023-06-28 12:33:17 -07:00
Igor Biletksyy 3a06eeec3c bxCAN: check overrun flag on error irq 2023-06-27 16:03:43 -07:00
Justin Newberry b2cf197679
Subaru: Signals Cleanup (#1470)
cleanup
2023-06-23 21:00:59 +01:00
Igor Biletskyy 5889e3784f
H7: fix FDCAN_IR register check (#1480)
* init

* typo

* misra

* leftover
2023-06-21 18:56:10 -07:00
Igor Biletskyy 9d56e80390
Change can_health request method (#1472)
* init

* fix typo

* remove tx lost as fake and add rx lsot
2023-06-20 12:29:20 -07:00
Igor Biletskyy 0f4e8f79f5
add IRQ rate helper function (#1471)
init
2023-06-20 11:47:43 -07:00
Adeeb Shihadeh 58b80f3b77
H7: adjust SPI IRQ call rate (#1469)
* H7: adjust SPI IRQ call rate

* u

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-06-19 20:44:02 -07:00
Adeeb Shihadeh fdd898bd08
H7: split SPI/DMA faults (#1466) 2023-06-16 21:54:28 -07:00
Cameron Clough 55ef91d9ab
Ford: don't check vehicle roll quality flag (#1461) 2023-06-17 01:11:21 +01:00
Robbe Derks 054344de6b
Flash bounds checking outside of bootstub (#1459)
* add bounds checking on flash operations outside of bootstub

* fix test
2023-06-14 15:28:49 +02:00
Robbe Derks 116485443d
UART overwrite mode (#1457)
* overwrite mode

* typo
2023-06-14 13:33:47 +02:00
Igor Biletskyy 3a7a0e0bae
H7: fix lockup on disconnected bus (#1431)
* fix h7 lockup

* love MISRA!

* EW and EP isn't actual errors

* cleaner

* typo

* oops

* increase error limit before reset
2023-06-13 14:34:15 -07:00
Robbe Derks 0cc91a7f7b
Logging (#1445)
* try 1

* some fixes

* fix some misra

* first poc working

* more things

* more misra fixes

* fix misra

* add rate limiting

* fix misra

* add some unit tests through libpanda

* add more tests and fix some stuff

* fix misra again

* add startup log hitl test

* list

* don't fail on wrong timestamps

* improvements

* fix tests

* expected logs test?

* not sure why this passed

* oh, it doesn't reset

* only show last few

* guess at expected logs

* needs this

* ugh

* reduce compiler warnings

* adjust expected logs

* this is correct

* is it really 1?

* min max

* reduce spam in SPI test

* some cleanup
2023-06-13 17:00:56 +02:00
Adeeb Shihadeh 237f5bd6e4
fix debug console spam during IRQ call rate fault (#1448)
* fix debug console spam during IRQ call rate fault

* flip

* fix build
2023-06-08 11:31:50 -07:00
Adeeb Shihadeh bf2c007103
H7: fix CAN RX delay (#1446) 2023-06-06 18:48:19 -07:00
Adeeb Shihadeh 17ca4171df
H7 SPI: disable IRQs only when necessary (#1437)
less irq disable

Co-authored-by: Comma Device <device@comma.ai>
2023-06-03 15:53:16 -07:00
Robbe Derks 5847d7dbc0
Tesla safety: fix wrong message rate (#1277)
* half the freq, double the rate

* fix test

* fix names
2023-06-01 23:10:36 +02:00
Adeeb Shihadeh c898ec7ce8
refresh can tx slots available after write (#1432)
Co-authored-by: Comma Device <device@comma.ai>
2023-05-20 22:00:13 -07:00
Adeeb Shihadeh 52f96bac68
spi: nack on can tx endpoint if buffer is full (#1426)
* spi: nack on can tx endpoint if buffer is full

* handle in python lib

* fix timeout

* fix timeout

* fix linter

* cleanup

* fix

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-05-19 22:43:34 -07:00
Shane Smiskol 2a53833753
Ford safety: prevent disable AEB (#1428)
* Ford AEB safety

* whoops

* working tests

* debugging

* clean up

* stock aeb test

* split up test

* rm

* cmt

* rm

* just test stateless sigs for simple branch

* clean up

* rm

* just test this bit

* it's signed now

* cmt

* cmt

* clean up

* ohh
2023-05-18 14:14:26 -07:00
Igor Biletskyy 622106d7d4
Revert "H7: fix lockup on disconnected bus" (#1430)
Revert "H7: fix lockup on disconnected bus (#1410)"

This reverts commit 03435947bb.
2023-05-18 13:54:30 -07:00
Shane Smiskol 14bd994f83
Ford: add longitudinal safety (#1359)
* add ACCDATA msg

* ford long safety

* long flag

* split stock and op long tests

* use accel limits for brake

* add comment

* fix acceleration limits

fix acceleration limits

* fix gas limits

* temp bug

* fix min gas, allow -0.5 (engine braking?)

* fix test

* fix tests

* yay it caught this

* pylint

* base name

* typing

* Revert "typing"

This reverts commit 7fb5e304cb.

* temp fix

* rm line

* this is handled by PandaSafetyTest

* revert

* move

---------

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
2023-05-18 00:21:29 -07:00
Adeeb Shihadeh 2ed514807e
H7: restart SPI peripheral between transfers (#1424)
* H7: restart SPI peripheral between transfers

* fix misra

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-05-17 20:59:37 -07:00
Adeeb Shihadeh a93bc954c5
SPI HITL tests + cleanup (#1417)
* start comms hitl tests

* pull that out

* revert that

* more test

* fix warnings

* fix linter

* another simple case

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-05-17 17:13:12 -07:00
Shane Smiskol 3c9d277276
safety: always allow inactive gas command (#1418)
* always allow inactive gas

* rewrite this

* revert

* no functional change but test it correctly

* also here
2023-05-17 15:52:50 -07:00
Justin Newberry 0a738b7ee8
Subaru: rename legacy to preglobal (#1415)
* rename

* missing some variables

* fix find/replace error
2023-05-15 17:22:40 -07:00
Adeeb Shihadeh f95f4a5294
stricter simple watchdog (#1413) 2023-05-15 14:15:48 -07:00
Igor Biletskyy 03435947bb
H7: fix lockup on disconnected bus (#1410)
* fix h7 lockup

* love MISRA!

* EW and EP isn't actual errors
2023-05-12 19:20:42 -07:00
Robbe Derks 1e131f2b17
RX/TX lost reversal for bxcan (#1408)
this should be reversed
2023-05-11 17:21:34 +02:00
Adeeb Shihadeh 98a15f2a90
harness: fix register divergent on GEN1 (#1405)
* harness: fix register divergent on GEN1

* has harness

* revert that

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-05-08 15:02:18 -07:00
Adeeb Shihadeh 2eef7f3fff reset heartbeat_engaged once heartbeat is lost 2023-05-08 10:15:31 -07:00
Robbe Derks 2c937656cf
Continuous harness detection (#1402)
* read in mV and make threshold board-dependent

* refactor and add SBU voltages to health

* refactor relay driving

* more refactoring and readout lock

* avoid race condition

* fix misra

* continuous detection

* 1Hz is fine

* another race condition

* use harness detection to trigger bootkick

* update orientation detection test

* more in-depth harness tests

* fix ignition

* fix

* raise threshold
2023-05-08 13:30:23 +02:00
Shane Smiskol 35609dfdce
safety utils: add ROUND helper (#1397)
* add round macro

* Update board/utils.h

* function

* one line

* misra

* use here too
2023-05-06 21:25:25 -07:00
Adeeb Shihadeh e7f2e72c3d
setup independent watchdog (#1404)
* setup independent watchdog

* builds

* same file

* configurable timeout

* disable for now

* no feed

* rm

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-05-05 16:46:38 -07:00
Robbe Derks fea1feb598
ADC cleanup (#1401)
* cleanup function names

* cleanup voltage reading

* define constant

* fix misra

* remove comments
2023-05-04 13:22:01 +02:00
Shane Smiskol cedb5fd1a6
Ford: remove safety mode from debug flag (#1400)
remove from debug
2023-05-04 06:08:10 +00:00
Shane Smiskol 94cd9a0788
Ford: curvature rate limits (#1258)
* ford curvature rate limits draft

* make common angle tests work with curvature

* comment

* no need for this

* extra line

* fix test

* generic curvature test class

* more reasonable limits

* adjust limits

* draft

* works

* works

* clean up

* add vehicle speed

* works

* clean up

* clean up

* more clean up

* more clean up

* lower

* double

* add updated bp

* remove

* can clean that up

* draft

* this works!

* think that's the correct placement

* try this

* closer

* use min

* add/sub one to not falsely trip

* remove old angle error safety

* i'm not sure if clamp is more readable

* fix that

* fix

* stash

* fix these tests

* ternary

* floats are a pain

* draft, works kinda

* even better

* round that

* need tolerance

* this should work (adding tol=1 wouldn't let us have multiple rate limits)

* test works

* clamp breaks if low is higher than high :(((

down from 150 blocked msgs to 7!

* no blocked msgs!!!

* test a whole bunch

* stash

* stash

* clean up test

* clean up test to be more like torque (+ speeds)

* clean up

* cmt

* test up

* up and down are good

* rename and remove

* this is tested

* uncomment

* this is tested by ensuring we move towards error at a minimum rate

* not used any more

* revert common

* clean up test_ford a bit more

* some clean up (combine variables where it makes sense)

* yeah can't use clamp since min isn't always < max, min(max(.. handles this

* clean up

* revert that

* comments

* cmt

* another

* that's old

* misra!

* Update board/safety/safety_ford.h

* Update board/safety/safety_ford.h

* add todo, fix test case

* more clear, matches panda

* add comment

* Update tests/safety/test_ford.py

* more fine speed increments

* rm comment

* better names

* this is expected behavior (tested by common checks)

* CURVATURE_ERROR_LIMIT_SPEED

* better name?

* pretty clean!

* same for up

* only used in one place now

* these are now clear

* common term

* make vehicle_speed a sample_t

* need to use values[0]

* speed is a float

* Revert "speed is a float"

This reverts commit 01af02f1d3.

* Revert "need to use values[0]"

This reverts commit 8f6d68345a.

* Revert "make vehicle_speed a sample_t"

This reverts commit ecd8dc86b6.

* safety fixes for new speed sample

* test fixes for new speed sample

* fix misra and make intermediate variable

* this isn't needed
2023-05-04 04:59:35 +00:00
Shane Smiskol 3a64b6ccb5
safety: make vehicle_speed a sample (#1391)
* convert vehicle_speed into sample_t, change no behavior

* draft

* round

* test

* clean up

* round

* round all

* use min

* remove round macro from this PR

* reset speed measurement

* debug

* bbd

* rm

* revert

* test above and below

* need this now

* misra pt 1

* misra pt 2

* misra pt 3

* i don't understand this one, not different from other cases

* fix test

* test

* revert that

* draft

* test the sample_t works properly for safety modes that use it (angle only)

* can combine these tests

* test decimals

* global

* misra

comment

* suggestions

* fix

* use new helper
2023-05-04 03:37:56 +00:00
Shane Smiskol aa30b15de5
Ford safety: more clear variable names (#1392)
* that's a better name

* that too
2023-05-03 03:45:33 +00:00
Shane Smiskol 69ad3dd8e8
angle safety: add comment about rate limits at 0 (#1389)
* up when 0

* Revert "up when 0"

This reverts commit fc9b459651.

* add comment

* whoops
2023-05-03 00:07:23 +00:00
Robbe Derks 641d9c4f3a
Tesla: DAS_control is on bus 2 (#1374)
these are on bus 2
2023-05-02 00:55:00 -07:00
Adeeb Shihadeh 8e1ca608b0
H7: remove busy wait on TXC (#1381)
* works

* cleanup

* less irq

* less diff

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-05-01 20:18:23 -07:00
Shane Smiskol dbe941004a
safety: reset torque_meas on init properly (#1250)
* reset min torque meas too

* add test that fails

* cmt

* cmt

* clean up test

* don't be random

* above test tests this pretty much

* test angle too

* fix

* also test driver torque

* whoops

* whoops
2023-04-28 17:45:02 -07:00
Shane Smiskol 001f9917ef
ford: disable counter check for second speed (#1375)
add comment and disable counter for second speed
2023-04-28 14:25:35 -07:00
Shane Smiskol 4160d8d71c
safety: common angle safety function (#1369)
* draft clean up

* always check

* add angle to name

* ford sends curvature when not steering and bit is 0.

it's not torque, curvature of 0 will still apply torque

* need this to be generic

* formatting

* rm

* test that we can send curvature=0 if enabled=False while control_allowed=True (let's say EPS faults, OP doesn't want to actuate)

* revert ford tests to master

* this <i>should</i> preserve behavior

* this is fine to remove

* and this should also be covered

* yeet

* change opt name, combine checks, much better!

* one more

* modes

* Add comment

* misra has a bug :(

* ugh

* make this clear

* ?

* order

* fix

* comments
2023-04-27 23:33:54 -07:00
Shane Smiskol 69a0b6ed34
safety: use max_limit_check helper in angle safety (#1373)
* better

* ?

* ?

* Revert "?"

This reverts commit ae70c7ff3b.

* Revert "?"

This reverts commit db7fd644a9.
2023-04-27 23:19:26 -07:00
Shane Smiskol aac46a2ef2
angle safety: enforce disabled angle when not steering (#1372)
* enforce disabled angle when bit not set, below we enforce bit to be 0 when not controls allowed

* test

* other test

* combine tests

* comment
2023-04-27 21:41:38 -07:00
Shane Smiskol 240370cdd1
ford: allow 0 curvature when controls are allowed if not steering (#1370)
* test that we can send curvature=0 if enabled=False while control_allowed=True (let's say EPS faults, OP doesn't want to actuate)

* draft

* only check error if apply bit is 1

* subtest

* no subtest

* fix safety and tests

* tests say this works

* clean up

* subtests are sloww

* Revert "subtests are sloww"

This reverts commit 560c6745c8.

* fix test from merge

* add comment

* add comment

* add another comment

* spacing
2023-04-27 17:44:32 -07:00
Shane Smiskol c9c3cb38f6
Ford safety: curvature error limit (#1353)
* set ford vehicle speed

* parse yaw rate signals

* misra

* misra

* misra

* misra

* draft

* update module

* already checked

* and set it properly

* some stuff

* draft

* clean up (will fail tests because we don't send yaw rate yet)

* could do something like this

* this is better and less prone to bugs

* match simple op limiting, debugging

* set checksum for messages in tests

* clean up

* fix that

* one m/s fudge

* fix sign of yaw rate

* interpolate detects size

* forgot OP flips the curvature sign. it matches yaw on can

* all my debugging crap

* make replay work for ford

* fix panda blocking messages (array is fixed size so size-1 is 0 rate at high speed)

* uncomment safety test limits

* revert

* round for zero blocked msgs

* fix limits

* meas safety checks that down rate is >=, not <

* test pass

* lots of comments and draft what one meas torque check would look like

* fix that

* add curvature meas

* add debugging stuff

* Revert "add debugging stuff"

This reverts commit 449783fc62.

* messy but at least one test passes now

* draft

* add max_steer

* some safety clean up

* and that

* start with a test that works

* another test that works (sort of, we need more strict panda safety without false positives)

* no max curvature check (not safety related), allow any rate limits

* add new function

* also need to consider max val here, since OP will send up to that

* and now use the function

* lower to 10

* compilation fixes

* clean up (no rate limiting)

* remove that too

* curvature diff test

* more clean up

* debug

* ?

* better names

* more official

* use _curvature_meas_msg_array here

* bit faster

* no i don't

* revert that

* why not just use angle_meas?

* bb ll

* bb deb

* clean up debug vals

* more

* revert replay drive debugging changes

* Update board/safety.h

* rm line

* only need to round the final thing

* not needed, under 10 ms

* make a class variable

* fix a misra?

* another misra?

better

* ?

* 12.1

* need to explicitly convert

* add one to not false trigger the violation (float rounding)

* not really needed

* rm line

* cmt

* use clamp

* rename

* in struct

* comment

* use max_limit_check

* draft clean up

* Revert "draft clean up"

This reverts commit d1a0e8acd1.

* make a global

make a global

* this is fine
2023-04-27 00:40:29 -07:00
Shane Smiskol 4269b74a84
safety: use max_limit_check (#1368)
use max_limit_check
2023-04-26 23:55:04 -07:00
Adeeb Shihadeh 7aef934d4c
Fix undefined behavior in GET_BYTES macro (#1367) 2023-04-26 22:59:58 -07:00
Shane Smiskol f444f1554f
Ford: check second speed for mismatches (#1358)
* Add second speed

* 2.5 m/s is 9 kph, 4 kph is the max in the field

* add quality signal

* qf signal name

* comment

* checksum matches except it goes to zero when turning the car off despite counter still active

* update comments

* now test it

* spacing

* Update board/safety/safety_ford.h

* zzzz

* not needed

* whoops

* test vehicle state mismatch

* add to safety_helpers

* probably misra

* we might want to check it in both speed signals in case one doesn't exist on a car

* Revert "we might want to check it in both speed signals in case one doesn't exist on a car"

This reverts commit 3338931409.

* fix formatting

* 2 m/s (7 kph)

* set controls_allowed directly like other safety models

remove vehicle_state_mismatch

* obv
2023-04-26 22:37:36 -07:00
Shane Smiskol 5c21b14049
Ford: check 2nd speed message (#1365)
* Add second speed

* 2.5 m/s is 9 kph, 4 kph is the max in the field

* add quality signal

* qf signal name

* comment

* checksum matches except it goes to zero when turning the car off despite counter still active

* update comments

* now test it

* spacing

* Update board/safety/safety_ford.h

* zzzz

* not needed

* whoops

* test vehicle state mismatch

* add to safety_helpers

* probably misra

* we might want to check it in both speed signals in case one doesn't exist on a car

* Revert "we might want to check it in both speed signals in case one doesn't exist on a car"

This reverts commit 3338931409.

* fix formatting

* 2 m/s (7 kph)

* revert mismatch stuff
2023-04-26 21:49:39 -07:00
Shane Smiskol 048ddeea4a
safety: make addr index getter more explicit (#1361)
make this explicit
2023-04-26 21:15:55 -07:00
Shane Smiskol f3d6d613c0
safety: don't check out of bounds array item (#1360)
* safety: don't check out of bounds array item

* better name

* cleanup

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-04-26 19:43:30 -07:00
Adeeb Shihadeh b342c2d724
fan: add stall threshold backoff (#1357)
* fan: add stall threshold backoff

* Update board/config.h

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-21 15:41:26 -07:00
Adeeb Shihadeh 272b81e97b
fan: fix stall detection (#1351)
* cleanup and fix

* dos must stall

* clean those up

* fix misra

* more test

* fix import

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-20 15:44:12 -07:00
Adeeb Shihadeh 6093301bc9
add CLAMP macro (#1356)
* add CLAMP macro

* fix
2023-04-20 14:34:11 -07:00
Adeeb Shihadeh 3c75a8bc00
add fan stall count to health (#1355)
* add fan stall count to health

* fix misra

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-20 13:30:56 -07:00
Adeeb Shihadeh 0e2eb9c0f5
fan debugging script (#1354)
* fan debugging script

* merge those

* disable

* better print

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-20 13:00:40 -07:00
Adeeb Shihadeh e6cad01955
H7: fix CAN FD IRQ rate (#1332) 2023-04-19 17:34:31 -07:00
Robbe Derks 237ffedcb3
Dos fan fix (#1335)
* hitl fan test

* enable cooldown on dos as well

* small cleanup

* get expected RPM from panda class

* fix

* overshoot test

* fix max RPM getting

* fix percentage

* revert cooldown fix

* add cooldown for dos fan as well

* remove feedforward from the fan controller to eliminate overshoot

* update clip

* cleanup

* add that back

---------

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-04-18 14:15:06 -07:00
Justin Newberry 1f8b03666d
Subaru: add ability to send infotainment status message (#1333)
* added infotainment status to panda

* dont fwd infotainment status

* revert placeholder and add test case

* Fix test case

* gen2 only

* fix test case

* Revert "fix test case"

This reverts commit 8cc7579620.

* Revert "gen2 only"

This reverts commit 6a511a9976.

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-04-17 18:47:51 -07:00
Adeeb Shihadeh 2f79621893
improve flash and recover scripts (#1349)
* improve flash and recover scripts

* update references

* cleanup

* less spaces

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-16 15:08:46 -07:00
Jason Young 6ec078db5a
VW MQB: Cleanup HCA control message (#1310)
* VW MQB: Cleanup HCA control message

* update opendbc ref

* revert this before merging

* MISRA

* revert Dockerfile to comma master

* reverted a little too much
2023-04-15 11:34:42 -07:00
Shane Smiskol ada8b49cb5
Honda Bosch Radarless: allow alt brake (#1341)
* radarless can use this

* fix addr check

* update opendbc ref
2023-04-14 01:51:19 -07:00
Igor Biletskyy 0117ff9d13
H7: Rx FIFO lost counter (#1345)
* fifo rx lost counter

* add comment
2023-04-13 17:37:48 -07:00
Jason Young fddca54fd6
VW: Allow inactive accel values at all times (#1247)
* allow inactive accel values at all times

* cleaner

* unnecessary, done by default

* better comments

* move test to common class

* fix

* flip

* comment

* append 0 and INACTIVE_ACCEL to test accels + check acc_07 sends if inactive only

* cleanup

* fix that

* copy testing convention of VW and Honda

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-04-13 17:28:33 -07:00
Igor Biletskyy 0832d65347
Fix CAN message corruption on H7 under high load (#1342)
* fix RX FIFO corruption

* Add checksum to CANFD test data

* cleaner and MISRA

* nah

* oops

* fix test
2023-04-12 11:07:58 -07:00
Adeeb Shihadeh 85cc70d4aa
safety: only pass addr to fwd hook (#1339) 2023-04-08 16:45:59 -07:00
Adeeb Shihadeh 2a567674dc
Tesla: move reading AEB state to RX hook (#1340) 2023-04-08 16:20:38 -07:00
Adeeb Shihadeh 6f852b44a9
SPI: log checksum errors in health (#1334)
* SPI: log checksum errors in health

* actually send it

* check in hitl teardown

* check that

* fix misra
2023-04-05 22:05:14 -07:00
Adeeb Shihadeh e516a5752b
watchdog to log fault on heartbeat loop (#1328)
Co-authored-by: Comma Device <device@comma.ai>
2023-04-04 18:51:35 -07:00
Adeeb Shihadeh 0400ac28af
fake siren: fix false positive fault (#1327) 2023-04-03 20:48:26 -07:00
Robbe Derks 79708f912d
USB enumeration based on frame numbers (#1324)
* use frame numbers to detect host connection

* fix weird formatting

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-03 17:13:02 +02:00
Adeeb Shihadeh b6c378ad02
CI: set PYTHONWARNINGS=error (#1323)
* CI: set PYTHONWARNINGS=error

* update resetter

* fix build warnings

* bump jungle

* fix one more

* fix linter

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-04-02 09:33:35 -07:00
Adeeb Shihadeh cb35309160 spi tx timeout print 2023-03-31 14:39:30 -07:00
Adeeb Shihadeh 12b9b65985
fake_siren: add fault on codec enable failure (#1308)
* fake_siren: add fault on codec enable failure

* little shorter

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-03-29 15:07:12 -07:00
Vivek Aithal a1e1451d1c
GM: Reduce steer down limit and increase driver allowance (#1281)
reduce steer down limit and increase driver allowance
2023-03-29 10:39:25 -07:00
royjr db6c50cd09
Honda Bosch Radarless longitudinal safety (#1008)
* civic22_long

use long flag

* maybe?

* Update safety_honda.h

* revert the 0x1c8 addition

* init radarless safety check

* correct accel parsing

* add test class (WIP)

* remove current_controls_allowed

* Fix ACC_HUD

* patch

* Add missing safety to test name

* Pass irrelevant test

* move comment

* remove unused comments

* add comment to TestHondaBoschRadarlessSafety

* Fix message overlap

The "exceptions for common msgs across different hondas" fix does not seem to be working. Created another exception for TestHondaBoschRadarless based on the HondaNidec exception above

* Fix base

* remove comment

* remove buttons from LONG TX

* make a base Radarless test class

* can't remove them, since safety doesn't check bosch

* test accel limits

* test accel limits

* we can do the clean up in another pr

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: sshane <shane@smiskol.com>
2023-03-27 23:10:25 -07:00
Igor Biletksyy 01ea26e342 prevent host from setting wrong returned flag 2023-03-27 10:38:04 -07:00