// The binary upload functions should probably be moved, possibly even to a different program. private void uploadBinary(String path) { if (!System.IO.File.Exists(path)) { throw new System.IO.FileNotFoundException("Binary file not found"); } log.info($"Found binary at {path}"); log.info("Uploading new binary..."); dspDevice.LoadUserFirmware(path, dspPort); // Code for uploading compiled binary log.ok("Binary uploaded, reconnecting device..."); }
public bool Download_Code(string FirmwareFile) { if (DevicesReady) { CMcsUsbFactoryNet factorydev = new CMcsUsbFactoryNet(); factorydev.LoadUserFirmware(FirmwareFile, DspPort); // Code for uploading compiled binary factorydev.Disconnect(); Console.WriteLine("Firmware Loaded : " + FirmwareFile); return(true); } else { return(false); } }
private void UploadDSPBinary_Click(object sender, EventArgs e) { CMcsUsbFactoryNet factorydev = new CMcsUsbFactoryNet(); if (DspPort != null || RawPort != null) { CMcsUsbListEntryNet port = DspPort; if (port == null) { port = RawPort; } if (factorydev.Connect(port, LockMask) == 0) { string FirmwareFile; FirmwareFile = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); if (factorydev.GetDeviceId().IdProduct == ProductIdEnumNet.MEA2100) { FirmwareFile += @"\..\..\..\..\DSP\FB_Example\Release\"; FirmwareFile += "FB_Example.bin"; } else { FirmwareFile += @"\..\..\..\..\DSP\FB_W2100_SCU_MEA256\Release\"; FirmwareFile += "FB_W2100_SCU_MEA256.bin"; } factorydev.Disconnect(); bool success = factorydev.LoadUserFirmware(FirmwareFile, port, LockMask); // Code for uploading compiled binary if (!success) { MessageBox.Show("Firmware upload failed!"); } } } else { MessageBox.Show("No port available"); } }