the same like here
I don't know what to tell you. That code is not complex enough to have any mistakes.
Code:
// First send the UBL image that will be written to flash\
Console.WriteLine("Sending the UBL image");
imageData = FileIO.GetFileData(cmdParams.UBLFileName); //<<<<<<<<<<<< YOUR ERROR IS HERE
ackHeader.magicNum = (UInt32)cmdParams.UBLMagicFlag;
ackHeader.startAddr = cmdParams.UBLStartAddr;
ackHeader.byteCnt = (UInt32) imageData.Length;
ackHeader.loadAddr = 0x0020; // Not used here, but this is what RBL assumes
// Actually transmit the data
if (!TransmitImage(imageData, ackHeader))
return false;
// ^^^DONE\0 that indicates that UBL flashing is complete
if (!SerialIO.waitForSequence(" DONE\0", "BOOTUBL\0", MySP, true))
return false;
// Now Send the application image that will be written to flash
Console.WriteLine("Sending the Application image");
You must be getting a deserved error:
Code:
public class FileIO
{
public static Byte[] GetFileData(String filename)
{
Byte[] data;
if (!File.Exists(filename))
{
throw new FileNotFoundException("File " + filename + " is not present."); //<<<< THIS IS WHERE ERROR MESSAGE IS CREATED
}
// Open file and read data
try
{
data = File.ReadAllBytes(filename);
}
catch (Exception e)
{
Console.WriteLine("Error: "+e.Message);
throw e;
}
return data;
}
Try on Linux. If that won't help - I guess you should just give up. Clearly the universe doesn't want you to flash it.