Commit Graph

9 Commits

Author SHA1 Message Date
Eric Callahan ccae1e3ec8 spi_flash: validate mcu configuration
Prior to attempting a flash, verify that the MCU is successfully
configured.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-25 12:02:45 -04:00
Eric Callahan 7db07c46e6 spi_flash: support spi protocol changes
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-22 20:46:45 -04:00
Justin Schuh cfff897480 spi_flash: Better fallback on MCU protocol change
Support a set of known past config responses.

Signed-off-by: Justin Schuh <code@justinschuh.com>
2021-11-09 20:15:46 -05:00
Justin Schuh 76bfc3237a spi_flash: Fix MCU handshake protocol
Update config response string to match new version from d4aee4f.

Signed-off-by: Justin Schuh <code@justinschuh.com>
2021-11-08 20:07:38 -05:00
Kevin O'Connor 1a4d655a18 spi_flash: Improve Python3 compatibility
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-07 20:05:15 -04:00
Justin Schuh 121052ad39 spi_flash: Support firmware dictionary validation
Updates firmware validation to use a dictionary if provided (or found
when updating from the default out/ directory).

Validation without a dictionary still checks the following (in order):
1. Active firmware's raw dictionary changed after update
2. Checksum of firmware.cur matches expected

Signed-off-by: Justin Schuh <code@justinschuh.com>
2021-07-20 18:05:05 -04:00
Justin Schuh bb801905be spi_flash: Make SD updates more tolerant of flaky boards
Validation passes if either of the following succeeds (in order):
1. Active firmware's raw dictionary changed after update
2. Checksum of firmware.cur matches expected

Additionally, deletes firmware.bin if found after update succeeds.

Signed-off-by: Justin Schuh <code@justinschuh.com>
2021-07-20 18:05:05 -04:00
Kevin O'Connor 9d3a3f3f30 serialhdl: Update callers to decide serial fd type
Don't try to detect a "real serial port" in serialhdl.py.  Instead,
have the callers invoke either connect_uart(), connect_file(), or
connect_pipe().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-03-02 11:38:50 -05:00
Arksine 44c1caf2b9 spi_flash: support for firmware upgrades via SD Card
This module connects directly to MCU's previously flashed with Klipper, uploads Klipper firmware to an attached SD Card, and performs a device reset to intiate the bootloader's update process.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-02-05 19:37:56 -05:00