Console.WriteLine(" adding a single HEX file: hex2dfu -h=hex_file_name -o=output_DFU_image_file_name");
Console.WriteLine(" adding one or more BIN files: hex2dfu -b=bin_file_name -a=address_to_flash [-b=bin_file_name_N -a=address_to_flash_N] -o=output_DFU_image_file_name");
Console.WriteLine();
Console.WriteLine(" options:");
Console.WriteLine();
Console.WriteLine(@" [-v=""0000""] (VID of target USB device (hexadecimal format), leave empty to use STM default)");
Console.WriteLine(@" [-p=""0000""] (PID of target USB device (hexadecimal format), leave empty to use STM default)");
Console.WriteLine(@" [-f=""0000""] (Firmware version of the target USB device (hexadecimal format), leave empty to use default)");
Console.WriteLine();
}
// args check
// need, at least, one hex file
if(HexFile==null&&BinFiles==null)
{
Console.WriteLine();
Console.WriteLine("ERROR: Need at least one HEX or BIN file to create DFU target image.");
Console.WriteLine();
Console.WriteLine(@"Use -h=""path-to-hex-file"" for each HEX file to add to the DFU target.");
Console.WriteLine(@"Use -b=bin_file_name -a=address_to_flash [-b=bin_file_name_N -a=address_to_flash_N] for each BIN file to add to the DFU target.");
Console.WriteLine();
Console.WriteLine();
}
if(BinFiles!=null)
{
// need the addresses too
if(Addresses==null)
{
Console.WriteLine();
Console.WriteLine("ERROR: For BIN files the addresses to flash are mandatory.");
Console.WriteLine();
Console.WriteLine(@"Use -b=bin_file_name -a=address_to_flash [-b=bin_file_name_N -a=address_to_flash_N] for each BIN file to add to the DFU target.");
Console.WriteLine();
Console.WriteLine();
}
}
// output DFU file name is mandatory
if(OutputDfuFile==null)
{
Console.WriteLine();
Console.WriteLine("ERROR: Output DFU target file name is required.");