Main Site Documentation

SystemUpdate.ApplicationUpdate.Write throws an ArgumentException


#1

[Fez Panda II]

I use the SystemUpdate.ApplicationUpdate.Write method as in the docs.

SystemUpdate.ApplicationUpdate.Write(buffer, 0, read);

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…


#2

The IFU expert is in vacation this week and I am not sure myself. We will get back to this next week


#3

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.

Thnx :slight_smile:


#4

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.


#5

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.


#6

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.

Thanks!


#7

hi all,
please tell me how to access IFU mode?
and what document do you have? can you give me document link?
thanks


#8

Ginobili4, here’s the self help list you should add to your bookmarks. First is the GHI downloads and tutorials, http://www.tinyclr.com/support/ that has a link to the GHI SDK API reference, http://www.ghielectronics.com/downloads/NETMF/Library%20Documentation/Index.html which has the systemupdate information in it, perhaps http://www.ghielectronics.com/downloads/NETMF/Library%20Documentation/html/a7b24b54-6458-ed94-794d-6ffdfa7ef594.htm is the direct link.


#9
  1. deploying project using visual studio and debuging into my Pand II
  2. restarting panda with pushed loader button
  3. and using teraterm connecting to device by comport
  4. getting file using “L” command and received file converting to hex using "USBizi_ExtractApplication.exe"
    output.hex file size is 288KB (is it normal?)

is this correct way of Obtaining the Application File?
please i need your help… :wall: :’(


#10

Step 4 should be the “G” command, I believe.

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.


#11

yes sorry its G command.
i was using G Command


#12

and how to seperate bootloader and application mode?
i dont know :frowning:


#13

Run SystemUpdate.EnableBootloader() method. It does it for you and reboots the system into Application mode so you can deploy your application.

You should check out http://www.ghielectronics.com/downloads/NETMF/Library%20Documentation/Index.html

Look under GHIElectronics.NETMF.System Namespace --> SystemUpdate Class.

I followed the process there and it works.


#14

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).