Katapult does not depend on Klipper's "timer_irc.c" as it does
not reference the "timer_dispatch_many()" method. Remove
it from the makefile to fix G0 and F0 builds.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Certain STM32 Nucleo development boards (eg. F429Zi) come pre-installed with a 32MHz quartz crystal, which is now exposed as an option when selecting STM32 chips.
Signed-off-by: Ella Fox <ella@fox.gal>
The UCPD is not used with Katapult but it can result in unexpected behaviour on certain pins due to the internal pull resistors unless disabled.
Signed-off-by: Luke Harrison looxonline@gmail.com
Syncs the stm32 fdcan and Kconfig to enable BTT U2C and PB12/PB13 FDCAN2 support STM32G0B1 with boards such as the BTT E3EZ.
Signed-off-by: Diana Moore <dmoore@xn4p4lm.com>
flash.c: fix write error for STM32H72x
Add a flash lock/unlock sequence after erasing and before writing to the flash
memory
Signed off by: Robin Gay <robingay67@gmail.com>
Add a shutdown() compatibility macro so that the upstream Klipper gpio
code can be used unmodified. Sync the rp2040, lpc176x, and stm32
gpio.c code with Klipper's code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move canboot specific definitions in board/misc.h to new canboot.h
header file. This makes it a little easier to identify differences
between canboot code and low-level upstream klipper code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Support building a "flashing application" that one may run from an
existing bootloader. This flashing application will then flash the
main CanBoot binary to the start of flash.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The lpc176x internal rom checks that the first 8 words of the flash
sum to zero. Many flash writing tools for the lpc176x will
automatically add the appropriate checksum. However, it can be useful
to build the checksum locally so that the image supports direct flash
writing.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename the existing armcm_boot.c file to armcm_canboot.c . This makes
it easier to track changes between CanBoot and Klipper as the CanBoot
entry code is notably different from the Klipper entry code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Avoid wrapping the sector index, as that could potentially result in
erasing the booloader itself.
Also, move the stm32f4_sector_index() inline into erase_page().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
There was a Klipper bugfix for STM32F401 clock init.
There was a Klipper build bugfix when building with gcc hardfloat flags.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit 4d969764 changed the "eof" command to return the number of
blocks instead of the number of pages written. Report the number of
pages written again.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Don't gather "blocks" into flash pages. Instead, write each "block"
to flash on each flash_write_block() request.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Avoid read-modify-write operations on the FLASH->CR register. Write
out the desired valid explicitly.
Use writew() and writel() to write the flash bytes out to avoid gcc
reordering the memory write relative to the flash register writes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move application_check_valid() in bootentry.c to armcm_boot.c and make
the check specific to the ARM cortex-m. On these ARM machines it is
easier to validate the application stack address.
Also rename jump_to_application() to application_jump().
Also rename flash_read_block() to application_read_flash() and move to
armcm_boot.c .
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Allow the application start address to be configurable from "make
menuconfig".
Add a build check to verify the final binary can fit within the
configured size.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>