Now that the stm32f1 code has been merged into the stm32 code, there
is no longer a need to keep the stm32f1/ directory.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename the clock.c file to stm32f4.c to make it more clear that the
code is specific to the stm32f4 chips.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Now that the code in stm32f4/ can handle both stm32f1 and stm32f4
chips, rename the directory to just "stm32".
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Update the stm32f1 code to the latest from ST. Merge the
lib/cmsis-stm32f1/ and lib/hal-stm32f1/ into a single lib/stm32f1/
directory. Document all the differences from the pristine upstream
code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename the commands.
The main reason for this change is to force a micro-controller code
updated (due to important bugfix in 7fefe52d).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
If the move is not added to the move queue, then the SF_LAST_DIR
setting must not be changed. Otherwise, it could result in an
incorrect direction being set on the stepper after a homing operation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The popular "LPC17xx-DFU-Bootloader" alters the LPC_UART0->FDR
register, so be sure to reset it back to its default when using serial
in Klipper.
Reported by @b-vs.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit 1096075d changed CONFIG_CLOCK_FREQ to the actual cpu frequency,
but that commit failed to update adc.c accordingly. That made the adc
run 4 times slower. Make the corresponding change to adc.c.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Improve the precision of soft pwm pulses by allowing the host to
directly specify the clock duration of the pulse. This improvement in
precision may be noticeable when controller servos (and bltouch).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The replicape servo pins (P9_14/P9_16) are muxed to the SOCs hardware
PWM unit driven by a 13MHz GP timer. They have to be driven by the
linux host mcu. This commits adds hardware PWM support using the linux
sysfs user space interface.
Signed-off-by: Janne Grunau <janne-3d@jannau.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The sampling time of the ADC was too slow (239 ADC clock cycles), causing the reading of the next ADC channel to have cross talk as per issue #1261. Sampling time updated to 41 ADC clock cycles.
Signed-off-by: Marco D'Alessio <marco@wrecklab.com>
It appears the PRU timer will not trigger on a match of exactly zero.
If the next timer happened to be set to exactly zero, it could cause
software timers to get stuck and result in "move queue empty" errors.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It appears some host machines may not recognize that the USB device
has disconnected upon start of bootloader mode. Explicitly disable
USB and add a 5ms delay to help signal the host of the upcoming
change.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit b9b03dd0 had a typo in the flag updating. The typo could
result in corruption of the stepper state.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Now that enumerations are available, any variable named "pin" can only
be used to describe a gpio pin. Rename the end_stop_state "pin"
parameter to "pin_value". Also, rename "end_stop_query" command to
"end_stop_query_state" to notify users to upgrade both host and mcu
code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Make it clear that the name of the constant being defined is a string.
When the value being defined is also a string, use a new
DECL_CONSTANT_STR() macro.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
If the stepper is stopped by the endstop code, then ignore any further
stepper moves until a reset_step_clock command is received.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Default to running dfu-util via sudo as most machines will not have
the user setup with permissions to access the raw usb device.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add support for entering the "stm32duino" bootloader via the arduino
1200 baud USB request. Add supprot for flashing over USB via the
"make flash" command.
Rename the existing "make flash" command to "make serialflash".
Default to using a bootloader in Kconfig.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's rare to use all of a target's prerequisites in a recipe - replace
most cases with $< (the target's first prerequisite).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit e18501d0 broke the build for targets that added objects to
klipper.elf via adding dependencies. Rework the build so that it is
possible to add objects to klipper.elf via a new OBJS_klipper.elf
makefile variable.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Some of the samd21 chips have limited memory - change the code to
reduce the size of global variables.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use a local linker script instead of the linker script provided by
Atmel. This will allow Klipper to use dynamic memory allocation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>