Hi all,
I’m working on flash_spi support for the BoogieBoard, a modified version of the well-known Smoothieboard. The BoogieBoard uses a customized bootloader, which requires an additional checksum file besides the actual firmware for flashing. I unfortunately don’t have access to the modified source code.
The firmware.inf checksum file contains a CRC16 checksum of the matching firmware.bin.
If this file is not existing or does not match the firmware.bin, then the latter is not written to flash by the bootloader.
I plan to add a default configuration and further documentation for the BoogieBoard as used in a BigRep One 3B, but I will discuss that in a different topic.
In this topic, I would like to discuss the possibility of generating auxiliary files within flash_spi and uploading them to the MCU’s SD card, just as we do with the firmware binary.
Therefore, I propose adding a new field to scripts/spi_flash/board_defs.py, which lists auxiliary files and, optionally, provides an action argument (crc16-citt), which is passed to the conversion script if given. Additionally, the placeholder {klipper_bin_path} is introduced and replaced by the freshly compiled klipper binary’s path before being passed to the conversion script.
'boogieboard-1-3': {
'mcu': "lpc1769",
'spi_bus': "ssp1",
"cs_pin": "P0.6",
"conversion_script": "scripts/update_boogieboard.py",
"aux_files": [('{klipper_bin_path}', 'firmware.inf', 'crc16-ciitt')],
}
After the optional conversion script, we get a list of 2-tuples (as the action argument is removed during processing): (host_file_source_path, sdcard_target_path).
Within spi_flash, we generalize sdcard_upload(self): for a file argument sdcard_upload_file(self, src_path, dst_path):. Within sdcard_upload(self) we first upload the firmware using the generic sdcard_upload_file method. Then we iterate over any auxiliary files and pass them to the same generic upload method.
What do you think?
Best,
Sandro