Commit Graph

183 Commits

Author SHA1 Message Date
Adeeb Shihadeh df7952ec13
python: add helper to check if up to date (#1269)
* python: add helper to check if up to date

* current

* handle is always basehandle

* update that

* Update __init__.py

---------

Co-authored-by: Bruce Wayne <batman@workstation-production.internal>
2023-03-07 13:47:55 -08:00
Adeeb Shihadeh 946f952aa7
DFU HITL tests (#1276)
* DFU HITL tests

* fix + types

* fix

* clear first
2023-03-05 20:19:27 -08:00
Robbe Derks d6af117c62
Microsecond timer fix (#1236)
* add microsecond timer readout

* add CI test

* fix
2023-02-14 12:16:15 +01:00
Adeeb Shihadeh 14051f9ce3
Chrysler: revert rate limit increase (#1240)
* Revert "Chrysler: add flag for alternate steer limits (#1238)"

This reverts commit d15250cb14.

* Revert "Chrysler: increase torque rate limits (#985)"

This reverts commit ae051c94a3.
2023-02-13 14:13:40 -08:00
Adeeb Shihadeh d15250cb14
Chrysler: add flag for alternate steer limits (#1238) 2023-02-10 22:20:50 -08:00
Adeeb Shihadeh 6ec0c80754
python: common base handle for SPI + USB (#1231)
* base handle

* usb handle

* rm

* more types
2023-01-28 16:01:54 -08:00
Adeeb Shihadeh e7f36a2992
python: assume F4 MCU for bootstubs without bcdDevice set (#1229)
* python: assume F4 MCU for bootstubs without bcdDevice set

* cleanup
2023-01-28 14:41:52 -08:00
Adeeb Shihadeh 76d0459182
cleanup MCU definitions (#1226)
* cleanup MCU definitions

* rename

* enum

* enum

* fix that
2023-01-26 20:54:11 -08:00
Adeeb Shihadeh 2036533670
python: show SPI pandas in list (#1216)
* refactor connect

* spi list

* add back bcd

* couple fixes

* fix

Co-authored-by: Comma Device <device@comma.ai>
2023-01-22 21:49:14 -08:00
Adeeb Shihadeh 0e5a2a47da
python lib: print() -> logging (#1215)
* python lib: print() -> logging

* fstrings are fine
2023-01-15 23:51:25 -08:00
Adeeb Shihadeh 3048760737
SPI: connect by serial/UID (#1213)
* SPI: connect by serial/UID

* cleanup

* not everyone can have spi

* fix that

* move that

* mypy fix

Co-authored-by: Comma Device <device@comma.ai>
2023-01-15 23:30:24 -08:00
Adeeb Shihadeh b8693da342
add comms handler to get MCU UID (#1212)
* cleanup first

* get uid

* add to bootstub and test

* fix pedal

* match that

Co-authored-by: Comma Device <device@comma.ai>
2023-01-15 20:13:26 -08:00
Shane Smiskol bdf39a451e
Panda: context manager support (#1209)
* add __enter__ & __exit__ to Panda

* some examples

* another example

* even more

* use it here too
2023-01-13 16:17:20 -08:00
Robbe Derks 11d90f9e78
No more magic for the can chunks (#1191)
* no more magic

* bump version

* no need for this

* comment cleanup

* add comms_can_reset tests

* we can't ensure this for compatibility reasons

* add CANPacket_t checksum
2023-01-13 10:59:58 -08:00
Robbe Derks 744b21ef69
Bring back green led mode + fix small python lib bug (#1206)
bring back green led mode

Co-authored-by: Panda Provisioning <panda@comma.ai>
2023-01-10 15:09:51 -08:00
Robbe Derks 1d732d4747
F4: Cleanup clock src, second try (#1193)
* F4: cleanup clock source

* little more

* void

* restore the timer setup

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
2022-12-14 15:30:04 +01:00
Adeeb Shihadeh 4edd1a6021
Hyundai: alt steering limits (#1186)
* Hyundai: alt steering limits

* parans
2022-12-02 23:34:06 -08:00
Robbe Derks 288e14cde9
Simple CAN chunking (#1011)
* simple chunking

* make pylint happy

* misra happy?

* good practice anyways since we cast to a uint32_t later

* fix bug dropping packets

* minor fixes + prepare for shared lib testing

* working library now

* first queue test

* can send test

* fix running in github actions?

* add big rx test and fix it

* don't complain about empty buffers

* disable for now

* comment

* test runs

* some cleanup

* merge those

* test works

* rm that

* comment

* proper logging

* makes things too slow

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-11-30 23:38:00 -08:00
Adeeb Shihadeh 88b30e1a84
CAN comms test (#1181)
* CAN comms test

* remove those

* cleanup

* little more
2022-11-30 22:12:28 -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 2e90b6f308 cleanup python lib imports 2022-11-21 16:59:21 -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
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
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
Adeeb Shihadeh 0b86dfa5fb python lib: only import spidev as necessary 2022-11-04 11:35:40 -07:00
Adeeb Shihadeh a42b104c35
SPI handle in python lib (#1131)
* SPI handle in python lib

* add spidev

* unify those

* clean up connect

* clean that up

Co-authored-by: Robbe Derks <robbe.derks@gmail.com>
2022-11-03 22:18:12 -07:00
Adeeb Shihadeh 49e2034098
tres (#1130)
* tres

* pull out chiplet

* add to python lib
2022-11-03 16:34:18 -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
Adeeb Shihadeh 622ce923e9
Hyundai: share flags with CAN-FD platform (#1099)
* Hyundai: share flags with CAN-FD platform

* update flags there
2022-10-12 20:29:15 -07:00
Greg Hogan 2f3e2825e5
CAN-FD non-ISO support (#1082)
CAN FD non-ISO support
2022-10-12 15:28:20 -07:00
Adeeb Shihadeh ffb3109e28
Hyundai: HDA2 longitudinal control support (#1096)
* ev6 long

* update steering
2022-10-11 20:50:23 -07:00
Adeeb Shihadeh e987e6c639
add pandaState.safetyRxChecksInvalid field (#1083)
* add fault for invalid safety RX checks

* fix test build

* debug

* fix debug

* fix test

* just a bool in health
2022-10-03 16:05:16 -07:00
Igor Biletskyy 59ede3fe61
CAN health packet: add speed and canfd info (#1071)
in
2022-09-16 20:39:18 -07:00
Igor Biletksyy 046fd58e8d python lib: check get_packets_versions length 2022-09-15 14:54:38 -07:00
Igor Biletskyy f029c99440
health packet: fix confusing variable names (#1068)
* fix naming

* different buffer overflows

* naming
2022-09-15 13:08:46 -07:00
Igor Biletskyy 0eef8cf333
CAN: health message for each CAN module (#1067)
* initial can health pkt

* MISRA: variable scope

* MISRA 10.4

* typo

* add total_fwd_cnt

* check size of can_health_t

* improve

* comment

* that's better

* move

* add health check to tests

* why?

* ...

* revert later

* meh

* Revert "meh"

This reverts commit 0eb8432194.

* Revert "revert later"

This reverts commit 2d98957a8f.

* adjust test
2022-09-15 13:04:10 -07:00
Igor Biletskyy ac21dbe551
H7: add chiplet panda support (RPv2) (#1049)
* temporarily disable Jenkins

* firmware

* python lib

* tests

* ..

* usb load switch to high

* it is still red

* usb power mode remove

* Revert "temporarily disable Jenkins"

This reverts commit a911cfad8d.

* forgot this

* common periph

* change name

* board tick

* add V2 to CI

* update known bootstub
2022-09-09 20:13:06 -07:00
Adeeb Shihadeh 13d64d4cc3
USB power mode + bootkick cleanup (#1051)
* remove tick

* remove more

* delete more

* board tick

* update health

* dos bootkicking

* cleanup
2022-08-31 20:46:07 -07:00
Igor Biletksyy 6d2e2bde86 put is_internal() back for openpilot pandad.py 2022-08-31 10:39:05 -07:00
Igor Biletskyy b81dfba8fe
python lib: cleanup hw type check (#1050)
cleanup
2022-08-30 10:46:12 -07:00
Igor Biletskyy 451d6309b5
python lib: check serial length for Panda.list() (#1042)
* known serial length

* rm from pedal test

* rm from helpers

* oopps

* ...

* add warning

* warning
2022-08-23 22:29:35 -07:00
Jason Wen 9d6496ece8
Hyundai CAN-FD: Tucson Hybrid 2022 support (#999)
* Hyundai: Car Port for Tucson Hybrid 2022

* Remove test comments

* Fix fwd_hook

* Allow tx on 0x1a0

* Fix byte counts

* Send LFA and HDA icons based on engageability

* Add FLAG_HYUNDAI_CANFD_HDA2 flag

* Update __init__.py

* Allow tx with CRUISE_INACTIVE

* Panda safety cleanup

* Include bus 0 in rx checks

* Missed one

* Remove redundant check

* Add comments

* start cleanup

* little more

* more cleanup

* tests

* one more test case

* rename

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-08-19 19:43:58 -07:00
Adeeb Shihadeh d3e2477231 python lib: disable checks on reconnect 2022-08-18 22:01:12 -07:00
Adeeb Shihadeh 7e843b370d
allow disabling heartbeat while in non-car safety mode (#1035)
* allow disabling heartbeat while in non-car safety mode

* simple test

* clean that up

* remove that
2022-08-17 22:42:18 -07:00
Robbe Derks ba8772123f
Simple integrating fan controller (#1022)
* fast rpm measurement

* fix indentation

* this seems stable

* clip fan integral

* fix misra

* add fan power to health

* board-specific max rpm

* refactor fan enable

* cleanup

* stall detection and reset

Co-authored-by: Comma Device <device@comma.ai>
2022-08-17 20:43:49 -07:00
Igor Biletskyy ba90f6a8c9
CI tests: check app against known good bootstub first (#1033)
* test

* add master bootstub
2022-08-15 20:11:49 -07:00
Igor Biletskyy 54eb42d903
one flash.sh for both H7 and F4 (#1032)
* flash one

* edit readme
2022-08-15 20:11:38 -07:00
Jason Young 199bc10db3
VW PQ: Longitudinal control safety, lateral torque update (#989)
* VW PQ: Updated checksum and counter handling

* first pass PQ long control safety

* refactor stock test to prep for long test

* long control tests

* falling edge enable logic and tests

* accidentally worked but this is better

* test misra/cppcheck evaluation of debug build

* Revert "test misra/cppcheck evaluation of debug build"

This reverts commit 7594fc5e2f.

* allow use of manufacturer ramp-up rate

* soften wheel-touch threshold

* fix tests

* check/test ACC main switch state

* fix CRC for Motor_5

* derp

* retry CI

* try that again

* fuuuu

* fix Motor_5 checksum validation

* use existing acc_main_on global

* re-pin opendbc

* no need for resume spam in longitudinal mode

* concise

* consistency cleanup

* comment and whitespace cleanup

* more cleanup

* more

* restore driver torque threshold

* add long control replay route

* obsolete comment

* proper flag name

* wild to mild-ish

* bump openpilot ref

* Update test_safety_replay.py

* handle non existent routes

* comment consistency/polish

* flip comparison order for falling edge clarity

* restore refs

* read the diff next time, speedy

* srsly

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-08-12 18:50:00 -07:00