This document describes the usage of btl_bin_to_c_array.py host script
To clone or download the host tools from Github,go to the bootloader repository and then click Clone button to clone this repo or download as zip file. This content can also be download using content manager by following these instructions
This script should be used to convert the binary file to a C style array containing Hex output that can be directly included in target application code
If size of the input binary file is not aligned to device erase boundary it appends 0xFF to the binary to make it aligned and then generates the Hex output
User must specify the binary file to convert (-b), hex output file (-o) and the device (-d)
python <harmony3_path>/bootloader/tools/btl_bin_to_c_array.py --help
python <harmony3_path>/bootloader/tools/btl_bin_to_c_array.py -b <binary_file> -o <hex_file> -d <device>
python <harmony3_path>/bootloader/tools/btl_bin_to_c_array.py -b <harmony3_path>/bootloader_apps_i2c/apps/i2c_bootloader/test_app/firmware/sam_d20_xpro.X/dist/sam_d20_xpro/production/sam_d20_xpro.X.production.bin -o <harmony3_path>/bootloader_apps_i2c/apps/i2c_bootloader/host_app_nvm/firmware/src/test_app_images/image_pattern_hex_sam_d20_xpro.h -d samd2x