Commit Graph

34 Commits

Author SHA1 Message Date
Robbe Derks dec9223f97
cuatro sound (#1861)
* fake siren works

* this receives something

* microphone in SAI1 POC

* this receives audio again

* double buffer DMA?

* RX DMA works

* wip

* needs cleanup, but this plays

* cleanup of playback

* print mic

* deal with stereo in

* the DMA from SAI1 -> SAI4 doesn't work yet

* this puts mic data in a buf

* this gets sound to the 845

* wip: still garbage from the mic

* inefficient, but it does record the mic

* sine isn't used

* comment out mic for now

* fix misra

* remove mic

* more cleanup

* add amp enable/disable

* no more debug

* newline

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-11-13 16:09:13 +01:00
Maxime Desroches 93aedd987b
misra8.4: board/boards (#2021)
* boards

* revert

* includes
2024-09-16 14:07:21 -07:00
Robbe Derks 080e53f04d
Cuatro fan (#1999)
* cuatro fan debugging

* fix

* faster fan, faster interrupts

* fix comment

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-08-18 17:43:27 -07:00
Adeeb Shihadeh 01c54d1199
enable misra-c2012-11.8 (#1916)
* fix up harness_config definition

* enable misra-c2012-11.8
2024-03-24 12:38:25 -07:00
Adeeb Shihadeh de061e4f73
remove rest of gmlan (#1908)
* remove rest of gmlan

* fix

* update struct

* update
2024-03-21 13:56:36 -07:00
Adeeb Shihadeh 6dfd4db4ab
remove rtc (#1897)
* remove rtc

* fix build

* rm taht

* revert that
2024-03-11 16:08:43 -07:00
Robbe Derks 3cd0023bc1
cuatro power readout (#1869)
* refactor voltage / current reading

* fix bug and add readout to cuatro

* fix misra?

* just suppress then

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-02-15 13:49:06 -08:00
Adeeb Shihadeh 93a06f1257
remove HW GMLAN support (#1848) 2024-02-03 23:18:33 -08:00
Adeeb Shihadeh a0ac220b0c it's cuatro 2024-01-24 13:07:47 -08:00
Adeeb Shihadeh a2d5d8ad07
stm32h723 (#1832)
* booting

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-01-23 23:15:59 -08:00
Adeeb Shihadeh 7c613fdcb5
remove redundant board_type (#1833)
* remove redundant board_type

* fix jungle build
2024-01-23 22:08:22 -08:00
Adeeb Shihadeh 6eb89cefdf
board: remove set_phone_power (#1747) 2023-11-25 13:17:08 -08:00
Adeeb Shihadeh 666a462450
remove low level LIN support (#1744) 2023-11-23 17:18:25 -08:00
Adeeb Shihadeh a1d699b87d
SOM boot recovery (#1712)
* reset

* simpler

* only once per panda boot

* cleanup

* also check serial
2023-11-09 18:01:46 -08:00
Adeeb Shihadeh d2ea9ad293
refactor bootkick (#1690)
* bootkick refactor + reset

* simplify

* revert reset stuff

* cleanup

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-11-08 22:54:55 -08:00
Adeeb Shihadeh c66b98b2a6
finish esp/gps removal (#1559) 2023-08-06 12:29:54 -07:00
Adeeb Shihadeh 6b9b448259
log device boot time (#1503)
* log device boot time

* misra

* only log real boots

* set gpio

* true

* initial

* log bootkick

* fix RPv2

---------

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Igor Biletksyy <bs@privacy.im>
2023-07-12 20:34:46 -07:00
Robbe Derks 2c937656cf
Continuous harness detection (#1402)
* read in mV and make threshold board-dependent

* refactor and add SBU voltages to health

* refactor relay driving

* more refactoring and readout lock

* avoid race condition

* fix misra

* continuous detection

* 1Hz is fine

* another race condition

* use harness detection to trigger bootkick

* update orientation detection test

* more in-depth harness tests

* fix ignition

* fix

* raise threshold
2023-05-08 13:30:23 +02:00
Robbe Derks fea1feb598
ADC cleanup (#1401)
* cleanup function names

* cleanup voltage reading

* define constant

* fix misra

* remove comments
2023-05-04 13:22:01 +02:00
Robbe Derks c0aea3273a
Tres: fan cooldown + no stall recovery (#1287)
* add fan cooldown

* refactor to be inside the fan driver

* fix rebase

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-03-16 14:15:43 +01:00
Igor Biletskyy 75792fb255
Fix different ADC scales (#1288)
* different ADC scales

* add HITL

* we had it, remove
2023-03-14 14:49:39 -07:00
Robbe Derks 796d771912
Enable control over the fan on C3 while still in the bootloader (#720)
* GPIO control over the fan from ABL

* fixes

* leave this todo

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-02-08 16:01:14 +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
Adeeb Shihadeh c075050d5d Revert "F4: cleanup clock source (#1160)"
This reverts commit f0f67ccf85.
2022-11-21 20:31:01 -08: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 c75c276301
add has_spi board property (#1153)
* always spi for h7

* disable for now
2022-11-13 19:57:20 -08:00
Adeeb Shihadeh 49e2034098
tres (#1130)
* tres

* pull out chiplet

* add to python lib
2022-11-03 16:34:18 -07:00
Igor Biletskyy fd226de0a4
board struct: add has_canfd (#1072)
* add

* gate this

* and this

* forgot white
2022-09-16 21:56:48 -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
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 14d7310784
Enable RTC for all pandas (#849)
* rename has_rtc and add rtc_init for panda boards

* change rtc_init
2022-02-09 15:36:37 -08: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