11-26-2018 09:40 AM
I have a USB device that I am trying to write a binary firmware file to. The device will initially have a generic binary file on it. The sequence of events should be:
Delete generic binary file
Copy new binary file(stored locally on the PC)
Do other test commands
Just for reference, The USB will initially enumerate as a Mass Storage device then when the new firmware is loaded, it will enumerate as a generic USB device.
Is there already built in VIs to do this? Or maybe some documentation on it? My searches haven't turned up anything useful.
Thanks.
11-26-2018 09:54 AM
Do you mean a drive unit letter is NOT assigned to the device?
Is it a special device rather than a trivial USB flash disk?
11-26-2018 10:26 AM
It is a special USB device that will be used in tandem with PC software to check diagnostic codes on many different snowmobile engine brands.
So the idea is that with the generic binary loaded it will load as 'USB Mass Storage' under drive 😧 (just an example). Then you will delete the generic binary, load the specific version, short power and ground to reboot and load the new binary, then it will show up under a different name but with the same drive. Hope that helps.
11-26-2018 11:03 AM
Ok, it's clearer now. You would like to replace the firwmare into the device (which I would not refer to as a 'file' however).
I'm not experienced in this, but I guess it would be rather complicated - if ever possible with a standard USB port - and very device specific - strong need of more documentation.
I hope someone else can help you
11-29-2018 11:06 AM
I have solved my own issue. I left it alone for a while and came back to it this morning. I have attached what I came up with. You're welcome to critique it if it's not very good (I am not that experienced with LV, yet).
Because I know this device will enumerate with the same drive every time it is plugged in, I just used a flashdrive to simulate this.
The code follows this order:
Establish connection with Arduino Uno>Create file Path for old firmware>Delete filepath for the old firmware>move the new firmware to the device(stored locally)>Write Pin 8 on Arduino High(eventually will short VCC and GND to turn off)>wait>Write Pin 8 on Arduino LOW(restarts device)
This was my quick and dirty way of doing it. I'm sure there's more elegant ways to do it.
11-29-2018 07:14 PM
Your design is ok for me.
But your code is ugly. lol
Benoit