Commit Graph

94 Commits

Author SHA1 Message Date
Robbe Derks
e3dd1622c3 add get_usb_serial() 2021-10-08 12:17:06 +02:00
Robbe Derks
d5ddd4a03e added is_internal() 2021-10-08 12:10:28 +02:00
Greg Hogan
fcd064345a python: disable power save by default when setting safety mode (#725)
* python: disable power save by default when setting safety mode

* no need to set power save manually

* Update python/__init__.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-09-23 23:12:36 -07:00
Willem Melching
dd22fafc3c Hyundai longitudinal (#711)
* Hyundai longitudinal

* return right addr checks

* add flag to pythong

* fix define

* check for stock ecu

* add rx check for buttons

* Block FCA11 actuation

* misra

* review 1

* comment about scaling

* clean up buttons

* use define for flag

* more extensive button checking

* check for AEB in scc12

* unsigned

* add knockout tests

* more unsigned

* cleaner
2021-09-13 20:41:10 -07:00
Igor Biletskyy
ad90646001 Support for STM32H7 and Red Panda (#694)
* H7 drivers

* Include H7 into the code

* fix flash write for H7

* get serial from flasher.h from F4 and H7

* flash.sh and recover.sh for gen3

* add set_data_speed for BRS CAN FD

* build all fws

* gen3 to panda lib

* gen3 name in scons project

* disable fd can and brs

* gen3 to CI tests

* jenkins fix for new tests and build_all

* fix pedal test

* pedal in panda tests again...

* cleanup llfdcan.h

* cleanup clock.h

* Add LDORDY bit check instead of delay

* missing define in stm32h735xx.h lib

* board_id helper

* enable debug detection again

* clean gpio inits

* fix board_id helper, make cleaner

* comment MCUs in stm lib for faster misra

* target MCU

* misra-5.5

* improve headers and misra speed

* cleanup CI tests

* change naming from gen3 to h7

* readable if statement

* cleanup llusb.h

* only cycle one transceifer in bus-off

* move unused funcs to common header

* bus_off_err reset

* misra 10.4 fdcan

* extern to can_data_speed variable

* limit can_data_speed array size to 3

* reinit fd can on data speed change

* Improve test with ELM327 and extaddr check

* bugfix for fdcan

* panda python config naming

* abstracted init request in llfdcan

* misra fdcan

* Improve llusb.h for H7
2021-08-02 20:26:15 -07:00
Igor
da8a76f1b3 Deprecate bcdDevice and legacy mode from panda lib and tests (#692) 2021-07-14 13:30:59 -07:00
Adeeb Shihadeh
7f12eb87b7 fix dos identifier 2021-07-08 00:37:14 -07:00
Adeeb Shihadeh
b2986180a8 add dos to python lib 2021-07-08 00:36:25 -07:00
Igor
f356825443 Add pedal check to panda lib (#678) 2021-07-02 14:27:04 -07:00
Willem Melching
d7b3ae0282 Extra checks for Honda Bosch Longitudinal (#662)
* only allow tester present

* ensure radar is not sending messages

* cleanup

* add honda flags

* Constrain tester present message exactly

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

* little endian

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-06-22 15:29:47 +02:00
Adeeb Shihadeh
78c24982a9 Remove non-EON panda build (#671)
* Remove non-EON panda build

* missed that

* fixup readme

* more readme

* simplify ci

* add USB command to disable heartbeat checks in debug mode

* clean that up too

* more cleanup

* fix path

* disable heartbeat in set_safety_mode

* more red

* remove one more EON ref
2021-06-21 13:54:09 -07:00
Adeeb Shihadeh
e99d41e6cf add flag to health inidicate heartbeat loss (#654)
* add flag to health inidicate heartbeat loss

* fix len
2021-06-04 22:07:45 -07:00
Robbe Derks
22556b1ddf fix health in python 2021-05-03 14:59:36 +02:00
Willem Melching
d6225226ac fix panda connect on macOS 2021-04-16 15:32:27 +02:00
Willem Melching
ad9ecefe65 Switch panda to scons builder (#635)
* add scons builder

* cleanup 1

* remove building from python code

* add pedal build

* fixup flags

* add EON flag

* change github actions to scons

* fixup automated tests

* move flashing scripts

* fix indent

* remove version.mk

* fix not in git

* fix linker script filename

* untested pedal flashing scripts

* add release option

* better asserts

* swap condition

* enable usb and fix flash script

* usb flash is not supported

* use button to enable dfu mode

* no usb because misra

* remove sleep
2021-03-24 14:44:32 +01:00
George Hotz
e035fa1d09 green led on 0xf7 (#619)
* green led on 0xf7

* add python interface

Co-authored-by: Robbe Derks <robbe.derks@gmail.com>
2021-01-05 14:51:58 +01:00
Robbe Derks
09997428f3 Fixed transceiver spelling 2020-09-28 16:19:09 +02:00
Adeeb Shihadeh
8b41ed3b81 Deprecate ESP (#592)
* remove unused wifi tests

* remove that one too

* no bootmode from ESP

* clean that up

* remove two more wifi tests

* remove boardesp and esptool

* esp_gps -> gps

* missed those

* remove esptool refs

* remove esp certs

* no more wifi

* that was old

* cleanup jenkins dockerfile

* fix linter

* remove more wifi refs

* clone panda jungle from github

* no copy

* always default esp to off
2020-08-26 15:37:50 -07:00
robbederks
1515ec8bf5 Siren (#594)
* siren

* fix pedal

* update fault rate

Co-authored-by: Tici <robbe@comma.ai>
2020-08-17 15:04:01 +02:00
robbederks
c3b02f3a74 Clock source driver (#580)
* Initial clock source implementation

* fix misra?

* Working now. Still need to fix board detection though

* Always stop pulse

* revert board detection bodge

Co-authored-by: Tici <robbe@comma.ai>
2020-08-17 13:02:41 +02:00
Greg Hogan
390b8bce81 k-line 5 baud init (#565)
* k-line slow init

* k-line slow init LED bit blink

* fix misra violations

* better names for k-line methods

* debug prints match names

* switch to timer

* use TIM4 until I figure out TIM5

* tickle faster

* fix bit bug and add stop bit

* TIM5 working

* USB return after addr sent

* fix l-line reset

* fix misra violations

* blink for the ones instead of the zeros

* k-line 5 baud fault type

* lin check

* use TIM5 or wakeup

* better names
2020-07-10 14:18:24 -07:00
Greg Hogan
31f8a0d862 K line fix (#559)
* enable UART RX interrupts

* update debug prints for python3

* improve kline functions and fix checksum

* k-line wake-up conforming to KWP2000 fast init

* fix timing

* toggle k and l line together by default

* k-line wakeup using timer

* k and l were flipped

* fix misra compliance
2020-06-18 11:17:00 -07:00
Greg Hogan
63fe9f73c3 kline_ll_recv return bytes 2020-06-14 09:22:39 -07:00
Adeeb
d0442fd1e4 add hyundai legacy safety mode (#554) 2020-06-12 18:03:31 -07:00
Willem Melching
e0a706e4f0 Stricter pylint (#550)
* stricter pylint

* Add as argument
2020-06-02 16:27:07 -07:00
Adeeb
d7f7b14118 Enable almost all Flake8 checks (#548)
* fix W391

* E262

* E703

* W293

* some E

* E231

* some more E

* E225

* more E

* E252

* no tabs

* more tabs

* E701

* uds.py

* almost all of them

* only e265 left

* not sure why this is triggering on commented out code

* ignore esptool
2020-06-01 01:49:26 -07:00
Adeeb Shihadeh
9102c16118 two spaces before inline comment 2020-05-31 14:07:01 -07:00
Willem Melching
b8267341a1 Add pre commit checks + CI (#545)
* Add pre commit checks

* untested but should work

* fix typo in dockerfile

* add sqlite

* add pylintrc to ignore usb1 members

* Typo in stage name

* Move to requirements
2020-05-29 11:52:03 -07:00
bkralik
c2bea78f6d Fix python library on Windows (#523)
On Windows, setAutoDetachKernelDriver is not supported (http://libusb.sourceforge.net/api-1.0/group__libusb__dev.html#ga5e0cc1d666097e915748593effdc634a) and causes libusb to get stuck (simple try-catch is not working). This prevents any issues when running both at native windows python and cygwined python...
2020-05-02 12:18:26 -07:00
Willem Melching
f07a6ee7c5 panda recover should go through bootstub first (#498) 2020-04-13 15:12:06 -07:00
Adeeb
8cc3a35700 remove cadillac (#496) 2020-04-13 14:43:46 -07:00
Greg Hogan
da8e00f115 TX message guaranteed delivery (#421)
* wait for tx slots before clearing nak

* fix bootstub

* Fixed misra

* Cleanup

* Added bulk write test to test USB NAK on bulk CAN messages

* Added automated bulk tx test

* Fixed linter

* Fixed latency test influence

* Added timeout to python API

* Disabled can write timeout in bulk write test

Co-authored-by: Robbe <robbe.derks@gmail.com>
2020-04-06 16:49:42 -07:00
Shreyansh Chandak
0c2c149490 Fixing libusb busy error (#174)
Detaching all kernels before attempting to claim the usb
2020-04-02 10:12:03 -07:00
Jason Young
08ef92d585 Safety model for Volkswagen PQ35/PQ46/NMS (#474)
* Align with VW Community port 0.7.4-devel

* Import of PQ35/PQ46/NMS safety work

* Add safety replay drive for PQ35/PQ46/NMS

* Unwind community port hax for upstream, bump Panda ver

* Update comment

* Reduce whitespace diff

* Reduce whitespace diff

* Don't test the drive until it's uploaded

* Propitiate MISRA

* Ixnay on the VERSION LF

* Remove VERSION LF, update safety_replay with PQ drive

* Freshen cereal ref to include fields used in VW PQ test drive

* Remove superfluous return

* Bypass Docker caching issue
2020-04-01 12:38:27 -07:00
rbiasini
b2dbb504dc remove toyota ipas safety code and tests (#460) 2020-03-04 10:54:13 -08:00
rbiasini
dfa6b079de separating subary legacy safety mode from global (#452)
* separating subary legacy safety mode from global

* added explicit tests for subaru legacy, which were absent before
2020-02-27 15:28:24 -08:00
Andre Volmensky
db94a5b813 Added Nissan safety (#244)
* Added Nissan safety
2020-02-26 11:11:56 -08:00
Jason Young
ccf75c456f Volkswagen safety updates: Phase 1 (#444)
* Checkpoint Panda refactoring updates

* Rename MQB safety tests in preparation for PQ

* Refactor MQB tests, add missing torque test

* Bring in MQB init without CRC LUT setup

* Fix to ACC_06 test case

* Fix to ACC_06 test case

* Tweak comment for clarity

* Drop superfluous return
2020-02-19 12:37:38 -08:00
Willem Melching
38fc1d39ff add option to not do a clean st build 2019-12-20 19:39:50 -08:00
Riccardo
d19fd3e6bd better differentation of honda safety modes 2019-12-20 15:51:32 -08:00
Riccardo
01244d7557 Fix panda libs 2019-12-20 14:34:59 -08:00
Riccardo
268ab9acf3 send can_rx_errs in health 2019-12-19 18:17:09 -08:00
Willem Melching
ad10c8c7ee get_signature return bytes instead of bytearray 2019-12-18 17:03:31 -08:00
Willem Melching
7c13bec09f Command to get signature (#399)
* Commands to get signature from panda

* does this make misra happy?

* Can I do this in misra?

* this works and makes misra happy

* Add jenkins test for get signature

* Remove comments

* Add comment about code size

* Fix firmware file path
2019-12-09 10:54:48 -08:00
Robbe
ca39a5d8f6 Added faults integer to health packet 2019-11-26 17:07:51 -08:00
Robbe
22464356c3 Fixed health struct size. We should really get an automated test for this 2019-11-22 16:02:08 -08:00
robbederks
f458d67a7c Add uptime counter to the health packet (#391)
* Added uptime counter to the health packet

* fix tests by setting power save on on EON build
2019-11-21 16:47:49 -08:00
rbiasini
1192d934a0 Power saving refactor (#389)
* Exit power saving also for CAN based ingition detection and replace interrup with simple state machine. a bit of delay it's fine

* bug fixes and also CDP set on start

* sorry misra

* move comment

* typo

* remove ignition interrupts

* Power saving state machine should be done by boardd, which also sets safety modes and usb power modes

* typo

* Added usb command for power save state setting

* Added power save enabled packet

* Added power_save_enabled to python lib too
2019-11-21 12:53:00 -08:00
rbiasini
597436d32a NOOUTPUT safety mode is now SILENT. NOOUTPUT still exists but keeps C… (#388)
* NOOUTPUT safety mode is now SILENT. NOOUTPUT still exists but keeps CAN live

* README mention of 'no output'

* mispelled
2019-11-20 11:56:26 -08:00
Robbe
6626a54241 Fixed python health api 2019-11-15 21:01:46 -08:00