G120TH IFU getting freeze

Hi,

I’m having an issue trying to implement IFU, the code runs, it flash it but after the reset the device freezes. This is my code:


public const int BLOCK_SIZE = 65536;
        public static void FlashFirmware()
        {
            InFieldUpdate.Initialize(InFieldUpdate.Types.Application);

            DebugTools.Print("IFU | Loading firmware file ...");
            LoadFile("\\SD\\app.hex", InFieldUpdate.Types.Application);

            DebugTools.Print("IFU | Update completed, restarting ...");
            InFieldUpdate.FlashAndReset();
        }

        public static void LoadFile(string filename, InFieldUpdate.Types type)
        {
            using (var stream = new FileStream(filename, FileMode.Open))
            {
                var data = new byte[BLOCK_SIZE];

                for (int i = 0; i < stream.Length / BLOCK_SIZE; i++)
                {
                    stream.Read(data, 0, BLOCK_SIZE);
                    InFieldUpdate.Load(type, data, BLOCK_SIZE);
                }
                
                stream.Read(data, 0, (int)stream.Length % BLOCK_SIZE);
                InFieldUpdate.Load(type, data, (int)stream.Length % BLOCK_SIZE);
            }
        } 

@ mmonteagudo -

LoadFile just load into internal buffer,

FlashAndReset will erase and download data to flash. It take few minutes or more depends on how large your data is.

Do not hit reset until the process is done.

In your case, make sure the application is compatible with firmware on your device.

@ Dat -
Hi,

The application file works, I can load it using FezConfig and works perfect, but if I try to load it using IFU does not load.

Thanks,

@ mmonteagudo -

  • what version are you using?
  • Can you please make a small application and give it a try

@ Dat -

Firmware v4.3.8.1
Ok

I’ll try with a very small app, just to check.
Do you want me to send you my hex file for testing? It’s 441KB in size.

Thanks,