Commit Graph

54 Commits

Author SHA1 Message Date
Adeeb Shihadeh
9c0be978d5 remove some old comments 2025-07-27 15:06:30 -07:00
Adeeb Shihadeh
805d2437e8 move bootstub define 2025-07-20 11:37:37 -07:00
Adeeb Shihadeh
ca603115cb Include from project root (#2232)
* fix include paths

* cleanup
2025-07-19 21:58:58 -07:00
Robbe Derks
998ac9d5d8 Init cleanup: global LED driver (#2170)
* wip

* fix init

* fix libpanda

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2025-03-14 18:01:45 +01:00
Adeeb Shihadeh
6eed036473 (almost) enable cppcheck unusedFunction (#1875)
* remove some unused

* more

* kinda works

* rest are false positives

* disable for now

* add back exhaustive
2024-02-17 14:16:15 -08:00
Adeeb Shihadeh
d7120be904 panda jungle (#1547)
* mv jungle

* match pedal style

* fix linter

* fix fw path

* fix paths

* safety!
2023-08-03 23:55:13 -07:00
Robbe Derks
9db0ae7056 Remove external debug UART support (#1159)
cleanup external debug serial
2022-11-14 11:46:04 +01:00
Igor
aaad0c2865 Refactor flasher (#686) 2021-07-14 13:49:28 -07:00
Igor
eab9c9ee4c HAL refactoring part 2 (#682)
* Move harness threshold

* Move interrupt handlers

* timers.h refactor

* rtc.h refactor

* pwm.h and fan.h refactor

* clock_source is hw specific

* refactor uart.h

* macro naming

* minor fixes

* redo rtc
2021-07-13 14:12:07 -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
George Hotz
eadb0dbb1d security upgrades (#397)
* security upgrades

* Gated DFU entry from debug console as well
2019-12-10 08:14:30 -08:00
Riccardo
df4159c846 Revert "Revert "Register readback on most modules. Still need to convert the other ones (#396)""
This reverts commit 56ec215024.
2019-12-05 14:19:29 -08:00
Riccardo
56ec215024 Revert "Register readback on most modules. Still need to convert the other ones (#396)"
This reverts commit 893e486194.
2019-12-05 13:55:20 -08:00
robbederks
893e486194 Register readback on most modules. Still need to convert the other ones (#396)
* Added an initial working implementation of the register readback and applied it to the LLCAN registers. Also fixed an init bug in CAN.

* Locally disable pylint import error

* Reverted change to CAN-obj->FA1R setting

* Fixed misra compliance

* Changed hash function name

* Fixed CAN filter setting

* Added voltage health test

* Converted ADC to register functions

* Converted clock to use register setters

* Added check to see if fault status is zero after running test

* Converted DAC to use register setters

* Converted fan to use register setters

* Converted gmlan bitbanging to use register setters

* Changed over interrupt driver to use register setters. Also moved some includes and definition places for critical sections

* Fixed build

* Converted LLGPIO to use register setters

* Converted pwm to use register setters

* Fixed cold boot

* Fixed health fault check in automated tests

* Added comment for the future (issue #367)

* Converted RTC driver to use register setters

* Converted SPI to use register setters

* Converted timer driver to use register setters

* Fixed register fault on white pandas and disabled showing of fault for release

* Bump version
2019-12-04 20:42:57 -08:00
robbederks
656f99b080 Interrupt refactor (NVIC_SM_1: #334) and Fault handling (#377) (PR #373) 2019-11-27 18:11:21 -08:00
rbiasini
a12a148d5f Uno (#274)
* Added uno

* Added usb switch support

* Added PWM and IR power functions

* Implemented bootkick

* Added uno as a new hw type

* Bumped version

* Added fan control and tach readout

* WIP: RTC support

* Working RTC

* Fixed python

* Misra compliance

* Added USB control messages for fan/IR power

* Added USB commands + tests for fan & IR control. Fixed bootstub and pedal compilation

* Added IR and fan to power saving mode

* Changed defaults

* Fix safety considering uno

* passing safety now

* Minor UNO tweaks

* Fixed version

* More minor temporary tweaks

* Removed usb load switch from uno

* Added power control for shutting down the fan completely

* Disable IR LEDs by default

* Fixed linter issue

* Linter fix #2
2019-10-25 16:22:42 -07:00
robbederks
0894b28f1e Fixed USB power mode on black (#291)
* Fixed USB power mode on black

* bump version
2019-10-05 20:34:19 -07:00
robbederks
d68508c79a Gpio race condition fix (#263)
* Fixed pedal not initializing

* Interrupt changes

* More changes
2019-08-28 12:53:51 -07:00
rbiasini
59f5813173 Black (#254)
* late usb

* Added type support for black panda

* Added harness presence and orientation detection

* harness relay driving code

* Added intercept support in black panda code. Switched around can0 and can2

* Disable ADCs after orientation detection. Ignition interrupts via harness

* WIP: Hardware abstraction layer + black panda bringup

* Fixed bootstub build

* Fixed bootstub for pedal

* Fixed infinite loops

* Got CAN buses working on white again

* Fixed pedal build and black can interfaces

* Got CAN buses working on black panda

* Finished loopback test for black panda

* Erase all flash sectors on the panda. Increased binary limit. Added extra python functions.

* Fixed python

* Made new code MISRA compliant

* Cleaned up ignition. Fixed build

* Fixed health packet

* Fixed CAN mode on black bug. Changed OBD to switch on ELM mode

* Fixes from Github review

* Fixed MISRA issue for pedal

* Fixed failing gmlan tests

* ELM327 safety: allow diagnostic on all buses

* Cleaned up EON relay code

* delete only 3 sectors instead of 11 to allow a new build to be flashed. Much faster to flash

* Removed CAN only can0 output mode. Does not make sense on black panda due to reversibility issues.

* Added heartbeat logic for EON code on panda. Go to NOOUTPUT if EON does not send a heartbeat for 5 seconds.

* Remove all CAN buses live on EON startup. Shouldn't be necessary to have this separate case

* Formatting

* Added file I forgot to push

* Added heartbeat to testing code to make sure EON tests don't fail. Should probably find a better way to do this though. Heartbeat thread didn't work, concurrent USB connection issues...

* Safety: support black panda for Honda Bosch

* Disable OBD2 if setting to NOOUTPUT mode

* Run safety tests for all hw_types

* Fail test if subtest fails

* fix safety tests
2019-07-23 15:07:06 -07:00
Riccardo
e6dc4172b1 Minor indent error 2019-07-07 15:57:14 -07:00
Riccardo
247e128b45 Fix strict compiler on bootstub build 2019-07-07 15:05:47 -07:00
rbiasini
abd841e9be Fix all 16_4 violations (#229) 2019-06-27 15:50:00 -07:00
George Hotz
1f97c2189b refactor pedal bootstub to use llcan 2019-05-23 12:39:22 -07:00
George Hotz
2c1e5f6325 the refactor continues 2019-05-23 12:39:22 -07:00
George Hotz
605bb27bce fix bootstub build 2019-05-23 12:39:22 -07:00
Riccardo
20e8fa9716 Start introducing Bounties 2019-01-17 16:17:53 -08:00
George Hotz
190b4f6841 start work on canflasher 2018-03-10 10:13:30 -08:00
George Hotz
d01c91faae wait up to 15 seconds, and detect rev c in bootstub 2017-08-25 12:02:26 -07:00
Firmware Batman
991ad5be20 add wifi tests 2017-07-30 08:26:48 -07:00
Firmware Batman
9e2d49e225 and fixed a UART noise bug 2017-07-29 19:53:09 -07:00
Firmware Batman
6b9ba40089 remove some dumb prints 2017-07-29 18:16:08 -07:00
Firmware Batman
0ee6e4741c move llgpio to drivers 2017-07-29 17:53:39 -07:00
Firmware Batman
d5e3805671 add uart to spi flasher 2017-07-27 15:54:55 -07:00
Firmware Batman
5630e71813 fixes during vegas trip 2017-07-27 14:33:49 -07:00
Firmware Batman
9a1c1b692f write soft flasher 2017-07-24 15:16:22 -07:00
Firmware Batman
0a5a8ab5ec refactor SPI and make flasher reliable 2017-07-24 12:31:47 -07:00
Firmware Batman
a2523f2d3a clean up flasher 2017-07-24 10:39:08 -07:00
Firmware Batman
66c0ba5ea4 fix bootstub 2017-07-22 14:28:11 -07:00
Firmware Batman
bf57cf25cb make the st ota flasher reliable 2017-07-20 15:34:45 -07:00
George Hotz
7733b09288 Revert commits that broke USB for openpilot.
Revert "fix openpilot board flashing"

This reverts commit 8ff93ad5da.

Revert "Fixed output_enabled led not turning off when mode changed to no output."

This reverts commit 27a8af1107.

Revert "Fixed loopback test for new GMLAN 'can4' behavior."

This reverts commit 59592f599a.

Revert "GMLAN is now always mapped through CAN4 (index 3)"

This reverts commit 329c091024.

Revert "Removed compile time config for CAN loopback, implemented as usb message."

This reverts commit e1a4c32985.

Revert "Change all output safety mode identifier to prevent user mistakes."

This reverts commit 6b363e2e92.

Revert "untabify"

This reverts commit 191f67b083.

Revert "Refactor of safety to support more modular additions of safety policies."

This reverts commit e5b524eddc.

Revert "Split up some more header files into compilation units."

This reverts commit e2a78912f5.

Revert "Enabled emulated control writes over USB."

This reverts commit 133cfe9703.

Revert "Moved CAN and USART code out of main.c and into more appropriate files."

This reverts commit daad2dc062.

Revert "Large Panda CAN cleanup. Restrict GMLAN to valid baud rates."

This reverts commit a0616a2bc2.

Revert "Panda library now correctly sends USB direction bit."

This reverts commit 1712c901d4.

Revert "Board makefile now automatically calculates header file dependencies."

This reverts commit 4a8d4e597b.

Revert "Loopback test works over wifi. (Disable trying to send over wifi)"

This reverts commit dae636968a.

Revert "Fix legacy board build"

This reverts commit 62bf4e5756.

Revert "Style cop"

This reverts commit c439f43726.

Revert "Untabify"

This reverts commit 41e5eec621.

Revert "Fixed disabling gmlan."

This reverts commit 5e1e45a4af.

Revert "Removed dead code, standardized canid in more commands, better erroring behavior."

This reverts commit b59aeb6d87.

Revert "loopback test works with new CAN bus ids."

This reverts commit 75970861cf.

Revert "Large reorganization of code and early integration of can bitrate setting."

This reverts commit a1ed7b62ee.
2017-07-12 11:27:16 -07:00
Jessy Diamond Exum
191f67b083 untabify 2017-07-11 16:55:36 -07:00
Firmware Batman
be7d2ee397 add usb failure mode to st bootstub 2017-05-03 22:28:22 -07:00
George Hotz
8f859ceec6 fix warnings in board build 2017-05-01 22:59:10 -07:00
George Hotz
8fd0d7f01c okay, release stuff is good 2017-04-28 20:13:00 -07:00
George Hotz
7e47cd72b9 make flashing over SPI work 2017-04-28 19:32:09 -07:00
George Hotz
30395e2c7a support serial number fetching 2017-04-28 16:56:40 -07:00
George Hotz
16547a133a add release cert support 2017-04-28 15:06:01 -07:00
George Hotz
61a5690c7b disable bootloader locking for now 2017-04-28 09:29:31 -07:00
George Hotz
34aeb335e8 add bootloader lock support 2017-04-27 20:32:30 -07:00
George Hotz
bdc3a05a93 signature checking works on ST 2017-04-26 10:41:57 -07:00