I used the name read instead of length here but that’s it.
I tried reducing the buffer size (as the docs are probably based on the ChipworkX)
but that doesn’t help either…
I simply get:
A first chance exception of type ‘System.ArgumentException’ occurred in GHIElectronics.NETMF.SystemUpdate.dll
An unhandled exception of type ‘System.ArgumentException’ occurred in GHIElectronics.NETMF.SystemUpdate.dll
The docs do not indicate this method might throw that exception or why
Any ideas?
Update: I did read somewhere that the data is checked as it comes in,
throwing an argument exception if the data is not valid.
If this is the case, which would be great, that would mean I don’t have to implement
my own crc checking. It should be added to the docs though…
In any case, I have a deployment file, I can deploy it using Teraterm.
I then took that file, converted it as described in the docs and used the resulting hex file
to upload here. It throws argument exceptions completely at random…
As we have to ship the Panda’s this week,
I went for the SD card update procedure as described in the documents but without the requirement for user interaction. That works for now.
I am looking forward to the reply though, will be usefull for future projects.
I’m also using a Panda II and am getting that same exception during SystemUpdate.ApplicationUpdate.Write() when using the sample code. Has this issue been resolved?
I am updating from an SD card. The Hex file was obtained by using the “G” command in TeraTerm to pull my binary application.
You would have to put panda in a special mode to do IFU plus the file you get from G command is not suitable I think is this file includes all flash, not the formatted lash.
Thanks, Gus. I was using GHI’s SystemUpdate class documentation to understand the IFU workflow. Is there another doc I should be looking at that might be better tailored to USBizi?
What special mode were you referring to in order to perform IFU? (Do certain pins need to be shorted/grounded?) I’ve already done SystemUpdate.EnableBootloader() and loaded my managed bootloader code into the bootloader region, but I get the exception just after I’ve written 2 thru 4 bytes using ApplicationUpdate.
What’s the preferred way to get the Hex file for an application?
Thank you.
— SOLVED —
Gus, looks like I overlooked the paragraph in the SystemUpdate() documentation that says that the file extracted from the Panda II using the “G” command first needs to be converted to SREC format before it can be uploaded using ApplicationUpdate.
Once I used the program in the link to perform the conversion, the upload now works fine.
Also, you may have to split the flash into separate bootloader and application regions first (Step 0, maybe?) using the SystemUpdate.EnableBootloader() method, and then upload your project.
Take a look here for a working example of USBizi bootloader. The file that is used is the flash downloaded using tera term (no need to convert is to srec file).