Commit Graph

306 Commits

Author SHA1 Message Date
rusefillc 14e8ebd034 would this give me h72 SD? 2021-02-18 16:16:45 -05:00
Matthew Kennedy 8237dd6a41 merge mcuconf for f4/f7 (#2375)
* merge for f4/f7

* more

* include efifeatures

* s

* no TS serial on f7 for now

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-18 15:04:32 -05:00
Matthew Kennedy f9536791f0 set MCU properly (#2371) 2021-02-17 15:25:57 -05:00
Matthew Kennedy c75af2ac75 properly put buffers in no-cache regions (#2357)
* configure for no cache

* this doesn't need a setting

* now we don't need invalidate

* reorder and comment

* mmc

* sw knock
2021-02-15 17:39:11 -05:00
Andrey G b5ebd7e4c4 RusEFI is green: put cpu in standby in idle (#2342)
* MRE is green: put cpu in standby in idle

* Revert "MRE is green: put cpu in standby in idle"

This reverts commit 62b5cadda014ace749b145b629da62b182b5e3ce.

* RusEFI is green on all boards
2021-02-14 10:24:21 -05:00
Matthew Kennedy 5391b4260f automatic switch between internal and MSD SD card (#2349)
* auto enable usb msd

* guard and turn on for proteus
2021-02-14 08:10:39 -05:00
Matthew Kennedy f9e30057fa pullup (#2348) 2021-02-14 08:04:09 -05:00
Andrey G c9ccf021d2 Config cleanups (#2347)
* Remove duplication

* Ports: STM32F7: we want PAL_USE_CALLBACKS for F7 too
2021-02-13 18:45:33 -05:00
Matthew Kennedy e7895f80d5 USB mass storage descriptor (#2330)
* enable msd

* modify descriptors for composite device

* makefile cleanup

* format

* define

* embiggen fifos

* needed that

* cleanup too while we're at it

* rename endpoints

* switchable descriptors

* guard the request hook too

* don't need this changed yet

* cleanup

* update ep0 response

* cleanup

* use the msd hook from chibios

* this was wrong

* this was covered by other PR

* this is also covered

* s
2021-02-13 08:54:08 -05:00
Matthew Kennedy 70eee46e3a fix usb descriptor mistakes (#2340)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-13 01:06:55 -05:00
Matthew Kennedy 56c2315115 Rename USB endpoints, update ChibiOS-Contrib (#2334)
* rename endpoints

* update chibios contrib

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-12 14:21:56 -05:00
Matthew Kennedy b833b58c3f turn in to a composite device (#2332) 2021-02-11 15:52:06 -05:00
Matthew Kennedy adff68748c move chconf/mcuconf/halconf in to hw_ports (#2321)
* move f4 config files

* don't need this

* f7

* f7

* h7

* this was duplicated

* turn off smart build

* loader too

* update prometheus paths

* bootloader should include confdir

* fix the flash size while we're at it

* move chconf_common

* use wait

* normalize board.mk

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-10 19:38:24 -05:00
Matthew Kennedy a3d0b61cf1 get mcu temperature within port (#2326)
* remove EFI_ADC_TEMP_SENSOR

* implement

* comment

* s

* switch adc_inputs over

* header

* s

* I think aligned-on-stack should work ok

* num channels

* cache safety

* move adc init too

* don't compile that file for the h7

* cypress & kinetis

* ports

* guard against bootloader

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-09 22:04:36 -05:00
Matthew Kennedy ff8f24d30c stm32h7 usb (#2319)
* enable

* enable

* serial number

* usb defines

* buffer size

* more stuff we can enable
2021-02-08 16:24:49 -06:00
Matthew Kennedy 8cc6ef83f9 h7 flash, guard against no CAN (#2317)
* h7 flash

* guard some other stuff

* I guess it just builds now?

* maybe ci too
2021-02-08 16:24:38 -05:00
Matthew Kennedy 1a5a3b8a42 consolidate stm32 mpu util (#2314)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-08 15:52:00 -05:00
Matthew Kennedy ad6fc5415d move board.h for f7/h7 (#2316)
* f7 board.h

* h7
2021-02-08 15:46:48 -05:00
Matthew Kennedy 3412d8fe64 move f4 board.h (#2313)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-08 15:29:07 -05:00
Matthew Kennedy 37fa81b5d0 include board.c from hw_ports.mk (#2311)
* set mcu type in hw_ports

* move f4 linker script

* move f7 linker script

* don't set default linker file in makefiles

* extra line

* prometheus actually didn't depend on anything special for f469

* dead line

* h7

* dead

* move board.c

* set explicit cpu type for simulator

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-08 07:52:31 -06:00
Matthew Kennedy c0757a7d13 simplify MCU selection (#2308)
* set mcu type in hw_ports

* move f4 linker script

* move f7 linker script

* don't set default linker file in makefiles

* extra line

* prometheus actually didn't depend on anything special for f469

* dead line

* h7

* dead
2021-02-08 02:11:44 -05:00
Andrey G 04c7ad67aa Some fixes prior to board pull request (#2291)
* ChibiOS: add support for STM32F765

This chip is used on Subaru EG33 p'n'p RusEFI board from Dron_Gus

* drivers: gpio: mc33810: commulative update

- use BIT macro
- fix wake-up method
- fix order of arguments in _add function

* port: stm32f4/7: detectCanDevice check for enabled interfaces only

* ADC: fix internal array size

internalAdcIndexByHardwareIndex should be EFI_ADC_LAST_CHANNEL size
couse adc_channel_e is used as index

* status LEDs: support status LEDs that driven by low level
2021-02-06 12:22:57 -05:00
rusefillc 4936b9fab3 reducing code duplication 2021-02-06 00:46:40 -05:00
rusefillc 83d8bd9369 H7 compilation #2284 2021-02-06 00:37:12 -05:00
rusefillc 7c107a6551 reducing code duplication 2021-02-06 00:25:13 -05:00
rusefillc 0573d29b22 reducing code duplication 2021-02-06 00:18:47 -05:00
rusefillc 3be5714e94 H7 compilation #2284 2021-02-05 23:37:18 -05:00
rusefillc c549a13c1f let's build for h7 2021-02-05 22:10:59 -05:00
rusefillc 5afcb400a7 let's build for h7 2021-02-05 21:09:36 -05:00
Matthew Kennedy 9d86488e07 USB reports real STM32 Serial Number (#2254)
* mpu util data

* implementation
2021-01-30 14:51:11 -05:00
rusefillc cbca40dec0 fixing port I 2021-01-25 00:29:48 -05:00
rusefillc fc15eb979b fixing port I 2021-01-22 23:31:21 -05:00
rusefillc 673de10118 Hellen needs text representation of GPIOI
H7 dreams are asking for J and K
2021-01-22 01:25:05 -05:00
rusefi c0abf52bd8 OMG we are not using java yet?! 2021-01-18 19:00:53 -05:00
rusefi 4dcd8a6308 https://refactoring.com/catalog/replaceMagicLiteral.html 2021-01-18 18:54:18 -05:00
Andrey G 052e2e558b Supress annoing unused warnings (#2216) 2021-01-11 08:49:20 -05:00
rusefillc ef44f47d5b Lcd fix (I hope) #2211
there is still an issue :(
2021-01-09 17:30:39 -05:00
Andrey G 75098a0d4b Lcd fix (I hope) (#2211)
* LCD: check if settings are valid on each access

* Lada Kalina: remove duplicate code

All LCD pins are set to GPIO_UNASSIGNED in disableLCD()

* Remove duplicate code

* We still need to know when invalid gpio is used...

This reverts commit 9c12c4dd44.
2021-01-09 17:16:10 -05:00
rusefillc 9c12c4dd44 dron0gus please help 2021-01-09 15:31:09 -05:00
Andrey G b61ae75fe2 gpio helper (#2195)
* gpios: isBrainPinValid helper

* LCD HD44780: do not touch pins if DM_NONE or invalid gpio

* Fix isEnabled checks for GPS and Joystick

* LCD HD44780: writePad use this method wider
2021-01-08 20:01:26 -05:00
Andrey G f962a7bd64 Gpio cleanup #2 (#1530)
* pin repository: PIN_USED size in now equal to brain_pin_e enum size

expect special values...

* smart gpios: register gpio chip to given base (no auto-allocation)

* drivers: gpio: core: add gpiochip_unregister()

* drivers: gpio: MC33810 intergation

* smart_gpio.cpp: cleanup ifdef mess, minor cleanups

* gpio: core: additional check for gpio ranges overlaps

* unit test: gpio chip: fixed and extended
2021-01-06 18:29:47 -05:00
Matthew Kennedy 6f491cf5c4 switch stm32 scheduling to use PWM driver (#1983)
* move to folder

* extract hardware part of microsecond_timer

* dead ST forum link

* de-volatile

* simulator build

* guard

* switch stm32 to pwm timer

* comments

* f7 mcuconf

* simulator

* guard

* warning

* header, cleanup

* constant

* less magic

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-11 00:44:40 -05:00
Matthew Kennedy eb7a26be14 Port-ify microsecond_timer hardware implementation (#1964)
* move to folder

* extract hardware part of microsecond_timer

* dead ST forum link

* de-volatile

* simulator build

* guard
2020-11-22 20:39:32 -05:00
rusefillc b1510791c5 ADC: fixes: #1979
better error handling?
2020-11-22 13:42:24 -05:00
Matthew Kennedy 2792828dce Remove lockAnyContext, replace with CriticalSectionLocker (#1938)
* switch to CriticalSectionLocker

* that's just about all

* clean up last usage

* include hpp for sim

* need the cpp wrappers in the makefile too

* include dir

* include
2020-11-19 06:56:02 -05:00
Matthew Kennedy 776dd75a8a consolidate to common (#1962) 2020-11-18 16:22:19 -05:00
Matthew Kennedy 786aaf2e3c put getTimeNowLowerNt in to mpu_util (#1950)
* put getTimeNowLowerNt in to mpu_util

* move GPTDEVICE to port_mpu_util

* and remove from efifeatures
2020-11-18 14:17:00 -05:00
andreika-git 2d4d34291c Hellen says fix cypress build (#1818)
* fix compilation

* fresh generated files

* more files

Co-authored-by: Andrei <andreikagit@users.noreply.github.com>
2020-09-23 14:06:22 -04:00
rusefi 889335111a reorder ADC channel index #1763
we forgot about something
2020-09-20 14:20:08 -04:00
rusefi 882c8d8dbf Hellen says merge #1772 helping merge - Kinetis?! 2020-09-09 16:38:18 -04:00
rusefi a3c9871d58 Hellen says merge #1772 helping merge 2020-09-09 14:35:01 -04:00
rusefi 918d987366 Hellen says merge #1772 helping merge 2020-09-09 14:20:54 -04:00
rusefi 03ce326123 Hellen says merge #1772 helping merge 2020-09-09 13:43:18 -04:00
rusefi 81e83d0474 Hellen says merge #1772 more ports 2020-09-09 08:58:12 -04:00
rusefi ae08b287f0 Hellen says ports 2020-09-07 11:57:20 -04:00
dron0gus af0c427a8b Adc cleanups (#1743)
* ADC: remove ADC_TwoSamplingDelay*

1. it is related to double or triple interlived mode only
2. it should be writen to CCR register, not CR1

* ADC: use designated initializers
2020-09-01 07:38:35 -04:00
dron0gus 8ffa7e518f stm32/kinetis_pins.cpp: remove PORTS array - duplicates ports array (#1527) 2020-06-21 15:59:18 -04:00
Matthew Kennedy d13bd0b77c Hardware pwm (#1283)
* hard pwm

* fix, comments

* PC6-9 and PD12-15

* PB6-9

* dynamic frequency

* f7 mcuconf

* format

* relocate to common, support variable frequency

* error handling

* oops

* fix test build

* noop kinetis

* better guards

* guard for bl

* guards don't work if they have typos

* more mapping

* oops

* don't use for slow pwm

* enable pwm

* guard properly

* save a little memory

* use less mem

* correct timers

* all your ram are belong to us

* update limit & comment

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-05-28 16:02:41 -04:00
rusefi 5dc4a6ca71 helping build 2020-05-22 01:14:42 -04:00
rusefi 9dee72cf3e progress 2020-05-21 22:33:48 -04:00
kon ae44c0fce7 Aux serial (#1422)
* aux serial updates from last PR

* trying to guess

* wow that's old! also not working maybe?

* hiding diag code which was messing with GP2/GP3 i.e. TLE8888_PIN_22 TLE8888_PIN_23

* date

* Mc33 undervolt (#1421)

* mc33 flash check

* DI sanity checks for setting HV config

* mc33 under voltage check

* mc33 under voltage check

Co-authored-by: Christopher W. Anderson <gitstuff@pswitch.com>

* fixed {}

Co-authored-by: rusefi <rusefillc@gmail.com>
Co-authored-by: NOx-z <50815960+NOx-z@users.noreply.github.com>
Co-authored-by: Christopher W. Anderson <gitstuff@pswitch.com>
Co-authored-by: kon <dev@triggerdevel>
2020-05-11 12:17:42 -04:00
dron0gus d5a76b5dda Update chibios (#1364)
* Update ChibiOS

* Fix coexistance of ChibiOS and our flash drivers

* Add 'int' = internal prefix for all on-chip flash functions

This avoid conflict with ChibiOS functions available after
enabling HAL_USE_EFL

* Exclude ChibiOS flash driver from bootloader

* Makefile magic?

* Kinetis: fix build after ChibiOS update and switching to SMART_BUILD

* Bootloader now use SMART_BUILD too
2020-04-25 16:32:32 -04:00
rusefi 7fe8a494ef a bit of header clean-up 2020-04-06 13:05:30 -04:00
Matthew Kennedy 214285facc Deduplicate mpu_util headers (#1187)
* this flag did nothing

* header dedupe

* mre fix again

* get all dependencies in mpu_util.h

* guard can/spi

* more dedupe

* pragma once

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-03-13 18:48:22 -04:00
Matthew Kennedy f18e848d9c remove (#1188)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-03-13 17:19:29 -04:00
Matthew Kennedy f513706b53 insert dsb on flash write (#1160) 2020-02-25 23:52:11 -05:00
Matthew Kennedy 3a99dcd6dc move flash addr in to mpu_util (#1123)
* move flash addr in to mpu_util

* this _may_ work

* don't use offsetof

* proper header + defines
2020-02-05 08:06:38 +05:30
Matthew Kennedy c51f3ad303 Dont cache dma buffers (#1110)
* add no_cache

* don't disable cache

* conventions

* formatting
2020-01-29 00:32:43 -05:00
rusefi a5f3b3f33e SCB_DisableDCache rollback 2020-01-25 21:30:19 -05:00
rusefi 5ec42fd6bc F7 SPI challenges 2020-01-24 23:52:56 -05:00
rusefi a222ecdfe1 happy new year unification 2020-01-13 21:57:43 -05:00
rusefi 63e3e84e08 happy new year 2020-01-08 00:02:40 -05:00
dron0gus d218b4e8e6 Spi fixes (#1083)
* spi: add support for SPI4

* mpu_util: spi: add 8BIT mode definitions for F4, F7 and kineris (?)
2020-01-06 08:44:23 -05:00
rusefi 5eae7e50f4 enabling TIM8 ICU 2019-12-25 09:28:51 -05:00
Matthew Kennedy c56bd4cc97 Terrible ADC3 hack for Proteus vbatt support (#1066)
* this is a great idea!

* typo

* simplify

* simplify, cache coherency

* enable adc3 in board file

* copyright

* fix tests, probably
2019-12-17 08:34:56 -05:00
rusefi f47a1a16d1 getting rid of boardConfiguration / binary compatible change 2019-12-11 17:48:55 -05:00
andreika-git 984711655e Kinetis: fix ENABLE_PERF_TRACE and trigger_input_comp (#1031)
* Kinetis: fix ENABLE_PERF_TRACE

* Kinetis: fix trigger_input_comp
2019-11-25 00:22:26 -05:00
rusefi 44c04755d8 not needed since included in common_headers.h 2019-11-23 18:16:41 -05:00
andreika-git 18395f1cb3 Kinetis: smarter SPI_CS control (#993) 2019-11-01 10:50:22 -04:00
andreika-git ef23be6893 Kinetis & TLE8888 compatibility & fixes... (#991)
* TLE8888: More compatibility & postTunerStudioState

* activeConfiguration & EFI_ACTIVE_CONFIGURATION_IN_FLASH fix

* Kinetis: jump_to_bootloader() impl.

* Kinetis: UART baudrate safety check

* Kinetis: OMG!..
2019-10-31 16:06:34 -04:00
rusefi 15ae9b1580 fancy C++ s/NULL/nullptr/ 2019-10-08 01:26:35 -04:00
rusefi ef5a1447e9 CI instability: FATAL error: warn stream not initialized for 6039
also some refactoring
fix #798
2019-08-04 13:48:10 -04:00
rusefi ba52eba47a software jump to DFU #809
very very dark magic it is
2019-08-04 00:21:44 -04:00
rusEfi 8e50546a16 software jump to DFU #809
different assembly magic between F4 and F7
2019-08-03 22:38:59 -04:00
rusefi 0405719770 software jump to DFU #809
bugfix - looks like all the magic was not really happening
2019-08-03 20:45:15 -04:00
rusEfi 475377dcfc DFU command & refactoring 2019-08-03 19:58:38 -04:00
rusefi bf6bbdc190 software jump to DFU #809 2019-07-28 12:33:47 -04:00
rusefi 2da7b3186b helping build 2019-07-28 01:52:14 -04:00
rusEfi d5a8d86b52 build repair 2019-07-28 00:36:47 -04:00
rusefi 3423411cca docs 2019-07-28 00:02:34 -04:00
rusefi caf1150c24 random changes related to
software jump to DFU #809
2019-07-27 20:33:50 -04:00
rusefi d79f8d2ced Ola 960 made some progress towards software jump to DFU #809 2019-07-27 19:51:54 -04:00
andreika-git bdc6915ae3 Kinetis files (pre-alpha) (#890) 2019-07-27 09:52:01 -04:00
rusefi 5d2afd2331 refactoring: better file name 2019-07-06 20:15:49 -04:00
rusefi e309e223aa Refactoring: OS access should be explicit #867 2019-07-04 03:57:21 -04:00
rusefi c21e4c2efa Refactoring: OS access should be explicit #867 2019-07-03 21:01:48 -04:00
andreika-git 9da735654a fix Simulator (#818) 2019-06-02 17:26:35 -04:00
andreika-git e9c383ce7e STM32-specific GPIO refactor (stm32_pins.cpp) (#817)
* stm32_pins.cpp

* PIN_USED & other
2019-06-02 16:48:38 -04:00
rusefi 100f9ccf14 Missing ADC Pins for ADC3, PF port #785
refactoring
2019-05-14 19:04:49 -04:00
rusefi bde091a840 Missing ADC Pins for ADC3, PF port #785 2019-05-14 16:38:14 -04:00
andreika-git 20b6a17695 EFI_CONSOLE_UART_DEVICE, flash->hw_ports, Fix TLE6240 and misc.fixes (#793)
* rename EFI_CONSOLE_UART_DEVICE -> EFI_CONSOLE_SERIAL_DEVICE

* Impl. EFI_CONSOLE_UART_DEVICE

* Move flash source files to ports/stm32/ & hw_ports.mk

* Fix TLE6240

* Fix EFI_NO_CONFIG_WORKING_COPY

* EFI_PRINT_MESSAGES_TO_TERMINAL
2019-05-05 11:06:27 -04:00
andreika-git 4e7715fab2 Add more portability to smart_gpio & SPI (#754) 2019-04-14 13:35:30 -04:00
rusefi fe1f871a69 defined(__DOXYGEN__) ? #748 2019-04-12 20:52:51 -04:00
andreika-git a79175f6ef More portability & small fixes (#719)
* Use hw_stm32.mk

* Fix bootloader

* Use more common hw_ports.mk filename instead of hw_stm32.mk

* More CPU compatibility for Makefile

* TS_UART_MODE & rename TS_SERIAL_UART_DEVICE->TS_SERIAL_DEVICE

* Move lockAnyContext()/unlockAnyContext() to rfiutil.c

* USE_FATFS

* EFI_LCD

* Less compilation errors

* STATUS_LOGGING_BUFFER_SIZE & SETTINGS_LOGGING_BUFFER_SIZE

* EFI_ALTERNATOR_CONTROL, EFI_SERVO, EFI_DISABLE_CONSOLE_ACTIONS

* #ifndef PWM_PHASE_MAX_COUNT & more flexible GPIO inside portname()

* merge

* EFI_ALTERNATOR_CONTROL, EFI_ELECTRONIC_THROTTLE_BODY
2019-03-29 15:29:01 +01:00
andreika-git 2363d1b4ae Fix bootloader (#717)
* Use hw_stm32.mk

* Fix bootloader
2019-03-29 06:46:48 +01:00
andreika-git a3f33f3f0d More compatibility for ADC_inputs, etc. (#716)
* Move STM32-specific ADC pinouts to ports/stm32/stm32_common.cpp

* Move STM32-specific files to ports/*

* setAdcChannelOverrides()

* Add #ifdefs for adc_inputs (PWM_FREQ_*, PWM_PERIOD_*, ADC_*_DEVICE)

* addChannel(), removeChannel()

* fix tle6240 compilation

* Add stm32_common.cpp to Makefile

* More ports/stm32/* paths

* More ports/stm32/* paths

* More flexible GPIO ports

* Add #ifdef for GPTDEVICE

* EFI_BOARD_TEST and EFI_JOYSTICK

* EFI_TLE8888

* Fix HIP9011_logic compilation

* ADC_CHANNEL_SENSOR

* Move ioportid_t PORTS[] to ports/*

* Fix simulator
2019-03-28 22:46:10 -04:00