Commit Graph

47 Commits

Author SHA1 Message Date
Adeeb Shihadeh
bce6f48a9d CI speedup (#1108)
* use docker buildkit

* enable push

* try this caching

* no regressions

* don't copy into the image

* move that

* getting there

* debug

* little smaller

* debug

* configure safe dir

* no sudo

* cleanup

* another timeout
2022-10-16 16:37:58 -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
Adeeb Shihadeh
291d9e3eb9 safety: refactor steering safety checks (#1013)
* start with vw

* hyundai

* rest of driver torque cars

* remove hyundai for now

* fix cppcheck crash

* set committer

* revert gm

* remove those
2022-08-09 19:53:15 -07:00
Adeeb Shihadeh
294792c1b5 misra: support rules text if exists (#1017) 2022-08-09 14:56:21 -07:00
Adeeb Shihadeh
995aed6550 make misra tests easy to run locally (#1016)
* make misra tests easy to run locally

* auto install

* fix copy

* test the test

* Revert "test the test"

This reverts commit 418abfc728337a9a8be3388ba76a27d27dc5954e.
2022-08-09 14:23:12 -07:00
Adeeb Shihadeh
62f709afd4 fix missing CAN-FD safety modes 2022-05-19 16:55:53 -07:00
Willem Melching
36c62afa0c Kia EV6 (#905)
* block lkas

* taco time

* local changes

* start

* tx checks

* counter + vehicle moving

* support big can fd

* check crc

* add torque to rx checks

* tests

* little more

* little more

* get some misra coverage

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-05-19 15:59:58 -07:00
Igor Biletskyy
ca67da626f Fix MISRA violations 10.1 and 10.4 (#796)
* misra 10.1

* misra 10.4

* misra 10.4 in usb_protocol.h

* don't cast
2021-12-01 14:13:38 -08:00
Igor Biletskyy
ae26b75d7b CAN_FIFOMailBox to CANPacket struct + USB dynamic packet size (#739)
* Squashed commits, no cleanup

* Few fixes

* No init = garbage

* Only receive with new canpacket

* Add send with canpacket

* Revert "Add send with canpacket"

This reverts commit 7d06686ddd6d447c714b5289d31af24403d36931.

* Packet must be aligned to word, or bad performance

* Cleaner

* Fix tests

* Tests...

* MISRA 10.4

* More MISRA

* libpandasafety_py

* cffi

* even more tests...

* typo

* ...

* ...

* ...

* Slight cleanup

* MISRA 6.1

* MISRA 17.7

* Bug in bxcan + even style

* MISRA 10.1

* Revert "MISRA 10.1"

This reverts commit 404ae7fcc39556f80f528de9015702e69f4ea0a5.

* ...

* MISRA 10.1 and 10.4 suppress until next PR

* MISRA 20.1

* ...

* test_honda

* ...

* ...

* test_toyota

* test_volkswagen_mqb

* test_volkswagen_pq

* Sketchy thing...

* Revert "Sketchy thing..."

This reverts commit 3b2e5715bdc1954f7b7b3b7469ba3d0eaa06bdf9.

* remove comment

* bxcan extended address bug

* Concept, experimental dynamic usb packet size

* increase each buffer to 10240 bytes

* raise python bulk read/write limits

* ...

* Move packet size to start

* Experimental send, stream-like

* New receive test, stream-like

* cleanup

* cleanup + rebase fixes

* MISRA

* Extra receive method, stream-like, commented out

* type change

* Revert back to buffer for send, stream commented

* forgot ZLP

* lower buffer, add rx failsafe

* ... remove ZLP

* return ZLP back

* Add tx checks to panda fw

* TX stream with counter

* fix counter overflow

* 13 free slots should be enough

* limit tx usb packet

* ...

* Revert max_bulk_msg doubling

* python lib improve speed

* Stream with counter for RX, dirty, needs cleanup

* Increase chunk length to 4096 bytes

* cleanup fdcan.h

* cleanup __init__.py

* MISRA 12.1

* MISRA 10.8

* remove non-streaming usb functions

* more main.c cleanup

* MISRA 15.6

* MISRA 15.5

* MISRA 18.4 and suppress objectIndex

* handling usb pakcets > 63bytes, naming and cleanup

* Cleanup old from tests and update CANPacket_t struct

* Switch to 4 bit DLC instead of 6 bit length

* ops)

* ...

* pylint

* receive python buffer increase

* USB increase receive packet len

* tweak buffers

* No need for so high limits

* MISRA 20.1 workaround

* performance tweaks

* cleanup, dlc to data_len_code naming

* main.c naming

* comments and cleanup for main.c usb

* clean py lib

* pylint

* do not discard good rx messages on stream fail

* cleanups

* naming

* remove bitstruct lib and lower tx limit

* bitstruct lefovers

* fix bug in VW test

* remove adjusting data size and assert on wrong len

* ...

* test new memcpy before merging

* Revert "test new memcpy before merging"

This reverts commit 399465a264835061adabdd785718c4b6fc18c267.

* macros for to/fromuint8_t array

* MISRA hates me!

* tests.c include macros instead

* move CANPacket to can_definitions.h

* vw_pq python test fix

* new memcpy test, REMOVE

* check without alignment

* revert macros for uint8 arrays

* Revert "revert macros for uint8 arrays"

This reverts commit 581a9db735a42d0d68200bd270d87a8fd34e43fe.

* check assert

* Revert "check assert"

This reverts commit 9e970d029a50597a1718b2bb0260196c050fd77f.

* one more variation

* Revert "one more variation"

This reverts commit f6c0528b7ac7e125750dc0d9445c7ce97f6954b5.

* what about read performance

* Revert "what about read performance"

This reverts commit d2610f90958a816fe7f1822157a84f85e97d9249.

* check struct alignment to word

* check for aligned memcpy again

* cleanup

* add CANPacket structure diagram

* update CANPacket and add USB packet struct

* bugfix + refactoring of EP1

* move dlc_to_len to header

* missed include

* typo...

* MISRA

* fk

* lower MAX_CAN_MSGS_PER_BULK_TRANSFER

* bump CAN_PACKET_VERSION to 2

* bump python lib CAN_PACKET_VERSION to 2

* rename parse_can_buffer to unpack_can_buffer

* CANPacket_t const fields

* Revert "CANPacket_t const fields"

This reverts commit cf91c035b7706a14e317550c5f0501ae3fce7c70.

* test.c relative path

* cleanup

* move macros to safety_declarations

* Refactor pack/unpack funcs and add unittest

* usb_protocol.h

* oops

* Update .github/workflows/test.yaml

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

* remove print from unittest

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-11-12 16:36:34 -08:00
Igor Biletskyy
cf804d65d2 fix MISRA test bug and coverage (#743) 2021-10-18 22:04:14 -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
7d93e5a202 Refactor HAL (#656)
* Let refactoring begin!

* Fix pedal build

* Fix pedal safety tests

* Forgot few TIM2 instances

* Try this way with misra

* More misras...

* More misras...

* Still fighting with misra blindfolded

* Almost got it!

* Last misra error..

* Last misra error..

* Misra works locally..

* Maybe this?

* Looks like it was cppcheck bug, revert changes

* Suggested changes and reverts

* File structure change

* revert includes

* remove spaces

* remove timer delay

* endings

* more typing

* rename early to early_initialization

* Remove delay_us

* Revert RTC default values

* Revert initialization sequence

* Fix quotes

* Revert

* Return TIM6EN

* Alias slow timer to TICK_TIMER

* Refactor files structure

* Remove definition of PANDA

* Abstract timers

* Fix include

* tick_timer_init

* Split usb driver

* Move LL stuff: adc

* Move LL stuff: usb

* Fix include again...

* Will check pedal builds also locally..

* Move LL stuff: CAN

* Move LL stuff: clock

* Rename common to peripherals and move

* Move board HAL

* Change include, not needed for pedal

* llgpio to gpio and new lines fix

* remove board_has_relay, not used

* Remove board_functions.h and add to board struct

* Move include

* Fk MISRA...

* has_onboard_gmlan to has_hw_gmlan

* Typos

* Move board_declarations include

* Shuffle

* More abstraction

* fix paths, fix cppcheck test

* Fix for pedal build with USB
2021-07-02 18:25:35 -07: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
Igor
ddc25b0611 Update cppcheck and misra, suppress for now (#663)
* Update cppcheck and misra, suppress for now

* Add FIXME to suppression tags

* Missed one spot
2021-06-18 14:24:15 -07:00
Adeeb
35bff5db51 Speed up misra test in CI (#552) 2020-06-07 21:42:23 -07:00
Adeeb
55b79b4721 GitHub Actions (#535) 2020-05-17 19:53:23 -07:00
rbiasini
d301a59d64 WIP: Checksum checks (#403)
* add lag message check for all supported cars
* add checksum and counter checks for toyota and honda
* add rx hook regression tests
2019-12-21 10:25:54 +01:00
robbederks
656f99b080 Interrupt refactor (NVIC_SM_1: #334) and Fault handling (#377) (PR #373) 2019-11-27 18:11:21 -08:00
Riccardo
dec565c728 Update Misra test coverage, which now includes rule 2.7 2019-11-27 00:23:32 -08:00
Riccardo
bfd8ff1b18 Update cppcheck commit with more coverage 2019-10-31 13:08:10 -07:00
Riccardo
25af7d3019 Misra also need python 3 env 2019-10-15 14:25:34 -07:00
Riccardo
7434c5ce28 centralize requirements for tests 2019-10-15 14:21:33 -07:00
Riccardo
62e2f5caac update cppcheck commit 2019-10-15 13:57:36 -07:00
rbiasini
fac0277169 Misra update (#280)
* Updated cppcheck ref. New rules to be fixed

* changed 2 MACRO names that had more than 31 characters in common

* Fix newly popped 10.4: same type on arithmetic ops

* Fix 18.4: operators should not be applied to an expression

* ensure a NULL pointer isn't dereferenced
2019-09-27 17:18:02 -07:00
Riccardo
078ee588c2 This is the correct table, actually 2019-09-27 11:15:29 -07:00
Riccardo
578b95ee33 Misra table of coverage added 2019-09-27 11:11:16 -07:00
Riccardo
c597dcc897 VERSION update after health packet changes and minor misra test change 2019-07-12 12:04:21 -07:00
rbiasini
01072bec0b Misra 11.x: pointer usage. (#250)
* RDLR, RDHR gone from safety

* back at not failing misra safety

* fix safety tests

* did not mean this

* Use get-bytes in pedal too

* Ignore Misra 11.5 and Fix 11.8 violaitons

* Fix 11.3 violations

* Neglect Misra 11.4, fix pointer issue in bootstub and rutn on Werror for pedal builds

* Fix Misra 11.6: can't assign number to void pointer

* Fix test after changing honda_moving name

* for loop is better

* Fix bugs from fbck
2019-07-10 20:56:03 -07:00
Riccardo
ce1daf2062 Misra check only done for EON config 2019-07-10 12:02:50 -07:00
Riccardo
04756a037f Turning back Misra check: unvoluntarily change 2019-07-09 16:18:44 -07:00
Riccardo
b983cc8fe6 Re-wrote test_misra.sh 2019-07-09 14:37:26 -07:00
Riccardo
06ee8bd2d2 Ignore Misra 5.4 until cppcheck bug (?) is fixed 2019-07-08 19:30:58 -07:00
Riccardo
4be858224f Update cppcheck commit and pass predefined params to avoid impossible combinations of configs 2019-07-08 18:20:00 -07:00
Riccardo
1cd34e5645 Explicitly set the define and undefine for unknown configs in misra checks 2019-07-08 15:32:55 -07:00
rbiasini
1f40d1e6a6 Misra pedal (#245)
* Fix misra on pedal
2019-07-07 16:59:31 -07:00
Riccardo
a4554e3e69 Ignore advisory Misra 19.2: the union keyword should not be used 2019-07-07 16:31:06 -07:00
Riccardo
fc8b9e49bd Cppcheck: also check pedal 2019-07-04 02:58:17 -07:00
Riccardo
c6ec11e17f fixed tab 2019-06-17 20:06:14 -07:00
Riccardo
0a77dffc9a change test and see if we get a failure now 2019-06-17 19:50:03 -07:00
Riccardo
6cd5a4fcd0 Update cppcheck commit in test_misra.sh 2019-06-17 18:54:05 -07:00
Riccardo
05487e29d7 More complete Misra check on safety code (better than running cppcheck on sfaety.h only, with broken dependencies) 2019-06-17 14:27:01 -07:00
Riccardo
37576ef3b4 Allow inline suppress for the cppcheck 2019-06-12 13:16:23 -07:00
Riccardo
55679532aa Fix Misra 20.1 violations: Moved safety declarations in its own header and qdded optional input to run misra tests for safety code only. 2019-06-12 06:35:47 -07:00
Riccardo
38f4288f1e running misra also specifically for safety code 2019-06-10 21:58:01 -07:00
Riccardo
274f9ce06d Misra: separately save the cppcheck output in its own artifact 2019-06-07 15:39:30 -07:00
Riccardo
20171596f7 update cppcheck ref to have more comprehensive misra checks 2019-06-06 16:00:53 -07:00
rbiasini
1aa00c95ee Misra c2012 (#192)
* Started making panda misra compliant: this fixes some of 12.1 warnings

* Also added a regression test for strict compiler warning
2019-05-20 22:13:45 -07:00