53 Commits

Author SHA1 Message Date
Eric Callahan
542b6a8519 flashtool: support usb/serial bootloader requests
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2025-02-24 15:02:21 -05:00
Eric Callahan
dd8b0a0c9a flashtool: add binary mcu detection
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2025-02-24 12:34:49 -05:00
Eric Callahan
a8de2feab7 flashtool: support busy acknowledgements
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2025-02-24 12:34:42 -05:00
Eric Callahan
90eb71b610
flashtool: fix CAN bootloader request
Introduce a delay before exiting when requesting the bootloader.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-09-09 10:55:30 -04:00
Eric Callahan
10abb2a086
flashtool: increase default read timeout
Signed-off-by:  Eric Callahan <arksine.code@gmail.com
2024-09-03 15:24:48 -04:00
Eric Callahan
730fde48ab flashtool: use recommended asyncio entry point
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-08-24 06:26:19 -04:00
Eric Callahan
7de954b916 flashtool: add serial device validation
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-08-24 06:26:19 -04:00
Eric Callahan
4a1532ef24 flashcmd: add support for reporting software version
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-08-06 19:41:37 -04:00
Eric Callahan
3f28ae2641 flashtool: update stale can errors
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-08-06 19:41:37 -04:00
Eric Callahan
0601062acc
flashtool: add some delay after resetting CAN nodes
The previous UUID verification step introduce a delay that allowed
nodes time to reboot before a node ID was assigned.  Reintroduce a
1 second delay.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-10 18:17:37 -05:00
Eric Callahan
13b61caf58
flashtool: remove UUID verification step
When multiple nodes are on the network the UUID query
can result in transmit errors, as multiple nodes with the
same ID will attempt to respond.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-08-28 06:23:38 -04:00
Eric Callahan
817a6656cb
scripts: create flash_can.py relative symbolic link
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-08-01 06:08:09 -04:00
Eric Callahan
4527de65b9
flashtool: rename from flash_can.py
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-31 05:55:20 -04:00
Eric Callahan
540b4159d9
flash_can: update to reference Katapult
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-30 17:00:05 -04:00
Eric Callahan
5e794c05d9
build: rename references from CanBoot to Katapult
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-30 10:35:54 -04:00
Eric Callahan
2291f50bf0
flash_can: uuid format specifier fix
SIgned-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-10 16:46:27 -04:00
Eric Callahan
10cc588874
flash_can: query fix
Don't requre exactly 8 bytes in a response, as its possible
that some apps may not return a full 8 bytes.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-03-16 10:57:23 -04:00
Eric Callahan
ffd8ac60f7
flash_can: reduce error output
Don't log read exceptions for each iteration, only log when the
exception differs.  Log timeout exceptions separately.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-02-24 11:00:29 -05:00
Eric Callahan
d6d5c6cc9c
flash_can: don't check firmware path for bootloader requests
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-02-15 08:00:12 -05:00
Eric Callahan
1da9898366
flash_can: add option to request bootloader
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-01-29 12:43:25 -05:00
Kevin O'Connor
7db10a048f armcm_canboot: Rename CONFIG_APPLICATION_START to CONFIG_LAUNCH_APP_ADDRESS
Rename the build symbol to better distinguish it from the start
address of the deployer app.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-12-22 12:12:24 -05:00
sh83
2990480d25 common: misc fixes:
- moved external files to lib folder
 - fixed typos
 - added optional "sudo" to flash command
 - fixed redundant file close in script
 - fixed compilation warning
2022-10-31 07:23:14 -04:00
sh83
0a24cd4502 rp2040: added option to force bootloader before new application flashed
Signed-off-by: Alex Malishev <malishev@gmail.com>
2022-10-31 07:23:14 -04:00
Kevin O'Connor
f4ac6470bf deployer: Add support for a CanBoot "deployer"
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>
2022-07-29 12:20:00 -04:00
Kevin O'Connor
fb50570994 buildbinary: Add support for building lpc176x checksum
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>
2022-07-29 12:20:00 -04:00
Eric Callahan
446ff1794b
flash_can: report missing pyserial
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-06-08 08:24:53 -04:00
Eric Callahan
7574bcffa1
Revert "flash_can: support entering the usb bootloader"
This reverts commit b267acc6b3fcadab07f9755f9a6f409c298870f7.
2022-06-03 14:07:06 -04:00
Eric Callahan
b267acc6b3
flash_can: support entering the usb bootloader
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-06-03 08:21:36 -04:00
Kevin O'Connor
d6c874b0ad stm32: Support 4KiB application start
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>
2022-05-16 14:08:54 -04:00
Kevin O'Connor
24d4eb16c9 initial_pins: Port initial_pins capability from Klipper
Some boards require an initial gpio state in order to start USB.  Port
the initial_pins capability from Klipper to provide that support.

This also synchronizes scripts/buildcommands.py with the latest code
from Klipper.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-16 13:59:42 -04:00
Kevin O'Connor
fc96f0c9bd flash_can: Report errors by default
Change the default log level from CRITICAL to ERROR.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-16 06:19:08 -04:00
Kevin O'Connor
92e9174cae flash_can: Fix pyserial exception handling
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-16 06:19:08 -04:00
Kevin O'Connor
2821c1c807 flash_can: Add support for flashing over serial
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-13 06:16:08 -04:00
Kevin O'Connor
db6a9b4d96 sched: Add sched.c and sched.h files to make importing Klipper code easier
Add the sched.c code and associated DECL_INIT(), DECL_TASK() macros so
that it is easier to import low-level Klipper code into the CanBoot
repo.

These additional code wrappers do not increase the overall binary size
as gcc does a good job of inlining the wrappers and removing unused
code during the compile process.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-13 06:16:08 -04:00
Kevin O'Connor
ae687a404d canbus: Add support for verifying the canbus uuid
There is a severe corner case where two mcus could potentially be
assigned the same canbus_id and thus flash commands could go to the
wrong mcu.  Add a get_canbus_id command to attempt to prevent this.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-09 17:12:24 -04:00
Kevin O'Connor
a00c4c78c5 canboot_main: Add mcu type to connect response message
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-09 17:12:24 -04:00
Eric Callahan
5e7d632c4f flash_can: protocol updates
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-05-09 17:12:24 -04:00
Eric Callahan
c9d326928c flash_can: update to support new protocol
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-05-09 17:12:24 -04:00
Kevin O'Connor
66c9853929 canboot_main: Add support for entering the bootloader on a button press
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-05 15:18:07 -04:00
Kevin O'Connor
807c1ef0bd led: Move led code to new led.c file
Move the led c code from the buildcommands.py to a new led.c file.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-05 15:18:07 -04:00
Kevin O'Connor
794ccd69c0 canbus: Use Klipper's nodeid to canbus_id scheme
Use Klipper's nodeid to canbus_id scheme (canbus_id = nodeid * 2 +
0x100).  Instead, use a nodeid offset of 128 to avoid collisions with
Klipper.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-05-05 05:22:55 -04:00
Eric Callahan
95e8a707ca
flash_can: attempt to reset the mcu if an error is encountered
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-26 12:12:46 -04:00
Eric Callahan
76474d6efd
flash_can: update for latest changes
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-26 08:20:24 -04:00
Eric Callahan
b5303fa5f7
flash_can: fix error in uuid reporting
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-25 20:06:57 -04:00
Eric Callahan
f0d7bb7f9c
flash_can: add retries to verification
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-25 17:18:35 -04:00
Eric Callahan
f754ae2746
flash_can: update for latest changes
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-25 17:14:02 -04:00
Eric Callahan
db1123d69d
flash_can: add query option
It is possible that a user will flash the bootloader before
ever having flashed Klipper.  In this case they would be
unable to supply a UUID.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-14 08:21:58 -04:00
Eric Callahan
0838d844e9
flash_can: make executable
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-13 19:34:50 -04:00
Eric Callahan
a6afacea62
scripts: remove the canserial service files
This service is no longer necessary to communicate with
can devices running Klipper.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-13 18:25:54 -04:00
Eric Callahan
3686db10fd
flash_can: add interface argument
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2022-04-13 18:23:44 -04:00