Commit Graph

1992 Commits

Author SHA1 Message Date
Matthew Kennedy 8cdac4cac0
remove engine pointer passing (#3556)
* some

* more

* more

* the last?!
2021-11-16 04:15:29 -05:00
Matthew Kennedy cb032fb1ea
(void) -> () (#3550)
* static functions with (void)

* more

* Revert "more"

This reverts commit 246e53441f935451437df186ac92d7df26b62fb6.

* s

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-15 13:02:34 +01:00
Matthew Kennedy 145316c497
less macro, more c++ (#3549)
* less macro

* s
2021-11-15 12:44:40 +01:00
rusefi 05820ec92d speed into caninfo 2021-11-13 10:41:23 -05:00
Andrey 78fdd5b9a9 UART pins validation and dynamic alternative function recognition #3536 2021-11-11 21:29:18 -05:00
rusefillc b8ccdfb7d8 todo: smarter online change of CAN settings, kill isCanEnabled with fire 2021-11-06 22:23:06 -04:00
Andrey G e3be563b27
Openblt (#3430)
* Makefile: define BOOTLOADER=1 for linker in case of OpenBLT too

This will reserve first 32K of flash for bootloader.

* OpenBLT: include into build

* board: subaru eg33: add OpenBLT board code

* board: subaru eg33: use OpenBLT

* Board: Subaru EG33: OpenBLT: reuse HAL and CMSIS from OpenBLT submodule

* Board: Subaru EG33: OpenBLT: reuse linker file from OpenBLT too

* OpenBLT for MRE

* OpenBLT: MRE: adjust LD memory map for smallest variat of MCU on MRE

* OpenBLT: enable for MRE

* OpenBLT: disable CRC check of user application

This allows us to use DFU tool to flash main application too.

* hex2dfu: fresh binary for linux

* OpenBLT: extract common part of OpenBLT makefiles to openblt.mk

* OpenBLT: enable CRC check of user application for MRE and EG33

CRC (actually just a summ) of few first vectors is stored at 0x1c
offset. This is reserved vector for Cortex-M3, M4 and M7

* common_make: append OpenBLT CRC to dfu files

This should allow to use DFU to do main application update when
when OpenBLT is used as bootloader. hex2dfu will store same
styled CRC as OpenBLT expects to see in user app.

* OpenBLT reorganization

Move common stuff to hw_layer/ports/

* OpenBLT: proteus

* Proteus: enable OpenBLT for F4 and F7

Compilation tested only
2021-11-05 19:28:55 -04:00
Scott Smith d508d0d7d7
Remove correct file in create_ini_image.sh (#3460) 2021-11-04 16:06:44 -04:00
Matthew Kennedy 75a2b5ef02
Knock retard (#3396)
* output gauge

* knock controller

* don't need that

* inject engine ref

* test knock

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-11-01 23:33:59 -04:00
Andrey G f8c099771e
Linker file typo fix (#3436) 2021-10-31 15:17:56 -04:00
Matthew Kennedy 29ec0a5859
better pch usage and gmock constructors (#3426)
* break out mock constructors

* comment and spacing

* unnecessary compiler options

* happy stepper

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-10-30 20:31:09 -04:00
Andrey G 95099e2c12
STM32F7 linker script: ITCM flash area also needs reserve for BL (#3431) 2021-10-30 09:12:47 -04:00
Matthew Kennedy 558a6d01fc
etb pwm limit (#3408)
* etb pwm limit

* missed an arg

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-10-25 15:35:23 -04:00
Matthew Kennedy da0e4f1823
misc ethernet config parameters (#3343)
* various cfg

* this has to be 1522

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-10-11 15:35:09 -04:00
Matthew Kennedy abb6513744
faster uniform adc cleanup (#3334)
* dead fast tps

* oooooh map avg on hh7

* adc v4 fast support

* new fast API

* hardware.cpp

* adc v2

* warning

* guard

* no check required

* stub cypress/kinetis

* kinetis and cypress stubs

* cleanup

* h7 adc speed

* adc skip

* configurable oversample
2021-10-10 22:59:25 -04:00
Matthew Kennedy e3196a7bbd
ethernet (#3342)
* checksum offload

* ethernet console

* guard flag

* flags

* reserve pins

* f4

* ip and link options

* chibios

* conditional build lwip

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-10-10 01:15:49 -04:00
Matthew Kennedy 31ffb0add4
Fast adc API (#3327)
* dead fast tps

* oooooh map avg on hh7

* adc v4 fast support

* new fast API

* hardware.cpp

* adc v2

* warning

* guard

* no check required

* stub cypress/kinetis

* kinetis and cypress stubs
2021-10-07 08:29:01 -04:00
Andreika bc4a068c9c
[DRAFT] IAC H-Bridge Microstepping (#3213)
* fix for stepperHbridgeHardware

* new config fields for microstepping

* add stepper dir pin mode to the dialog

* refactor stepper hw dialog & add microstepping panel

* microstepper modes enum

* stepperDcInvertedPins needed by Hellen

* add sleep() for stepper and divisor for pause()

* microstepping impl.

* make unit-tests more happy

* small progress

* fix etb-stepper dlg conflict

Co-authored-by: Andrei <andreikagit@users.noreply.github.com>
2021-10-06 13:57:04 -04:00
Matthew Kennedy 9797d25b7c
getOrZero (#3319) 2021-10-05 19:59:07 -04:00
rusefillc b4884498cb OBD error renames 2021-10-03 01:30:42 -04:00
Andrey b41f9d3777 vr threshold test configuration 2021-09-26 03:27:53 -04:00
Matthew Kennedy 8cd132b8a8
dead knock code (#3255)
* more unification

* hip stub

* comment

* guard

* channel idx

* include

* hip

* move in to engine

* hip9011

* dead stuff

* dead

* fsio

* lcd

* more dead
2021-09-21 20:40:20 -04:00
Matthew Kennedy 5de27e0b92
more knock sense unification (#3250)
* more unification

* hip stub

* comment

* guard

* channel idx

* include

* hip

* move in to engine

* hip9011
2021-09-21 17:39:21 -04:00
Matthew Kennedy bf98546314
share some knock logic (#3246)
* knocky knock

* only if TS

* typo

* merge
2021-09-20 16:10:34 -04:00
rusefillc 05d477431d Hellen Nissan defaults are no longer valid #3143 2021-09-05 19:29:40 -04:00
Andrey d8fbd9b40f Hellen Nissan defaults are no longer valid #3143 2021-09-05 15:15:25 -04:00
rusefillc b917394354 my first Lua 2021-09-01 02:37:36 -04:00
rusefillc f47320fd70 my first Lua 2021-08-31 12:32:05 -04:00
Matthew Kennedy 730b26d034
remove old vss implementation (#3208)
* dead vss

* remove
2021-08-28 01:39:55 -04:00
rusefillc 48a009fc33 Revert "Revert "memory savings (#3195)""
This reverts commit 0b3ef5f5
2021-08-27 06:18:05 -04:00
rusefillc 0b3ef5f553 Revert "memory savings (#3195)"
This reverts commit 52a24ee7
2021-08-27 02:32:31 -04:00
Matthew Kennedy 52a24ee773
memory savings (#3195)
* d

* dead code

* all your ram are belong to me

* turn off gpiochips we don't need

* save

* save by using the same file handle

* smaller stack ok

* these can be on the stack

* this is closer

* what about ccm?

* probing available

* now probe ccm

* ccm

* put stuff in ccm

* fsio

* memory usage

* memory
2021-08-26 23:05:31 +03:00
Matthew Kennedy 4603f875cd
missed a little bit (#3192) 2021-08-24 17:00:14 -04:00
Matthew Kennedy a18b86a09b
start allowing ADC change while running (#3100)
* allow re-register of the same sensor

* add api to unsubscribe

* do it for tps

* clear the pin

* happy test

* maybe make afr happy for now

* tests build

* happy simulator

* active configuration

* check valid

* we need vbatt now

* manage all pin init in init_sensors.cpp

* don't need that

* cleanup

* thermistors

* do two phase reinit in the right place

* config vs engine

* finally the tests are happy
2021-08-24 16:41:16 -04:00
alxrMironov f926d2ccba
Vehicle speed switching to frequency sensor #3106 (#3148)
* Add vehicle_speed_converter.h with realization.

* Add test_vehicle_speed_converter.cpp with realization.

* Add test_vehicle_speed_converter.cpp to Makefile

* Edit "VehicleSpeedSensor" from function pointer sensor to frequency sensor

* Fix "VehicleSpeedSensor" init function args

* Remove "VehicleSpeedConverter" empty constructor

* Edit vehicle_speed_converter.h code style

* Fix args and engine injection in "VehicleSpeedSensor" initialization procedure

* Remove old "Vehicle Speed" module initialization

* Revert "Remove old "Vehicle Speed" module initialization"

This reverts commit 100b7caa8c615c20eed3d0c23a49824b4e556148.

* Remove old "Vehicle Speed" module initialization pieces

* Revert "Revert "Remove old "Vehicle Speed" module initialization""

This reverts commit f559a726f1f7f5a7acacd1b6517e571743e84327.

* Debug changes

* Revert "Debug changes"

This reverts commit f7e2be1a8a46c6f3f93f14f002b2f2db539da8e2.

* Another debug changes

* More debug changes

* And more debug changes.

* Revert "Another debug changes"

This reverts commit 914fbb1df42c37e4b5ecbb119bb45e7cffdf4064.

* Revert "More debug changes"

This reverts commit 0b2d96d461c3cd9b0f1ae97ed110b8effe6b0cc6.

* Revert "And more debug changes."

This reverts commit 06ae8daded0e6e1c025e4e5058b47283f4adfe92.

* Add "Vehicle Speed" sensor reconfiguration

* Revert "Add "Vehicle Speed" sensor reconfiguration"

This reverts commit a089a6d563dd710004ce1a7da1744b0b4b90c3b1.

* Revert "Revert "Add "Vehicle Speed" sensor reconfiguration""

This reverts commit 7b2bb8af4b3caa547236ca59e4c4bdb3ac1200cc.

* Debug changes

* Another debug changes

* Fix another debug changes

* Another debug changes 2

* Revert "Another debug changes 2"

This reverts commit cfad55141eec125b2f1d35fb95d9f46b54f666b6.

* Revert "Fix another debug changes"

This reverts commit 9bc2c74a3be6fd896827ff48cf4580e7657529c0.

* Revert "Another debug changes"

This reverts commit 4337ed8cad8dff508d093944eb3f75e9a69e4a77.

* Edit class  FrequencySensor, make it more RAII

* Debug changes

* Debug changes 2

* Debug changes 3

* Revert "Debug changes 3"

This reverts commit 52a7054c122b5157540fe45a055a84b57478d722.

* Revert "Debug changes 2"

This reverts commit dec79fb913344ccb4b8614910ad62e6c129a243e.

* Revert "Debug changes"

This reverts commit eb08d7a529b55ba397a7dd2c154b76eab42f212b.

* Revert "Edit class  FrequencySensor, make it more RAII"

This reverts commit 3a0bb1d3f1dd23c1b04e4cc1c526cfdc67ae86a3.

* Remove VSS pin definition in "Citroen Berlingo" engine config.

This reverts commit 3a0bb1d3f1dd23c1b04e4cc1c526cfdc67ae86a3.

* Remove VSS pin definition in "Dodge Neon" engine config

Co-authored-by: alxrMironov <330OMcorporative>
2021-08-24 00:55:41 -04:00
Andrey G 780e91f38a
Bunch of small fixes related to EG33 board (#3188)
* Typo fix

* flash_main: always allow to write settings to ext NOR while running

* mc33810: do not enable outputs right after undervoltage

Wait for next active signal

* QSPI flash: set correct dummy cycles for fast read command

* board subaru: fix connector pinout. again.

* board subaru: fix SDMMC pin configuration

* board subaru: fix DMA conflict SPI4_RX vs SDMMC2
2021-08-24 07:39:03 +03:00
Andrey G 3961c6ad84
qspi flash updates (#3169)
* ChibiOS QSPI updates

* board: subaru: speed up NOR flash

* QSPI: add fast read commands
2021-08-17 11:06:37 +03:00
Andrey G c23e02c582
Settings ext storage (#3155)
* flash_main.cpp: reorder code for easy integration of ext storage

* Add EFI_STORAGE_INT_FLASH option

Default set to TRUE

* Add ChibiOS's Managed Flash Storage to build

* Add support for QSPI flash (SST26F064A tested)

* board: subaru: enable WSPI and NOR flash drivers

* Add option to save settings on ext flash MFS partition

* board: subaru: store settings on QSPI NOR flash
2021-08-14 09:36:08 -04:00
Matthew Kennedy d9adba2024
everybody is pulldown (#3131) 2021-08-14 09:34:13 -04:00
Matthew Kennedy 045db15dac
implement adc unsubscription (#3149)
* allow re-register of the same sensor

* adc unsub
2021-08-14 15:41:27 +03:00
rusefillc e72277c863 No pins should be restarted for no reason during config change #3151 2021-08-14 06:15:29 -04:00
rusefillc 82da6e43fd No pins should be restarted for no reason during config change #3151 2021-08-14 05:20:12 -04:00
rusefillc b141f83a88 No pins should be restarted for no reason during config change #3151 2021-08-14 04:58:10 -04:00
rusefillc bd410d0c1b No pins should be restarted for no reason during config change #3151 2021-08-14 04:35:43 -04:00
rusefillc 5e663200fd Hellen Nissan defaults are no longer valid #3143 2021-08-12 17:46:10 -04:00
rusefillc 5bf52023e7 Hellen Nissan defaults are no longer valid #3143 2021-08-12 13:44:54 -04:00
rusefillc e07e44fc9a Nissan progress 2021-08-11 18:04:57 -04:00
Matthew Kennedy 0422392ba9
fix vss crash (#3130)
* don't deref null pointer

* error on invalid

* no logic analyzer

* print out function in case of error
2021-08-10 14:20:57 -04:00
rusefillc 333fcfca8c Hellen72: Set the default pin states to input-pulldown instead of input-pullup #2525 2021-08-05 04:53:37 -04:00
Matthew Kennedy d24f1462e2
even more pch (#3112)
* s

* more

* s

* f7
2021-08-04 19:30:52 -04:00
rusefillc c1275af29c reduce chance of invalid CAM setting fix #3105 2021-08-03 22:15:40 -04:00
Matthew Kennedy 25414ebdad
yet more pch (#3068)
* big pch energy

* put back ramdisk stub

* tests are happy

* h743 nucleo

* kinetis

* I love deleting code!

* make stepper happy

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-08-03 22:05:01 -04:00
Andrey fe0ae21a16 unit test for vehicle_speed.cpp fix #3081 2021-08-03 20:22:48 -04:00
Andrey 8fe2d99254 unit test for vehicle_speed.cpp #3081 2021-08-03 19:48:24 -04:00
Andrey faaf547e8b boards file clean-up 2021-08-03 04:06:06 -04:00
Matthew Kennedy 6eab1fe506
s (#3101) 2021-08-02 19:17:17 -04:00
Matthew Kennedy a8eddbccf6
perform extra-step-prevention in the stepper driver itself (#3038)
* perform extra-step-prevention in the stepper driver itself

* isBusy flag

* I am unable to type

* the court of public opinion has decided that greater-equal is correct

* that sets target in steps, not percent

* correct var name

* mock stepper motor

* testable stepper

* build is happy

* helping build
2021-08-02 07:03:57 -04:00
Andrey G c091b18baf
Int flash fixes (#3089)
* STM32F7xx: flash write parallelism settings

Datasheed allows 32bit program operation only for 2.7..3.0
While RM defines wider range...

* Add parentheses to defines

* intFlash: show all errors to user

Currently only erase error was exported to user. Flash write error
was silent. Also define few additional error codes and show it to
user.
2021-08-01 18:26:42 -04:00
rusefillc ac6cb0601c unit test for vehicle_speed.cpp #3081 2021-08-01 12:19:59 -04:00
Andrey 511b5c22dd unit test for vehicle_speed.cpp #3081 2021-08-01 12:09:53 -04:00
Andrey G 435f712e84
Remove outdated option CH_DBG_ENABLE_TRACE (#3087)
Not used since RT5
2021-07-31 07:51:13 -04:00
Andrey d3523e5010 another dead line 2021-07-31 01:37:51 -04:00
Andrey 139c2593d5 dead var 2021-07-31 01:36:50 -04:00
Andrey 7d551a062e RUSEFI MSD to contain bundle-specific URL #2848 2021-07-30 22:47:35 -04:00
Andrey 2dedcb1152 RUSEFI MSD to contain bundle-specific URL #2848 2021-07-30 22:26:30 -04:00
Andrey 2744fa53bc RUSEFI MSD to contain bundle-specific URL #2848 2021-07-30 22:23:52 -04:00
Andrey c601659dc7 RUSEFI MSD to contain bundle-specific URL #2848 2021-07-30 21:45:55 -04:00
Andrey 7888574bf0 RUSEFI MSD to contain bundle-specific URL #2848 2021-07-30 21:18:51 -04:00
Andrey 477dc27992 Wrap PAL driver into universal 'startDigitalCapture' #2123 2021-07-30 20:57:01 -04:00
Andrey 608d5de22f Wrap PAL driver into universal 'startDigitalCapture' #2123 2021-07-30 20:48:26 -04:00
Andrey 54b29c8196 Wrap PAL driver into universal 'startDigitalCapture' #2123 2021-07-30 20:30:52 -04:00
Andrey 50240c6500 Wrap PAL driver into universal 'startDigitalCapture' #2123 2021-07-30 20:15:53 -04:00
Andrey 1ce05e9a02 Wrap PAL driver into universal 'startDigitalCapture' #2123 2021-07-30 20:10:34 -04:00
rusefillc 21a821d751 more details into output 2021-07-30 19:33:31 -04:00
rusefillc 5331daf559 RUSEFI MSD to contain bundle-specific URL #2848 2021-07-30 19:13:43 -04:00
Matthew Kennedy 9b4f8a3a29
flash erase cache invalidate (#3073)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-30 16:52:55 -04:00
Andrey 8c72fdfd93 RUSEFI MSD to contain bundle-specific URL #2848
refactoring and progress
2021-07-30 16:23:01 -04:00
Andrey 4f9b3cc4d0 RUSEFI MSD to contain bundle-specific URL #2848
refactoring and progress
2021-07-30 16:07:37 -04:00
Matthew Kennedy b52d50bbf2
Use pch in lots of files (#3066)
* most engine.h

* most engine_configuration

* more

* more

* more

* more

* more

* moooooore

* ok I'm done for now

* oops
2021-07-26 01:05:17 -04:00
Andrey 17ee26293c todo 2021-07-25 12:45:28 -04:00
Andrey 37247db383 Clutch switch inverted options do not invert detected pedal position
#3044
2021-07-24 18:44:13 -04:00
rusefillc ca34562d5d Clutch switch inverted options do not invert detected pedal position #3044 2021-07-24 15:54:51 -04:00
Matthew Kennedy f70c844c60
H7 ADC triggered by hardware timer (#3028)
* config

* allow changing adc speed

* timer triggered ADC

* ICU on nucleo

* turn that off too

* 10khz

* make those default for all h7

* I can't type
2021-07-23 14:50:35 -04:00
Matthew Kennedy 09192cfc4d
fast adc callback (#3031)
* fast adc callback

* guard

* missed one

* now cypress will be happy
2021-07-23 14:19:59 -04:00
Matthew Kennedy 0f0b84a6db
remove TS file read (#3004)
* remove

* more defines

* test

* lots of java

* s
2021-07-21 14:24:53 -04:00
Matthew Kennedy b28e8348ce
sd card indicators (#3001)
* sd bits

* rusefi.input
2021-07-20 21:29:24 -04:00
Matthew Kennedy c3699f8353
H7 turn off USB before reset (#2999)
* turn off USB before reset

* comment

* add link
2021-07-20 19:39:26 -04:00
Andrey 1447647411 Button to apply nDBANK #2996
still does not work
2021-07-20 15:42:57 -04:00
Andrey 7b44b5f5f3 Button to apply nDBANK #2996
it does not work, i give up for now time to install STM Cube :(
2021-07-20 14:15:58 -04:00
Andrey c93e7e7d3a Button to apply nDBANK #2996 2021-07-20 13:20:34 -04:00
Matthew Kennedy d1941aa38e
osc detector on H7 (#2992)
* detect clock with TIM11 instead of TIM5

* s

* h7 has a different register name

* detect on H7

* cleanup

* comment

* use define

* f4 typo
2021-07-19 21:58:23 -04:00
Matthew Kennedy a0a5d42eed
detect clock with TIM11 instead of TIM5 (#2989)
* detect clock with TIM11 instead of TIM5

* s

* h7 has a different register name

* s

* rename
2021-07-19 18:04:59 -04:00
rusefillc aee2ed4ba4 New hardware testing commands #2978 2021-07-17 13:42:10 -04:00
Matthew Kennedy 2ce7777865
don't require EXTERN_ENGINE in every file (#2969)
* move enginePins

* no more extern engine

* uses

* more

* extern config too

* put this where it belongs

* include correct header

* merge
2021-07-16 18:13:33 -04:00
Matthew Kennedy a62d6743bc
lua hooks for CAN tx (#2967)
* CanTxMessage usable from unit test

* testLuaReturnsNil

* CAN hook and tests

* it helps if parameter names exist

* nameless params

* s

* redefinition of default argument

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-16 14:06:26 -04:00
Andrey 03bb3e3ace trigger signal debug pins - logic level output #2959
test driven development is still amazing
2021-07-15 09:29:14 -04:00
Andrey 74e5eb8bb7 trigger signal debug pins - logic level output #2959 2021-07-15 02:12:57 -04:00
Andrey 5c2477752e all aboard the God object! 2021-07-15 02:00:48 -04:00
Andrey 70cc334eb2 trigger signal debug pins - logic level output #2959 2021-07-15 01:56:04 -04:00
Andrey f3b0310058 trigger signal debug pins - logic level output #2959 2021-07-15 01:49:07 -04:00
Andrey c513e976ed trigger signal debug pins - logic level output #2959 2021-07-15 01:46:30 -04:00
Andrey 23be588af6 trigger signal debug pins - logic level output #2959 2021-07-15 01:28:44 -04:00
Andrey 26481f4c2a progress 2021-07-15 01:18:38 -04:00
Andrey c30064cd15 progress 2021-07-15 01:17:42 -04:00
Andrey b1f721e20b trigger signal debug pins - logic level output #2959 2021-07-15 00:50:29 -04:00
rusefillc b65c4b5612 trigger signal debug pins - logic level output #2959 2021-07-15 00:03:31 -04:00
Andrey 6c8e80285e trigger signal debug pins - logic level output #2959 2021-07-14 23:20:18 -04:00
Andrey 85b9bbaa68 trigger signal debug pins - logic level output #2959 2021-07-14 23:05:51 -04:00
Andrey e721c1768f trigger signal debug pins - logic level output #2959 2021-07-14 22:51:08 -04:00
Andrey a926357a01 making code more testable 2021-07-14 22:37:05 -04:00
Andrey 0f6930471f making code more testable 2021-07-14 22:02:28 -04:00
Matthew Kennedy d475b4721f
Start on HSI clock (#2957)
* chibios uses HSI

* set pll to use HSE

* simplify capture

* even better logging

* string

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-14 15:20:38 -04:00
rusefi 7f8bdf7006 printing autoDetectedPllMValue in console 2021-07-14 12:42:35 -04:00
Andrey 994230be65 trigger signal debug pins - logic level output #2959 2021-07-13 20:15:55 -04:00
Andrey b2f09de277 refactoring - making method available 2021-07-13 19:28:03 -04:00
Andrey f028c4d727 trigger signal debug pins - logic level output #2959 2021-07-13 18:16:32 -04:00
Matthew Kennedy 15353ae3b2
auto detect HSE clock speed (#2952)
* detect hse

* implementation

* these boards don't need to set their own HSECLK

* assertions

* name

* tweaks

* how did this compile?

* s

* biiiig comment

* this script doesn't need to set 25mhz any more

* ....or PLLM

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-12 20:51:35 -04:00
rusefillc 363ef89a20 typo 2021-07-11 10:16:35 -04:00
Matthew Kennedy 7a21f7fbc0
inject (#2938) 2021-07-09 17:02:25 -04:00
Matthew Kennedy 43e6cef77d
more graceful chibios assertion failure (#2859)
* no custom assert hook

* dead

* setjmp/longjmp

* always call tid hook

* tests get threadid

* simulator threadid

* kick

* stubs for kinetis

* make it happier

* noreturn

* oops

* comments

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-07-05 18:18:58 -04:00
Andrey G ca4caf1df8
Chibios-Contrib for stm32 (#2903)
* Add Chibios-Contrib for STM32F/H too

* ports: stm32: add community hal and cmu configs for STM32

* ports: stm32: community: disable CRC driver
2021-07-05 09:53:45 -04:00
Matthew Kennedy 5c60973dd8
Consolidate hwHandleShaftSignal (#2875)
* consolidate trigger input

* merge functions

* comment

* dead

* hw vs. not hw

* stray comma

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-06-28 10:06:22 -04:00
Matthew Kennedy 2475cb283b
warnings (#2862)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-06-25 20:58:38 -04:00
Andrey G 802afaed34
Fixes eg33 (#2838)
* CAN HW: use designated initizalization

* board subaru eg33: set CAN transceiver EN to active state constantly

While FW does not handle CAN transceiver's EN signal
2021-06-20 08:18:16 -04:00
Andrey G a1387d3bd2
Fixes (#2807)
* tle6240: fix Matt's trap

* map: report some default value if no map sensor configured

Othervise user will get "unexpected MAP value" warning

Thread 2 hit Breakpoint 1, validateMap (mapKPa=3121.66162) at ./controllers/sensors/map.cpp:126
126		if (cisnan(mapKPa) || mapKPa < CONFIG(mapErrorDetectionTooLow) || mapKPa > CONFIG(mapErrorDetectionTooHigh)) {
(gdb) bt
 0  validateMap (mapKPa=3121.66162) at ./controllers/sensors/map.cpp:126
 1  0x002717dc in getMap () at ./controllers/engine_cycle/map_averaging.cpp:334
 2  0x0028175a in GetMapWrapper::getMap (this=0x2004214c <mapWrapper>) at ./init/sensor/init_map.cpp:12
 3  0x0028177c in operator() (__closure=0x0) at ./init/sensor/init_map.cpp:20
 4  0x002817a8 in _FUN () at ./init/sensor/init_map.cpp:21
 5  0x002811de in FunctionPointerSensor::get (this=0x20042150 <mapSensor>) at ./controllers/sensors/function_pointer_sensor.h:24
 6  0x002651c0 in SensorRegistryEntry::get (this=0x2003ddf0 <s_sensorRegistry+48>) at ./controllers/sensors/sensor.cpp:111
 7  0x002653e2 in Sensor::get (type=SensorType::Map) at ./controllers/sensors/sensor.cpp:208
 8  0x00261f38 in updateTunerStudioState (tsOutputChannels=0x2003d2e8 <tsOutputChannels>) at ./console/status_loop.cpp:637
 9  0x00262e48 in prepareTunerStudioOutputs () at ./console/status_loop.cpp:900
 10 0x00260914 in TunerStudio::cmdOutputChannels (this=0x20021a64 <tsInstance>, tsChannel=0x2003d4dc <usbChannel>, offset=0, count=340) at ./console/binary/tunerstudio_commands.cpp:24
 11 0x00260584 in TunerStudioBase::handleCrcCommand (this=0x20021a64 <tsInstance>, tsChannel=0x2003d4dc <usbChannel>, data=0x2003d4e1 <usbChannel+5> "", incomingPacketSize=5)
    at ./console/binary/tunerstudio.cpp:701
 12 0x0025fb3c in tsProcessOne (tsChannel=0x2003d4dc <usbChannel>) at ./console/binary/tunerstudio.cpp:537
 13 0x0025fbe2 in TunerstudioThread::ThreadTask (this=0x2003d608 <usbConsole>) at ./console/binary/tunerstudio.cpp:554
 14 0x0025f094 in ThreadController<1200>::StaticThreadTaskAdapter (thread=0x2003d608 <usbConsole>) at ./controllers/system/thread_controller.h:37
 15 0x0020035e in _port_thread_start () at ChibiOS/os/common/ports/ARMCMx/compilers/GCC/chcoreasm_v7m.S:201
2021-06-10 19:39:48 -04:00
Matthew Kennedy a54a5e7f90
convert gpiochips to c++ (#2761)
* core

* basic header

* tests are happy

* tle6240

* tle8888

* 33972

* 33810

* tle8888_req_init

* unused warning

* warning

* unsigned

* 8888 debug

* fix

* don't qualify

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-06-10 04:11:01 -04:00
Matthew Kennedy 526f1f97a0
Assorted todos (#2762)
* gpiochip todos

* fuel computer

* this was already done
2021-05-30 19:23:29 -04:00
Matthew Kennedy 6d19adb24f
remove old config override (#2763) 2021-05-30 13:31:36 +03:00
Andrey G c81b01b47a
mc33810: set ignition outputs to GP mode (#2756)
IGN mode does not want to fire Subaru ignitor
2021-05-29 05:07:04 -04:00
Matthew Kennedy 080d901222
non blocking flash on f7 dual bank 2MB (#2749)
* f7 dual bank flash

* only start thread if necessary
2021-05-29 08:05:29 +03:00
Andrey G dbfe0e0fbc
Flash fix erase check (#2750)
* Fix flash erase error formating

* Flash F7: do magic calculation with local copy of sector number

* Falsh stm32: simplify

* typo?
2021-05-28 20:35:54 +03:00
Andrey 112370ae6c mkfs.fat phase kills gen_config #2736 2021-05-24 15:35:35 -04:00
Andrey 54343b7d74 mkfs.fat phase kills gen_config #2736 2021-05-24 09:04:37 -04:00
David Holdeman 6d4060d824
Doxygen titles (#2728)
* move addRow call

* undo submo bump

* add header titles
2021-05-22 22:10:58 +03:00
Matthew Kennedy 20cef63d32
Lua on f407, try again (#2725)
* lua on f4

* move perf trace to efifeatures

* check that it's defined

* cypress and kinetis

* it would help to define the correct thing

* disable buffer if not used

* we can work with 2k

* turn off ramdisk on mre qc

* wow strncpy is useless for truncated strings

* turn off for bootloader

* lto bootloader

* memory

* memory
2021-05-20 23:05:18 +03:00
Andrey ba758dd5cb refactoring magic constant STOICH_RATIO 2021-05-20 02:36:55 -04:00
Matthew Kennedy 2d5353b3d5
actually fix F7 flash this time (#2719)
* f7 sector sizes

* loop dsb

* correct sector index on f7
2021-05-18 17:40:59 -04:00
Matthew Kennedy 0ea1f15ca3
compile gpiochips as cpp (#2702)
* rename

* core

* structing

* more

* makefile

* structing

* 6240 compiles

* explicit cast instead of implicit narrowing

* 8888

* no extern C

* fix tests build

* extern "C"

* 33810

* 8860

* 33810

* linker

* unbreak master

* don't need that if compiling as C++

* bump config

* fix test

* tests

* unit tests bad merge

* build

* move subaru logic to cpp file

* cpp goodness

* hpp include

* this is probably the right thing to do

* simulator
2021-05-17 08:42:56 +03:00
Andrey G 8ac3de90fd
Hw layer rearrangement (#2705)
* Fix simulator compilation

* HW_SENSORS_SRC -> HW_SENSORS_CPP
2021-05-16 14:11:28 +03:00
Andrey G 710a512fe7
Hw layer rearrangement (#2703)
* max31855: move to sensors

* uart GPS driver: move to sensors and rename

* i2c_bb: move to drivers

* LCD HD44780: move to drivers

* ping?
2021-05-16 06:01:00 -04:00
Matthew Kennedy c2cdc382a3
don't expose private state (#2696)
* don't expose private state

* fix tle init
2021-05-14 14:56:45 -04:00
rusefillc 08de271407 hiding 8888 mess under the rug
making LPS25 one step more available to Hellen
2021-05-14 10:54:40 -04:00
Andrey G 62cbc6db91
Adc fixes (#2691)
* ADC: save few bytes

* ADC: fix limit checking, add note for futher users

* ADC: not used anymore
2021-05-13 15:51:18 -04:00
Andrey G 4178ac61c6
mc33810 (#2684)
* mc33810: ENABLE outputs

* mc33810: enable Dwell time control
2021-05-11 18:17:06 -04:00
Matthew Kennedy f7581b1869
s (#2683) 2021-05-11 15:45:35 -04:00
Matthew Kennedy 370eb0d5a5
no sd if early fatal (#2680) 2021-05-10 14:31:40 -04:00
Matthew Kennedy 5ba7577496
move FSIO aux analog inputs to sensor model (#2669)
* sensor entries

* init

* non-explicit for list init to work

* switch fsio

* no longer need this lua hook

* init
2021-05-09 19:47:37 -04:00
rusefillc 540bb8e327 Revert "lua on f407 (#2646)"
This reverts commit e8855263
2021-05-09 18:25:50 -04:00
Matthew Kennedy e885526308
lua on f407 (#2646)
* lua on f4

* move perf trace to efifeatures

* check that it's defined

* cypress and kinetis

* it would help to define the correct thing

* disable buffer if not used

* we can work with 2k

* turn off ramdisk on mre qc

* wow strncpy is useless for truncated strings

* turn off for bootloader

* lto bootloader
2021-05-09 16:25:38 -04:00
Matthew Kennedy 3f36d488bf
move ADC pin initialization (#2660)
* set the pin in adc subscription land

* remove from adc_inputs

* more subscriptions

* use our lib instead
2021-05-09 14:36:11 -04:00
Matthew Kennedy e0cd96d06d
ini drive contents update (#2665)
* add shortcuts

* move readme

* nozip version of readme

* scripts

* set the filename
2021-05-09 12:18:55 -04:00
Matthew Kennedy 155bfd9aeb
Support STM32F7 1MB devices (#2659)
* modify linker script for 1MB devices

* handle null flash address

* actually support 1MB F7

* comment
2021-05-09 09:19:20 -04:00
Andrey G e18ba01fe5
hip9011 (#2658)
* hip9011: isolate debug stuff

* hip9011: renames

* hip9011: start sensing knockDetectionWindowStart degres from fire

* engine: more realistic values for knock window

* hip9011: remove magic CS toggling

* hip9011: EFI_HIP_9011_DEBUG should depend on EFI_HIP_9011
2021-05-08 18:43:55 -04:00
Andrey G 15811a6ff0
hip9011 (#2654)
* Move HIP states enum out of rusefi_enums.h

-this is internal driver stuff. No need to have it defined globaly.

* Auto-generated configs and docs
2021-05-08 10:08:18 -04:00
Andrey G afcc8848c5
hip9011 update (#2653)
* hip9011: add check for SPI reply in advanced mode

* hip9011: read value over SPI in advanced mode
2021-05-08 09:50:28 -04:00
Matthew Kennedy 8b30776016
remove stateChangeCallback from simplepwm (#2644)
* remove callback parameter from cj125

* remove from ext

* remove stateChangeCallback

* alt doesn't need that

* demorgan

* remove call

* bad cut/paste

* check the actual pin in the test
2021-05-07 09:38:41 -04:00
Matthew Kennedy ca7308e910
move some stuff in to ccm (#2645)
* stuff in ccm

* used memory
2021-05-07 09:35:57 -04:00
Andrey G e6cf82845b
Kill warnings (#2623)
* dead code

* rtc_helper: clean-up warnings

* kill unused
2021-05-04 18:55:27 -04:00
Matthew Kennedy 8ae8484dd9
interactive lua (#2614)
* interactive lua

* unnecessary pop

* print return value

* enable f7 lua

* match f7 chconf
2021-05-03 17:46:12 -04:00
Andrey G 0f4de02223
ADC: internalIndex should be used as getAvgAdcValue argument (#2618)
* ADC: internalIndex should be used as getAvgAdcValue argument

-plus output messages re-formated

* ADC: logger -> efiPrintf
2021-05-03 16:44:19 -04:00
rusefi 92958f1959 Proteus QC build 2021-04-30 13:57:33 -04:00
Matthew Kennedy 830575a306
lua 5.4 (#2590)
* thread priority

* build

* makefile prep

* call startup

* lua 5.1

* mk

* 5.3

* mk

* I guess lua does something?

* extract hooks, builds for tests

* a bit of error handling

* guard

* bootloader makefile

* remove lua

* submodule

* submodule update

* builds with submodule

* disabled by default

* h7 chconf

* tweaks

* add a useful hook

* move luaconf

* perf trace lua

* test helpers

* lua unit tests

* include to satiate clang
2021-04-28 22:41:25 -04:00
Andrey G 6d6dca8d07
Subaru board update (#2600)
* board: subaru eg33: linker script: stack, bss and heap to ram0

* Board: Subaru EG33: clean-up configs

* board-subaru-eg33: fix board config

* engine: subaru: eg33: fixes
2021-04-28 20:25:33 -04:00
Andrey G 8ba38a8a63
Mc33972 update (#2599)
* MC33972: update

-per-instance thread
-enable pull-ups for enabled pins only

* smart-gpio: mc33972: uses 8-bit spi frames

3 bytes are sent to make 24-bit frame
2021-04-28 18:29:35 -04:00
Matthew Kennedy 742ea83bfa
Baro config (#2591)
* adjust API to allow i2c init to fail

* init

* proteus config

* 🎠🎠🎠

* buh

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-27 15:29:22 -04:00
Matthew Kennedy 17719c5da0
prep for lua (#2589)
* thread priority

* build

* makefile prep

* call startup

* s
2021-04-27 07:57:08 -04:00
rusefillc 5b2b77fc50 F429 MCU says it's too cold #2552 2021-04-25 09:11:57 -04:00
shadowm60 61446a6170
Handle can message cyclicity (#2573)
* Handle can message cyclicity

update of canDash to support different cyclicity of messages

* review updates
2021-04-23 20:16:27 -04:00
rusefi 3e44135947 improving QC process 2021-04-22 21:23:20 -04:00
Andrey G a867b3e286
HD44780: start pins on init (#2576)
This fixes bug introduced in 7803968621
Sorry!
2021-04-21 15:33:58 -04:00
Matthew Kennedy a70f113b77
finish it off: remove scheduleMsg (#2575)
* finish it off

* one more logger ptr

* fwd decl

* Revert "one more logger ptr"

This reverts commit a21fb0087ddc748978d716db2710800cf26e437b.

* unused

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-21 15:33:40 -04:00
Matthew Kennedy c26987b96b
Destroy all shared logger (#2574)
* most of shared logger

* a few more

* one more

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-21 14:28:48 -04:00
Matthew Kennedy ad71016862
rip the bandaid: find-replace most of scheduleMsg (#2572)
* biiiig find replace

* more trivial find replace

* pwm

* almost all of them

* few more

* gpio

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-21 12:53:13 -04:00
Matthew Kennedy bd1c84fa62
Logging remove 3 (#2568)
* ts logger

* sensors

* wideband too

* missed one

* init

* motors, pid, etc

* vvt

* more

* idle

* missed one

* dynoview

* launch

* can

* console IO

* s

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-20 14:09:41 -04:00
Matthew Kennedy bbb6b6dd14
remove simple cases of LoggingWithStorage (#2569)
* remove simple cases

* more simple

* serial

* s

* more

* try memory

* easy

* mmc acc

* that's how much memory

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-19 08:11:59 -04:00
Matthew Kennedy 5145ee4b62
logging cleanup 2: sensors, pid, etb, etc (#2567)
* ts logger

* sensors

* wideband too

* missed one

* init

* motors, pid, etc

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-18 20:02:32 -04:00
Matthew Kennedy 6b64db7f9c
rewrite text logging system (#2439)
* minor cleanup

* enable mailboxes

* priority

* implement new logger

* more cleaning

* signature

* remove debug

* put the assertion back in

* remove debugging

* spelling

* doy

* tweaks & comments

* cleaning

* size_t

* guard more

* test build now

* needs more ram until we can remove LogginWithSTorage

* hunt for memory

* bootloader

* unused

* stub simulator

* it would help to get the signature right

* geez kinetis only has 64k ram

* more guarding because kinetis

* that's now very legal and very cool

* templatify

* s

* force null terminate

* probably fix

* const

* write a test

* disable sensor chart for now

* hide SC ui

* oh nope that breaks many things

This reverts commit c3c1bb324fb484c3d9cc44b7715c234bc0392e1e.

* missed one

* reset after scheduleLogging

* we can't print out the full message because it contains commas which break parsing

* force terminate long buffers

* let's see how much memory we have to play with

* a lot, is the answer

* real thread name

* shrink this for now before its deleted

* turn that back on

* biiig comment

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-18 18:46:47 -04:00
rusefillc ad22a00ee8 flush SD log 10x faster #2558 2021-04-15 09:42:22 -04:00
Matthew Kennedy 0eabb0cd07
flush 10x faster (#2558)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-15 09:31:38 -04:00
rusefillc fb133676c3 nothing happens here 2021-04-13 23:32:32 -04:00
Matthew Kennedy eb9cc1a08e
multiple mass storage (#2535)
* driver

* plumbing

* guard adjust

* read correct lun

* de-template

* rearrange

* guard

* guard

* memory

* headers

* memory

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-10 08:35:41 -04:00
Andrey G fa840a7593
hip9011 and friends (#2527)
* engine math: extrant getFiringOrderTable for reuse

* engine math: getNextFiringCylinderId helper

* introduce knock_logic: first member is getCylinderKnockBank()

moved from software_knock.cpp

* hip9011: support two inputs/banks

* fix CI

* Board Subaru EG33: populated with TPIC8101 with Advanced mode

* hip9011: test communication in advanced mode

* hip9011: handle situation when chip is already in advanced mode

* Board Subaru EG33: cylinder to knock bank mapping

* hip9011: count spi transactions in advansed mode too

* hip9011: reset incalid responce counter after chip initialization

* hip9011: make debug output more structured
2021-04-04 18:13:21 -04:00
Matthew Kennedy 33e4b0b721
h7 dfu and comments (#2522) 2021-04-03 21:58:29 -04:00
rusefi 0099b7ce10 explicit status for MSD SD mode 2021-04-03 19:42:54 -04:00
rusefi 1406c16119 SD init: document or fix unlock SPI fix #2516 2021-04-01 16:21:19 -04:00
rusefi 3f1d90992e SD init: document or fix unlock SPI #2516 2021-04-01 16:20:08 -04:00
Matthew Kennedy 1dffcf5729
make board config override actually usable (#2508)
* new function

* hellen

* MRE

* proteus

* put those function declarations in a reasonable place

* put the comment back

* weak

* move that to a reasonable place

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-31 14:46:50 -04:00
Andrey G 3d138958ce
Hip9011 (#2512)
* hip9011: coexistance with other spi devices

* hip9011: rework so SPI transfer is invoked from thread

also use polling spi exchange to avoid cache problems

* hip9011: move calculations from ADC callback to thread

* hip9011: big cleanup

* hip9011: simplify spi communication

* No need to set knockBandCustom if it is not custom

HIP9011 calculates knockBand from cylinderBore same way

* hip9011: make unit test happy

* hip9011: fix unit test

* hip9011: remove duplicated initialization, reorder

* hip9011: just renames and data type adjustments

* hip9011: rename BAND() to HIP9011_BAND()

* hip9011: move some code from lookup.cpp to logic.cpp

* hip9011: move initEngineNoiseTable to engine_configuration.cpp

* hip9011: move lookup tables to hip9011_logic.c

* hip9011: remove empty files

* hip9011: additional checks
2021-03-30 10:56:25 -04:00
Matthew Kennedy ed76e22e1b
speed up boot by 48 ms (#2506)
* speed up boot

* two
2021-03-29 22:59:38 -04:00
Matthew Kennedy 7cd79820da
enable serial pins on proteus (#2507)
* enable serial on proteus

* make h7 happy
2021-03-28 17:03:14 -04:00
Matthew Kennedy f0cf4f38ff
fix multi-serial-port insanity (#2476)
* carve out UART specific

* implement channel

* config cleanup

* use new config

* bootloader

* dead code

* s

* h7 inherits f7

* oops

* ok now it's right

* tests

* cleanup

* call setup

* put that in its own file

* cleanup

* format

* guard

* not needed

* improve guarding

* portable

* allow override of uart mode

* fixes for bootloader

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-28 09:06:36 -04:00
Andrey G bbe3291ccd
hip9011: get callback from spark on each cylinder (#2499)
* hip9011: get callback from spark on each cylinder

* hip9011: cleanup unused
2021-03-27 14:12:49 -04:00
Matthew Kennedy 4e3e95db2d
replace print/printMsg with scheduleMsg (#2497)
* start cleaning

* disabled feature means don't print that it's disabled

* cli

* usages

* printMsg -> scheduleMsg

* this is alllll dead now

* no crlf please

* all hope is lost if you manage to hit this line

* tests

* tests

* ok we did actually need that part

* sim

* d

* kinetis

* it did ifdef, not if

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-26 17:23:26 -04:00
Matthew Kennedy 6491c83f73
read configuration from flash exactly once (#2481)
* early hw init

* s

* read configuration exactly once

* cleanup

* housekeeping

* test friendly

* ugh bad merge

* that is a noop

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-25 18:16:26 -04:00
Matthew Kennedy 31ef22eecb
use cpp (#2493) 2021-03-25 18:12:17 -04:00
Matthew Kennedy 6f05bbc332
move some initialization steps earlier (#2480)
* early hw init

* s

* Revert "s"

This reverts commit 10d3039168613cfb2b0cf1c960d2f18894745ce3.

* bor

* I can't type

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-25 16:22:03 -04:00
Matthew Kennedy 51a5b4d6d5
rename setBoardConfigurationOverrides (#2479)
* rename

* proteus

* comments

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-22 14:15:09 -04:00
Matthew Kennedy c19f8da5d2
fix (#2478) 2021-03-20 22:07:52 -04:00
Andrey G 89b631a794
Hip9011 and cleanups (#2477)
* hip9011: move hipCs out of EnginePins to hip9011 driver

* hip9011: cleanup debug output, save few RAM bytes

* Supress few signed vs unsigned warnings
2021-03-20 08:40:36 -04:00
Matthew Kennedy 2196c7f9e8
embiggen MSD stack (#2475) 2021-03-19 19:56:47 -04:00