Commit Graph

1136 Commits

Author SHA1 Message Date
Igor Biletksyy a0bd6bb21a chiplet: move OBD_SBU_RELAY2 to PA3 2023-01-17 16:27:00 -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
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
Shane Smiskol 0b3b906036
VW: match openpilot standstill check (#1064)
* VW: match openpilot standstill check

* fixes

* check > 0

* fix comments

* misra

* better
2023-01-10 22:00:20 -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
Willem Melching 8b513970c3
fix debug uart buffer size (#1204) 2023-01-09 17:27:46 -08:00
Robbe Derks 3034180753
Reset CAN ign when the specific message is not seen anymore (#1200) 2023-01-09 14:27:18 -08:00
Robbe Derks 6ba9afc33e
H7 clock source (#1194)
it's literally the same everything

Co-authored-by: Comma Device <device@comma.ai>
2022-12-14 16:12:09 +01: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
Robbe Derks d1d1f8a22d
Fake siren (#1192)
* DAC POC

* change freq

* some cleanup

* wip: cleaning up and trying to use DMA

* no clue why this doesn't work

* this works

* wip multi-master i2c for fake siren

* cleanup and some more i2c stuff

* seems more stable

* retry disabling and cleanup force siren

* fix misra violations

* not needed

* messed up rebase

Co-authored-by: Comma Device <device@comma.ai>
2022-12-14 11:25:54 +01:00
Adeeb Shihadeh 4edd1a6021
Hyundai: alt steering limits (#1186)
* Hyundai: alt steering limits

* parans
2022-12-02 23:34:06 -08:00
Shane Smiskol a6d0765b69
safety: common angle checks (#1182)
* common angle checks

* clean up

* clean up check and add comments

* readable

* ints

* tests draft

* clean up

* comment

* pylint exception

* clean up

* duplicate
2022-12-02 16:45:23 -08:00
Adeeb Shihadeh 616450c525
tres bootkick (#1183)
* tres: bootkick

* replace usb enum

Co-authored-by: Comma Device <device@comma.ai>
2022-12-01 20:04:30 -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
Shane Smiskol b238d41979
safety: clean up passing in longitudinal_allowed (#1176)
* clean up

* clean up

* and fix that

* interceptor func

* fix

* draft

* fix that
2022-11-30 22:09:13 -08:00
Jason Wen 9c50939cfb
HKG CAN-FD radar-SCC: fix controls mismatch (#1173)
* Need to check on bus 4 as well

* Fix 0x1a0 check race condition

* Update board/safety/safety_hyundai_canfd.h

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

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-11-30 21:23:55 -08:00
Shane Smiskol a0b1d64e4e
Honda Nidec: max gas safety and common speed cmd checks (#1179)
* limit gas and speed

* gas safety test
2022-11-30 18:56:05 -08:00
Shane Smiskol cb8fc6bd42
safety: common interceptor checks (#1178)
* interceptor checks

* only one line needed for now

* whoops

* misra

* misread as |
2022-11-30 17:22:42 -08:00
Adeeb Shihadeh 27504639f0
cleanup + prep for more tests! (#1172)
* panda for pc!

* little more

* fake panda

* move some more stuff

* increase timeout

* move that

* print helpers

* cleanup

* just move it for now

* revert jenkins changes
2022-11-30 14:15:09 -08:00
Shane Smiskol e8bd1df511
safety: common gas & brake safety checks (#1168)
* do toyota, hyundai, gm

* comments

* honda draft

* Revert "honda draft"

This reverts commit a1f466a5c9.

* do tesla

* vw draft

* finish vw

* fix safety

* clean up

* fix function names

* do honda and fix safety test not checking pos accel for bosch

* clean that up
2022-11-29 23:45:55 -08:00
Adeeb Shihadeh e6f62a62aa
rename puts to avoid conflict with stdio.h (#1174)
* rename puts to avoid conflict with stdio.h

* better name
2022-11-29 22:55:10 -08:00
Shane Smiskol 2baa0ffed5
Safety: common acceleration cmd checks (#1171)
* do toyota, hyundai, gm

* comments

* honda draft

* Revert "honda draft"

This reverts commit a1f466a5c9.

* do tesla

* vw draft

* finish vw

* fix safety

* only accel

* only accel

* some clean up

* fix mqb tests

* rename
2022-11-29 16:46:32 -08:00
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 c7fdc3b00c.

* 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 fce1215a2e.

* 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 67abe4c86b.

* 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 01bfda6dff.

* 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