1.1.3.3.1. cli.cmd_bootloader.bootloader_binary_file.BootloaderBinaryFile
- class cli.cmd_bootloader.bootloader_binary_file.BootloaderBinaryFile(path_app_binary: Path = WindowsPath('D:/_github/foxbms-2/build/app_embedded/src/app/main/foxbms.bin'), app_size: int | None = 4063232, path_crc_64_table: Path | None = WindowsPath('D:/_github/foxbms-2/build/bootloader_crc_64_bits.csv'))
Class to handle an application binary file and prepare the binary data for bootloader usage (e.g., calculate a CRC for of the application binary).
- __init__(path_app_binary: Path = WindowsPath('D:/_github/foxbms-2/build/app_embedded/src/app/main/foxbms.bin'), app_size: int | None = 4063232, path_crc_64_table: Path | None = WindowsPath('D:/_github/foxbms-2/build/bootloader_crc_64_bits.csv'))
Initialization function
- Parameters:
path_app_binary – the path of the binary file of the application that will be sent
app_size – the size of the binary file of the application which should be the sum of the sector sizes
path_crc_64_table – the path of the temporary file that stores the CRC table
Methods
__init__
([path_app_binary, app_size, ...])Initialization function
fill_byte_array_with_app_size
(byte_array, ...)Fill a byte array to a certain size.
get_crc_and_data_by_index
(index_of_8_bytes)Get the CRC signature and data in 64 bits from the CRC table array based on the index.
get_data64_vector_table
(byte_array_vector_table)Convert byte array of vector table to list of integer.