Commit Graph

1401 Commits

Author SHA1 Message Date
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