It seems both ERRIE and LECIE must be enabled to get hardware error
interrupts. Without this, the rx_error and tx_error reports are
likely to always be zero.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add support for "step on both edges" to the main stepper_event_full()
code. This makes that mode of operation available even when the
micro-controller is not compiled for "optimized step on both edges".
It also enables the custom pulse duration support (step_pulse_ticks)
when in "step on both edges" mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
STM32F401 has USART6 on PA12/PA11 and PC7/PC6 with alternate
function mapping AF08. This can be used, for example, to connect
to the Elegoo Neptune 3, where PA12/PA11 are wired to an RJ10 plug
going to the stock screen.
Signed-off-by: Marius Petcu <marius@petcu.me>
* Fix getting wrong ADC value on PA0
* Fix invalid/unused pin being used as adc channel on STM32H7/G431/L4
Signed-off-by: Nicholas Huskie <huskie@idealfuture.org.cn>
It seems recent arm gcc versions no longer build correctly using the
"--specs=nano.specs --specs=nosys.specs" linker flags. Replace those
linker flags with "-nostdlib -lgcc -lc_nano".
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Some of the alternate pins defined are routed to FDCAN2 instead of
FDCAN1, this commit uses the correct IRQ register and peripheral
clock enable bit to enable FDCAN on those pins.
Signed-off-by: Amr Elsayed from Dropeffect GmbH <code@dropeffect.com>
At least STM32G4 requires four ADC clock cycles between hardware
clearing ADCCAL and setting ADEN or the write disappears. Make a
tenacious write attempt.
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
Wait for two tx packets before startup, and make sure one of those
packets is acked before sending a third tx packet.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit cd8d57c2 added USB double buffering mode on transmits.
However, when enabling double buffering mode, the hardware seems to
always send at least two packets. Spurious transmissions could cause
the Linux gs_usb driver to get confused, which could lead to the can0
device becoming unavailable on restarts. Fix by waiting for two USB
packets to be available before enabling the endpoint.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The bulk out endpoint should not be enabled in tx mode, and the bulk
in endpoint should not be enabled in rx mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Implement the usbfs fast buffer switching mechanism on the "bulk in"
endpoint. This can improve the overall USB throughput and bus
utilization.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Implement the usbfs fast buffer switching mechanism on the "bulk out"
endpoint. This can improve the overall USB throughput and bus
utilization.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The usbfs device supports two buffers for each endpoint - typically
one for rx and one for tx. Add support for explicit handling of both
buffers. This is in preparation for improved "double buffering"
support.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>