Commit Graph

896 Commits

Author SHA1 Message Date
Kevin O'Connor 2b7d0bba42 stm32: Add option to disable SWD on GigaDevice STM32F103 clones
Tested by @FotoFieber.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-25 10:15:58 -05:00
adelyser 4eeb4620cd stm32: Add USBOTG support to stm32h7
Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-21 08:12:32 -05:00
Kevin O'Connor 8b401382f6 stm32: Enable SPI on stm32h7
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-20 18:26:52 -05:00
adelyser 3ac354088a
stm32: Add stm32h7 SPI support (#4850)
Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
2021-11-20 18:23:23 -05:00
adelyser b480734c88 stm32: Add STM32H743 support
Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-20 18:11:02 -05:00
Kevin O'Connor 7b69ef0750 stm32: Limit stm32h7 chips to 400Mhz
Don't go above 400Mhz as otherwise it causes 32bit rollover issues.
(Parts of the code expect a rollover will not occur faster than 10
seconds.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-20 18:11:02 -05:00
Kevin O'Connor bb08dc7ae9 atsam: Add get_pclock_frequency() helper function
Add get_pclock_frequency() and use it to calculate peripheral clocks.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-20 13:52:16 -05:00
Alex Maclean 92ca111986 atsam: Fix I2C bitrate
Multiplying the desired bitrate by 4 results in half the
desired period and thus twice the desired bitrate.

Signed-off-by: Alex Maclean <monkeh@monkeh.net>
2021-11-20 13:28:35 -05:00
Alex Maclean 01a223393e atsam: Don't enable USB FS clock on SAM3
This clock is only needed for low-power operation mode,
and wasn't correctly configured anyway (should be 48MHz).

Signed-off-by: Alex Maclean <monkeh@monkeh.net>
2021-11-20 13:28:35 -05:00
Alex Maclean c55a94001f atsam: Don't bother disabling DMA for UART
PDC is not enabled by default so no need to disable it

Signed-off-by: Alex Maclean <monkeh@monkeh.net>
2021-11-20 13:28:35 -05:00
Alex Maclean e2133a7301 atsam: Don't set unused bits in UART
The CHRL and NBSTOP bits are not present
in the UART peripheral, only the USART.

Signed-off-by: Alex Maclean <monkeh@monkeh.net>
2021-11-20 13:28:35 -05:00
adelyser a5ec751406
stm32: Add UART4 to stm32h7 (#4848)
Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
2021-11-19 10:27:56 -05:00
Kevin O'Connor 59314d99e0 sched: Move last_insert check for improved gcc code layout
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-09 20:20:24 -05:00
Eric Callahan a0615e5e17 stm32f4: reset peripherals in enable_pcclock()
Reset peripherals to after enabling to clear stale
registers set by the bootloader.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-11-08 20:10:51 -05:00
Eric Callahan bf9d497ab0 stm32f4: reset peripheral clocks on init
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-11-08 20:10:51 -05:00
Kevin O'Connor d4aee4f55e mcu: Make a minor change to the protocol to require mcu update
Commit 9ecddd1b fixed a serious error (introduced in 7d95a004).  Force
a protocol version change so users are aware of the need to update the
mcu code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-06 18:47:44 -04:00
Kevin O'Connor 9ecddd1ba4 sched: Fix scheduling bug in repeat scheduler check
Commit 7d95a004 introduced a defect - if the cached timer pointed to
by last_insert did not reschedule itself then the cache would not be
in a valid state and other active timers may not get properly
rescheduled.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-06 00:19:48 -04:00
Kevin O'Connor dccd555409 stepper: Move min_next_time check to stepper_event_full()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-04 12:06:27 -04:00
Kevin O'Connor 689231df3a stepper: Add support for stepping on both edges of a step pulse
Add an optimized step function for drivers that support stepping on
both rising and falling edges of the step pin.  Enable this
optimization on 32bit ARM micro-controllers.  Automatically detect
this capability in the host code and enable on TMC drivers running in
SPI/UART mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-04 12:06:27 -04:00
Kevin O'Connor 4acfd8d7c8 stepper: Make step pulse duration customizable at run-time
Remove the STEP_DELAY Kconfig option and replace it with a per-stepper
step_pulse_duration printer.cfg config option.

The AVR code will continue to have optimized code to step and "unstep"
in the same function (which is automatically activated when the step
delay is 40 ticks or less).  This change removes the Kconfig option
for single function step/unstep on 32bit processors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-04 12:06:27 -04:00
Kevin O'Connor 913d099261 linux: Use Unix signals to notify when a timer is pending
Use Unix signals in software timer implementation.  This makes the
code a little more efficient.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-11-02 13:27:51 -04:00
Kevin O'Connor 85d0ef974c stm32: Remove gcc -mfpu=fpv4-sp-d16 floating point option
The floating point unit must be enabled in order to use it and Klipper
does not currently implement that.  Newer versions of gcc may spill
registers to the floating point unit causing failures.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-30 01:10:50 -04:00
Kevin O'Connor 45d4970712 atsam: Remove gcc -mfpu=fpv4-sp-d16 floating point option
The floating point unit must be enabled in order to use it and Klipper
does not currently implement that.  Newer versions of gcc may spill
registers to the floating point unit causing failures.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-30 01:10:15 -04:00
Kevin O'Connor 2692e493c8 atsamd: Remove gcc -mfpu=fpv4-sp-d16 floating point option
The floating point unit must be enabled in order to use it and Klipper
does not currently implement that.  Newer versions of gcc may spill
registers to the floating point unit causing failures.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-30 01:05:47 -04:00
Kevin O'Connor 260f999b87 stepper: Remove unused SF_LAST_RESET flag
Tracking of the last reset is no longer needed after commit 8f76e53c.
Remove the code tracking that status and remove the flag definition.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-27 19:15:40 -04:00
Kevin O'Connor 7d95a00458 sched: Add repeat reschedule optimization
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-27 12:18:28 -04:00
Kevin O'Connor c015c0708f sched: Place common global variables into a struct
Some architectures do better if the global variables accessed from the
timer dispatch code are in a struct.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-27 12:18:28 -04:00
Kevin O'Connor 627c1c5d2a rp2040: Add barrier() around all memcpy() calls in usbserial.c
Make sure gcc doesn't reorder any of the memcpy() calls to the usb
data ram.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-27 11:16:34 -04:00
Lasse Dalegaard de33180236 rp2040: add barrier in usb_read_ep0_setup
Some versions of gcc, in some cases, decide that it is OK to move the
read to `INTR` to right after clearing the `SETUP_REC` bit of
`SIE_STATUS`, instead of after the `memcpy`.

The rp2040 datasheet doesn't appear to say anything about how quickly
the `SETUP_REC` bit will be cleared in `INTR`, but regardless the
compiler should not be re-ordering the read like this.

Here we force the correct ordering using a memory barrier.

Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
2021-10-27 11:10:17 -04:00
Kevin O'Connor 823fdc9cb4 command: Make command_add_frame() and command_encodef() static
The only users of these two functions are in command.c so they can be
declared local to that code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-21 01:25:17 -04:00
Kevin O'Connor 92e1481a52 pru: Perform message encoding on pru0 to free space on pru1
Copy the parameters of calls to console_sendf() on pru1 to pru0 and
then call that function on pru0.  Although copying the parameters is a
"hack", the code size reduction is notable.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-21 01:25:17 -04:00
Kevin O'Connor 1e226a8893 stm32: Add a MACH_STM32F0x2 alias for F042 and F072 chips
The F042 and F072 chips are in the same series and the code should be
nearly identical for these chips.  Implement the alias and enable USB
for the F072 chips.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-13 11:25:41 -04:00
Kevin O'Connor 50f51d8aa2 stm32: Rework HAVE_GPIO_HARD_PWM in Kconfig
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-13 11:04:56 -04:00
Kevin O'Connor 97d36ac451 stm32: Change stm32f0 OSPEEDR to "medium" speed
The previous OSPEEDR value of 0x2 was copied from the stm32f4.c code,
but the stm32f0 interprets that value the same as 0x0 - which is "low"
speed.  Change the OSPEEDR value to "medium" speed so that it matches
the configuration of stm32f1 chips.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-12 13:43:31 -04:00
Kevin O'Connor 1b801508ba stm32: Add comments to configuration of OSPEEDR gpio speed
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-12 13:32:46 -04:00
Kevin O'Connor 9d9fe3cb1b stm32: Rework #if pin definition clauses in hard_pwm.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-11 21:43:56 -04:00
jrhelbert dbafeb8876
stm32: Adding Hardware PWM support for the STM32F4 processors (#4693)
This change has been expanded to include all STM32F4 processors, since they share a common TIMER mapping with some processors just not having all of the timers and pins.

Signed-off-by: Jerome Helbert <jerome@helbert.net>
2021-10-11 16:31:27 -04:00
Manuel Fichtner 5d52a3b19f
config: Anycubic Vyper (#4740)
This commit contains a configuration for the Anycubic Vyper printer from 2021.
It uses a clone of the STM32F103 chip named GD32F103.
There are 2 Mainboard versions out there v0.0.5 and v0.0.6, this config has
been tested with the v0.0.6 only. It should probably work for v0.0.5 as well
since there are no different changes in the Anycubic Marlin firmware.
The LCD is not supported yet (might work, but didn't try yet).

Signed-off-by: Marc Neuhaus <marc@neuhaus.nrw>
Signed-off-by: Manuel Fichtner <manuel.fichtner@me.com>
2021-10-11 16:26:14 -04:00
Simon Kühling d90da37433 atsamd: Add i2c_read() implementation
Signed-off-by: Simon Kühling <mail@simonkuehling.de>
2021-10-06 21:27:51 -04:00
Kevin O'Connor e3905eb241 stm32: Add an MACH_STM32F4x5 alias for F405, F407, and F429 chips
The F405, F407, and F429 chips are in the same series and almost all
code definitions should apply to all chips in that series.  Implement
the alias and fix defintions in adc.c and Kconfig that were only
applying to a subset of that series.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-06 19:56:46 -04:00
D4SK c1136bef10 stm32: Add hardware pwm for stm32h7
Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-06 18:20:29 -04:00
D4SK 0a55489e2c stm32: Add initial support for stm32h7
Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-06 18:20:29 -04:00
D4SK 28b3c9e88c armc_boot: Support cortex-m7 chips
Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-06 18:17:06 -04:00
D4SK a05650f33c armcm_irq: Support cortex-m7 chips
Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-06 18:17:06 -04:00
Kevin O'Connor 8cf1b51223 linux: Support spidev4 through spidev7
The rpi4 has additional spi devices.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-09-15 11:06:10 -04:00
Kevin O'Connor 22167f9510 adxl345: Compress each sample from 6 bytes to 5 bytes
Transmit data from mcu to host using 5 bytes per sample and up to 10
samples per message block.  This improves bandwidth efficiency.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:25:50 -04:00
Kevin O'Connor e34137582d adxl345: Implement timing via new adxl345_status messages
Query the adxl345 message counter every 100ms so that accurate timing
can be obtained during measurements.  This allows the adxl345 data to
be exported with timestamps while captures are running.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:25:50 -04:00
Kevin O'Connor 3f46609c1d usb_cdc: Increase USB transmit size
Increase the transmit buffer size to better support bulk transmission
of sensor data.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-30 12:12:11 -04:00
Michael Kurz efbb704522 lpc176x: Fix wrong inital value at PWM setup
This fixes a PWM going to full scale output when a initial value != 0 was
given. The output was on 100% until another update occurred.

This change enables the PWM counter before setting the channel values.

Fixes KevinOConnor/klipper#4559

Signed-off-by: Michael Kurz <michi.kurz@gmail.com>
2021-08-23 21:29:29 -04:00
Kevin O'Connor 7fddc5a8fa avr: Fix typo causing broken gpio mappings
Commit 070fac07 had a typo causing two PINE definitions to be added to
the list of available GPIOs.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-15 09:48:33 -04:00
Kevin O'Connor 070fac0702 avr: Define PORTE on atmega328p
The atmega328pb supports PORTE, but the current avr-libc toolchain
doesn't support the atmega328pb.  So, for now, add support for PORTE
to atmega328p.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-14 22:00:17 -04:00
Kevin O'Connor cf3c7cd99a avr: Rename the analog-only PE0/PE1 pins on atmega168/328 to PE2/PE3
The atmega328pb has officially named these pins as PE2 and PE3, so use
that naming scheme instead of the previous Klipper invented names.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-14 22:00:17 -04:00
Kevin O'Connor 0971a8c2e1 stm32: Support PB7/PB6 for USART1 on stm32f0
Add support for USART1 on PB7/PB6.

Remove STM32_SERIAL_USART1_ALT_PA15_PA14 option and allow all serial
mappings to be used on stm32f031.

Reported by @Desuuuu.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-08-01 13:46:31 -04:00
Simon Hawkenson 698ca1d0ae
stm32: Add 16KiB bootloader option for STM32F103 (#4493)
The Eryone ER-20 is a STM32F103 based 3D printer which ships with a 16KiB bootloader. Their official version of Marlin starts at 0x08004000.

Signed-off-by: Simon Hawkenson <simon@hawkenson.ca>
2021-07-15 14:09:56 -04:00
Lasse Dalegaard 84523f2811 rp2040: implement SPI
This implements SPI for the rp2040 target. All output groupings of both
SPI blocks are available for use.

Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
2021-07-15 13:30:20 -04:00
Lasse Dalegaard 28f60f7ef6 rp2040: hardware PWM support
This implements hardware PWM support for the rp2040. The maximum
value(100% duty) is set to 255 to match the other controllers. Cycle
time is clamped automatically, and uses the full 8.4 fractional range of
the rp2040 PWM block. This allows a maximum PWM frequency of 490kHz and
a minimum frequency of 1915 Hz.

Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
2021-07-09 11:23:48 -04:00
Henky Prayoga 4802c6d86a
stm32: Allow STM32F401 boards to use STM32 HID Bootloader (#4461)
Signed-off-by: Henky Prayoga <henky.prayoga@callysta-engineering.com>
2021-07-09 11:20:30 -04:00
Kevin O'Connor f2b4d353d8 rp2040: Add _ramfunc macro to internal.h and use in bootrom.c and chipid.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-04 12:45:27 -04:00
Lasse Dalegaard ba958468b7 rp2040: add chipid support
The rp2040 doesn't have a chip ID, but the flash chip connected does. We
can get this ID by asking the flash chip directly, but doing so requires
disengaging the XIP layer, performing the interrogation of the flash
chip, and then re-enabling the XIP layer. This gives us a 64-bit unique
ID that we can use as our USB serial number.

Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
2021-07-04 12:43:45 -04:00
Lasse Dalegaard 0597210cb9 rp2040: support usb_request_bootloader
Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-04 11:30:19 -04:00
Lasse Dalegaard bb2f27f928 rp2040: remove unused linker option
In binutils 2.36 and above the -nostartfiles option is no longer
ignored. -nostartfiles is actually a gcc option, and so isn't supported
by ld. Earlier versions of binutils however had less error checking, and
thus just ignored the option.

Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
2021-07-04 16:36:52 +02:00
Kevin O'Connor c5667193c9 rp2040: Initial USB support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-04 10:11:02 -04:00
Kevin O'Connor 59fe878241 rp2040: Add initial adc support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-04 10:11:02 -04:00
Kevin O'Connor 045bfa4e8d rp2040: Add initial support for the rp2040 mcu
Support the rp2040 (as tested on a Raspberry Pi Pico board).  This
adds basic uart, timer, gpio, and watchdog support.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-04 10:11:02 -04:00
Kevin O'Connor 1b79ffcad2 lcd_st7920: Check CONFIG_MACH_AVR for slow mcus
Use CONFIG_MACH_AVR instead of CONFIG_CLOCK_FREQ to check for slow
mcus.  Some fast MCUs do not export a high clock frequency.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-04 10:11:02 -04:00
Kevin O'Connor b55703d837 Makefile: Allow CONFIG_HAVE_GPIO_BITBANGING when not CONFIG_HAVE_GPIO_SPI
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-04 10:11:02 -04:00
Kevin O'Connor 1e11b76379 usb_cdc: Add comments on debugging USB connections via UART
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-07-04 10:11:02 -04:00
henrikssn 430578957f
stm32: Add support for STM32F072 (used in the TurboCAN board) (#4412)
* Add menuconfig option for stm32f072
* Add support for internal temp of stm32f072
* Share the temperature calculation logic between stm32f0x2 MCUs

Signed-off-by: Erik Henriksson <erikhenrikssn@gmail.com>
2021-06-27 20:35:34 -04:00
github@matthewlloyd.net 23f466bfce config: Add configs for Prusa Buddy and Mini+
Signed-off-by: Matthew Lloyd <github@matthewlloyd.net>
2021-06-14 12:37:34 -04:00
Kevin O'Connor 05c2d51a12 trsync: Introduce new "trigger synchronization" support
Separate out the stepper stopping code from endstop.c into its own
trsync.c code file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-06-09 18:58:35 -04:00
Sergey Alirzaev c19d1fbb59 Makefile: Include debug symbols in the .elf
Signed-off-by: Sergey Alirzaev <zl29ah@gmail.com>
2021-06-08 19:29:16 -04:00
Kevin O'Connor bd65c37ed5 atsamd: Add support for 25Mhz crystals
Needed for the Duet3 Mini 5+ board.  Reported by @lukeslaboratory.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-06-04 17:48:21 -04:00
Kevin O'Connor 6266e7c259 atsamd: Fix pll reference in samd51 config_dpll()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-06-04 17:02:17 -04:00
Kevin O'Connor d619796495 Revert "linux: Raise an error if configuring a pullup when that is not supported"
This reverts commit 70ea0806d9.

The above commit breaks software spi on linux hosts.  Revert that
commit until an improved error check can be implemented.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-27 11:33:24 -04:00
Kevin O'Connor 4ea434796b stm32: Support spi1 on PB4/PB5/PB3 on stm32f103 and stm32f2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-26 00:04:30 -04:00
Kevin O'Connor f99dca0918 stm32: Allow alternate USART1 and USART2 ports on stm32f1 and stm32f2
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-25 23:50:28 -04:00
Kevin O'Connor 273106358d stm32: Reorganize stm32f1 pin remap handling
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-25 23:50:28 -04:00
Kevin O'Connor 12acb99a38 stm32: Fix USART3 on stm32f1 and stm32f2
Commit 6a3c357a incorrectly disabled support for USART3 on stm32f1 and
stm32f2 - restore that support.

Also, add support for USART3 on PD9/PD8 on stm32f103.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-25 22:13:09 -04:00
Kevin O'Connor b1f6a608c3 lpc176x: Add support for serial on UART3 P4.29/P4.28
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-25 12:58:26 -04:00
Kevin O'Connor ce8fe615ed lpc176x: Move pin definitions together in serial.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-25 12:44:13 -04:00
Kevin O'Connor 6a3c357a50 stm32: Add alternate serial ports on stm32f4
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-24 21:17:51 -04:00
Kevin O'Connor c1e8ee58e7 stm32: Include pin names in STM32_SERIAL_USART?_ALT kconfig symbols
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-24 21:06:04 -04:00
Kevin O'Connor 338bc82d0b stm32: Allow 32KiB bootloader on stm32f446
Useful on the Octopus board.  Reported by @bigtreetech.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-20 19:12:09 -04:00
Kevin O'Connor 1ed67120cd debugcmds: Remove start/end_group commands
These commands were never used by the main code and are not
particularly helpful for debugging.  Remove them to reduce code size -
in particular on the pru architecture.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-07 13:53:47 -04:00
Kevin O'Connor bde6215c3f stm32: Enable ADC3 pins on stm32f446
Reported by @bigtreetech.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-06 12:43:13 -04:00
Kevin O'Connor 45cd3543e3 lpc176x: Use full peripheral clock speed; fix UART interface
Commit ae89a659 caused a regression in the lpc176x UART handling.
After that commit the UART clock divisor would need to be 6.25 on
lpc1768 or 7.5 on lpc1769, but the code only supports whole numbers.

Set the PCLKSELx registers at startup and return to using full speed
peripheral clocks.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-05-04 20:29:48 -04:00
Wilhelm Schuster 1fb091c4fa stm32: Allow selecting bootloader size for STM32F446
Signed-off-by: Wilhelm Schuster <ws@rot13.io>
2021-05-03 14:36:18 -04:00
Kevin O'Connor edea52863a endstop: Report trigger time in endstop_query response
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-04-30 11:40:37 -04:00
Kevin O'Connor 470b1e2e46 adxl345: Use "clock" suffix instead of "time" in commands
The debugging code knows how to handle fields that end in "clock".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-04-30 11:40:37 -04:00
Kevin O'Connor b611e72a19 pulse_counter: Use "clock" suffix instead of "time" in commands
The debugging code knows how to handle fields that end in "clock".

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-04-30 11:40:37 -04:00
Kevin O'Connor 8f76e53c0e stepper: Remove min_stop_interval from mcu code
Now that the host never uses a min_stop_interval, remove it from the
mcu code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-04-30 11:26:19 -04:00
Kevin O'Connor 70ea0806d9 linux: Raise an error if configuring a pullup when that is not supported
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-04-25 11:54:11 -04:00
Kevin O'Connor 3dadcd3614 linux: Minor formatting, variable name, and error reporting changes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-04-25 11:12:46 -04:00
Michael Kurz 308f0338cf lpc176x: Add i2c_read functionality
This adds the i2c_read command to the lp176x MCU.

Signed-off-by: Michael Kurz <michi.kurz@gmail.com>
2021-04-25 10:37:28 -04:00
pkElectronics dd7085cbca
stm32: Added mcu temperature support additional mcu (#4211)
Enabled MCU_Temperature sensor for STM32F405 based boards

Signed-off-by: Pascal Wistinghausen <pascal.wistinghausen@ib-wistinghausen.de>
2021-04-25 10:35:15 -04:00
Kevin O'Connor acd94909bc linux: Don't use timer_repeat_until for linux "irq" polling
Use a simpler counter system to prioritize tasks and irqs when busy.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-04-21 22:02:08 -04:00
Kevin O'Connor 92fe116dc7 sched: Call irq_poll() at start of run_tasks() loop
On architectures that poll for irqs, check for any pending irqs prior
to checking if tasks are idle.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-04-21 19:38:31 -04:00
Kevin O'Connor 8f9e497d69 linux: Rework timer_check_periodic() to use ticks
Avoid using a 'struct timespec' to simplify the code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-04-19 09:50:40 -04:00
Kevin O'Connor e0aba590f9 linux: Move timer fields into a struct
Storing the fields in a struct allows gcc to optimize memory pointers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-04-19 08:53:47 -04:00
Kevin O'Connor db0fb5d596 linux: Avoid calling timer_read_time() in timer_dispatch() when not needed
The timer_read_time() call can be expensive - when the next timer is
definitely pending, avoid making that call.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-04-18 13:12:32 -04:00