Commit Graph

1113 Commits

Author SHA1 Message Date
Adeeb Shihadeh
80dac4cd94 cleanup CAN definitions (#1170) 2022-11-29 15:56:43 -08:00
Shane Smiskol
8accca13ad VW: explicitly test for inactive accel (#1167)
* explicitely test for inactive accel

* fix the safety

* and catch the mistake

* revert
2022-11-28 22:37:59 -08:00
Shane Smiskol
ba6b3710db GM: use common steering safety test (#1166)
gm is the last
2022-11-28 22:30:23 -08:00
Jason Young
e4c4253964 VW MQB: Redundant brake pressed signals (#1137)
* VW MQB: Redundant brake pressed signals

* bump timer for safety tests in CI

* use nicer f-string syntax

* don't need that
2022-11-22 14:27:52 -08:00
Adeeb Shihadeh
c075050d5d Revert "F4: cleanup clock source (#1160)"
This reverts commit f0f67ccf85.
2022-11-21 20:31:01 -08:00
Adeeb Shihadeh
15a945d303 tres: IR LEDs (#1163) 2022-11-17 21:23:35 -08:00
Adeeb Shihadeh
ae66bbcaa8 tres fan (#1162)
* fan on

* little cleanup

* move to main
2022-11-17 21:02:37 -08:00
Adeeb Shihadeh
3df9099660 Misc cleanup (#1161)
* unused python stuff

* green led

* docs cleanup

* little more
2022-11-17 11:46:43 -08:00
Robbe Derks
5aa5f855e4 setup UART for SOM debugging (#1151)
* cleanup external debug serial

* wip: bring up uart7

* more wip

* this does something

* this works

* increase fifo size

* fix misra

* cleanup

* fix misra again

* add SOM debug enum

* reduce SOM buffer on F4

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-11-17 17:59:11 +01:00
Adeeb Shihadeh
f0f67ccf85 F4: cleanup clock source (#1160)
* F4: cleanup clock source

* little more

* void
2022-11-17 07:49:26 -08:00
hoomoose
5dc5cd8e20 Hyundai: longitudinal support for all CAN-FD EV + Hybrid (#1128)
* Update safety_hyundai_canfd.h

* Update safety_hyundai_canfd.h

* Update safety_hyundai_canfd.h

* cleanup

* add test

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-11-15 14:48:45 -08:00
Adeeb Shihadeh
e7131fcee0 H7 SPI comms (#1158)
* getting health packets

* start cleanup

* pull state machine out

* cleanup
2022-11-14 13:52:52 -08:00
Robbe Derks
9db0ae7056 Remove external debug UART support (#1159)
cleanup external debug serial
2022-11-14 11:46:04 +01:00
Adeeb Shihadeh
c75c276301 add has_spi board property (#1153)
* always spi for h7

* disable for now
2022-11-13 19:57:20 -08:00
Shane Smiskol
c0632cd32b GM: enable on rising edge of resume (#1157)
* rising edge of resume

* fix test

* comment

* todo fix tests

* fix test

* we want to test the transition from btn prev to btn cur, not unpressed to x to y

* range
2022-11-13 19:10:45 -08:00
Shane Smiskol
0096d0c4fc GM: handle run-away set speed (#1156)
* Revert "GM: enable on rising edge of resume (#1155)"

This reverts commit 5aa33e1b2f.

* allow set/resume to any other button (except cancel)

* explicit test

* This is a test of both PRs combined

* Revert "This is a test of both PRs combined"

This reverts commit c7fdc3b00c12da64763c371f8cf017faa0273b1d.

* fix test
2022-11-12 01:55:41 -08:00
Shane Smiskol
ff48ecc34e Revert "GM: enable on rising edge of resume (#1155)"
This reverts commit 5aa33e1b2f.
2022-11-12 01:47:13 -08:00
Shane Smiskol
5aa33e1b2f GM: enable on rising edge of resume (#1155)
* rising edge of resume

* fix test

* comment
2022-11-12 00:01:15 -08:00
Igor Biletskyy
cc3b7d9470 H7: add comments on buses clocks (#1154)
comment
2022-11-11 15:30:37 -08:00
Shane Smiskol
d573111268 Hyundai: fix button enable controls mismatch (#1152)
* fix hyundai long button controls mismatch

* test

* comment
2022-11-11 14:43:35 -08:00
Adeeb Shihadeh
966f7e0539 SPI: fixes + fake bulk transfers (#1150)
* check spi checkusm

* ugh, fix control handler

* fake bulk xfer

* cleanup

* one more

* unused

* fix linter

* some typing

Co-authored-by: Comma Device <device@comma.ai>
2022-11-10 21:34:43 -08:00
Igor Biletskyy
a9e0357883 H7: enable USB LDO and fix RGB LED gpios (#1148)
* enable USB LDO

* open drain for RGB LED gpios

* naming

* comment
2022-11-10 19:29:44 -08:00
Igor Biletskyy
eae58b378b F4 CAN: fix SCE IRQ double fire (#1149)
fix
2022-11-10 19:29:22 -08:00
Robbe Derks
d574f4aebc STM32F4: SPI communications (#998)
* cleanup is_enumerated, rename comms and init spi

* big comms refactor, building now

* misra fixes

* more fixes

* misra try 3

* cleanup

* this belongs in a separate PR

* remove unneccesary file

* revert llspi changes

* llspi misra fix

* enable SPI on F4 and setup gpio

* duh

* wip: spi comms

* more spi wip

* dynamic sector erasing

* Revert "dynamic sector erasing"

This reverts commit fce1215a2ede45e5e2a0e97ca23a86c1d8bfa94a.

* more sectors to be erased

* debugging

* woah, this works

* cleanup on the panda side

* add sync and checksum checks, and fix recovery on errors

* this seems relatively stable

* add retrying

* this is stabler

* some endianness and endpoint fixes

* builds

* revert that

* add that back

* checksum start

* start splitting up driver

* spi behind flag

* cleanup test

* bump up timeout

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-11-09 18:46:20 -08:00
Shane Smiskol
281eb7731b GM Camera: use ECM brake pressed bit (#1138)
* GM camera: use ECM brake pressed bit

* back to ECMEngineStatus

* length 8

* common gmcamera class

* move to longitudinal base

* Revert "move to longitudinal base"

This reverts commit 67abe4c86b0e5e00432ab0ab80a8db6061f3cc3e.

* fix
2022-11-08 20:17:02 -08:00
Jason Wen
1ccdff90c5 HKG CAN-FD: support radar ACC cars (#1134)
* HKG: Car Port for Genesis GV70 2023

* Revert "HKG: Car Port for Genesis GV70 2023"

This reverts commit 01bfda6dff4d8d2de4fd9b485b3f352e3e038000.

* 0x1a0 rx check

* Wrong one oops

* Check 0x1a0 based on param

* no need

* getting a bit messy, clean up soon!

* clean up

* clean up

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-11-07 22:44:13 -08:00
Shane Smiskol
ca681ff829 Hyundai: CAMERA_SCC works on both safety modes (#1139)
* Make camera SCC work on both safety modes

* update in safety

* move to common
2022-11-07 22:13:17 -08:00
Jason Wen
f3fc343262 Hyundai CAN-FD: support for ICE cars (#1031)
* Hyundai: Car Port for Santa Cruz 2022

New struct and params for CAN-FD ICE models

fixup! New struct and params for CAN-FD ICE models

* Longitudinal Control: ICE CAN-FD models

* fixup! Longitudinal Control: ICE CAN-FD models

* fixup! Longitudinal Control: ICE CAN-FD models

* fixup! Longitudinal Control: ICE CAN-FD models

* fixup! Longitudinal Control: ICE CAN-FD models

* Gate radar disable behind HDA2 only

* Remove unnecessary HDA2 checks

* Fix MISRA violation

* not needed, in HYUNDAI_CANFD_HDA2_LONG_TX_MSGS

* revert longitudinal changes

* fix addr check logic, clean up

* revert more long stuff

* fix addr check

* temp

* tests

* work?

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-11-04 16:43:33 -07:00
Shane Smiskol
c8d108e2b8 Hyundai CAN-FD long: fix brake address check (#1132)
* we don't check 0x65 any more

* fix

* that too
2022-11-04 00:54:54 -07:00
Adeeb Shihadeh
49e2034098 tres (#1130)
* tres

* pull out chiplet

* add to python lib
2022-11-03 16:34:18 -07:00
Igor Biletskyy
9147cba1af F4: more RAM (#1126)
* F4 more ram

* more flash
2022-11-02 16:57:14 -07:00
Igor Biletskyy
f7c74e08c6 bugfix: D2 SRAM clocks and CRun CPU state (#1125)
D2 SRAM clocks
2022-11-02 14:28:23 -07:00
Jason Young
0ca6d9d924 VW MQB: Longitudinal safety (#920)
* VW MQB: Longitudinal safety

* disregard ACC_13 for now

* abstraction cleanup

* fix long control flag name

* quick hack

* VW MQB: Cleanup message counter handling

* various cleanup

* try without ACC_04

* follow DBC updates

* bump Docker opendbc ref

* additional main switch and cancel handling/testing

* pacify linter

* style

* handle the overlap tests like HKG CANFD

* update replay route

* commonize elements between MQB and PQ

* Apply suggestions from code review

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

* proper use of globals/conventions

* make these global

* this is better for now

* better comment on accel boundary scaling

* spelling error

* reset on init

* try bumping openpilot

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-11-01 08:13:58 -07:00
Jason Shuler
cf4aa6bb30 GM: longitudinal support for camera-integrated cars (#1014)
* Allow brake TX on PT bus

* Initial Panda GM cam harness support
 * Complete rewrite / simplification
 * Add param for cam harness (default is OBD2)
   - Forward btw 0 and 2
   - Filter LKAS and optionally ACC from cam
 * Add param for stock ACC
   - Allows ACC on PT bus when set, not otherwise
   - Allows ACC from cam when set, not otherwise
 * Add temporary WIP EPS timing workaround in ifdef

* Remove keepalive; regen == braking

* Fix MISRA violations

* EPS timing opt-in by param

* Minor clean up

* remove timing code for readability

fix and formatting

* we only need to send one message if cam harness and stock long

* Simplify params

* Removed dup brake msg

* revised params, split 3-ways

* add test

* clean up a bit, no need to send ACC yet

like this

* split out button enable and pcm enable into seperate tests

* some formatting

some formatting

* GM CAM uses PCM cruise for controls_allowed

* fix gas safety tests

* misra

* fix static analysis

comment

* fix brake pressed

* Add OP VOACC override stock cam

* Add VOACC safetyparam to init.py

* openpilot long safety

* do this in another PR

* add back

* add safety tests

* rename

* struct for safety

* not used

* temporary fault fix

* adjust max gas

* allow PSCMStatus in long mode

* stash

* fix max gas

* fix and clean up tests

* clean up longitudinal tests into a common class

* fix pylint

* subclass

* clean that up

* rm

* blocking

* comment

* comment

* lower case

* brake bus

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-11-01 00:58:18 -07:00
Shane Smiskol
997e328074 Nissan: check two wheel speeds for standstill (#1124)
* safety

* use already parsed wheel speed
2022-10-31 19:40:44 -07:00
Shane Smiskol
187fdee385 safety: remove pre-enable state (#1121)
* current_controls_allowed is now unused

* reduce diff

* remove from honda

* these test nothing

* fix
2022-10-27 17:51:20 -07:00
Adeeb Shihadeh
609a8e087a fan: reset error integral when disabled (#1119) 2022-10-27 13:58:19 -07:00
Igor Biletskyy
bd8d2481dd H7: free up 29120 bytes of RAM (#1120)
free up some RAM
2022-10-25 21:15:46 -07:00
Shane Smiskol
2db69bc941 Revert "GM: different brake thresholds by platform (#1104)" (#1116)
This reverts commit 5962bcd08a.
2022-10-21 18:11:31 -07:00
Shane Smiskol
d51dd496cb GM: more longitudinal safety (#1115)
* seems cleaner

* abort struct

* fix

* add variable in test_gm (TODO: add tests)

* fix test for new safety

* cmt

* && -> ||
2022-10-21 00:20:01 -07:00
Adeeb Shihadeh
fcb1a5a8e2 Hyundai CAN-FD: common brake pressed signal (#1113)
* Hyundai CAN-FD: common brake pressed signal

* change bit

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-10-20 19:52:06 -07:00
Shane Smiskol
54f9390ff5 GM: allow TX PSCMStatus message (#1111)
* forwarding

* add to tx msgs

* don't block

* Revert "don't block"

This reverts commit b1ca52f86d59500c6232df6afac97a51daf7bd51.

* fix forwarding tests

* comment

* add comment
2022-10-19 23:25:22 -07:00
Adeeb Shihadeh
723e60cb43 Hyundai CAN-FD: fix SCC bus for HDA1 2022-10-19 22:58:52 -07:00
Adeeb Shihadeh
24ccc34c46 Hyundai CAN-FD: use cruise signals from SCC ECU (#1112)
* Hyundai CAN-FD: use cruise signals from SCC ECU

* cleanup
2022-10-19 22:26:22 -07:00
hoomoose
dd751862c3 Hyundai: support button resume on CAN-FD HDA1 (#1102)
* Update safety_hyundai_canfd.h

* run tx checks

* fix tests

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-10-19 15:17:23 -07:00
Shane Smiskol
b95a65df58 GM: match ECM standstill check (#1105)
* match ECM check

* fix

* needs to be <= 10 to avoid a fault, fix for safety tests

* fix
2022-10-18 11:22:04 -07:00
Shane Smiskol
9ed3f75f67 Fix MISRA violation (#1109) 2022-10-17 20:53:03 -07:00
Shane Smiskol
842cf65818 Hyundai CAN-FD: support 90deg angle limit bypass (#1098)
* h90d CAN-FD

* torque

* one liner

* adjust safety

* Revert "adjust safety"

This reverts commit e3539edc313551bca4f04a6779c12f6035010dfc.
2022-10-17 20:27:30 -07:00
Jason Wen
62868c36a8 Hyundai: CAN-FD Hybrid gas pressed signal (#1106)
* Hyundai: Gate 0x105 behind hybrid CAN-FD only

* update tests

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-10-15 12:26:01 -07:00
Shane Smiskol
5962bcd08a GM: different brake thresholds by platform (#1104)
* Different brake pressed thresholds

* Update board/safety/safety_gm.h
2022-10-14 16:51:53 -07:00