ODFU Host MCU Firmware download schedule

Hi,

Anyone know how the firmware (ODFU) is download once the process starts ?

I am assuming its downloaded in fragments but is the download schedule driven by the hub.set setting i.e. continuous or based on the periodic schedule or does it have its own download schedule irrespective of for example the periodic time interval ?

My project runs in “minimum mode” and I am trying to develop the most efficient process to do ODFU which, per documentation, involves taking the Notecard out of minimum mode for a while.

Thanks,
Serge

Hey @ssozonoff,

In periodic and continuous mode the process is driven by your configured inbound interval. So for example if you used {"req":"hub.set","mode":"periodic","inbound":60} the Notecard would check for inbound changes (including firmware updates) every 60 minutes, and kick off the firmware update shortly thereafter.

In minimum mode you’ll have to kick off an explicit synchronization with the hub.sync request, and during that sync the Notecard will detect any firmware updates and perform them shortly thereafter as well.

TJ

1 Like

Hi,

OK that seems fairly clear but from what I have seen the download is not downloaded in one sync. For example in minimum mode its not possible to grab the firmware with one sync and the documentation clearly states that ODFU is not possible in minimum mode without being more specific.

So I assume a short periodic inbound sync is the fastest way to get the firmware downloaded, is this correct ?

Serge

I just gave this a test myself. I started by setting my Notecard to minimum mode.

{"req":"hub.set","mode":"minimum"}

Next, I triggered a host firmware update in Notehub. After that I ran a bunch of syncs and verified that the Notecard will never download the firmware in minimum mode, no matter how many syncs you do.

{"req":"hub.sync"}

After that I switched my Notecard to periodic mode and triggered another sync.

{"req":"hub.set","mode":"periodic"}
{"req":"hub.sync"}

This time the Notecard immediately found the host firmware and downloaded the whole binary.

> {"req":"dfu.status"}
{
 "status": "downloading",
 "mode": "downloading",
 "on": true
}

Shortly after it applied the update to the host.

> {"req":"dfu.status"}
{"err":"firmware update is in progress"}

And finished.

> {"req":"dfu.status"}
{
 "status": "successful host update",
 "mode": "completed",
 "on": true
}

When it was done I put my Notecard back in minimum mode.

{"req":"hub.set","mode":"minimum"}

These are the steps you should be able to mimic in your firmware.

As far as I know the Notecard always downloads firmware binaries in one sync when in periodic or continuous mode, but there might be some exceptions for edge cases, so I can do some digging if you’re seeing different behavior.

TJ

2 Likes

Hi,

This time the Notecard immediately found the host firmware and downloaded the whole binary.

I know its supposed to be agnostic but did you test this using wifi or cell ?

Currently I am doing more or less what you tested with the exception that I have a two step process of download and install. I achieve this using card.dfu with “off”: true to just download and not install the binary. Followed by an “on”: true when the dfu status is “outboard-ready” which will install the firmware on the host mcu. This gives me finer grained control of when the firmware is actually applied.

Given your tests it seems that the actual value chosen for the “inbound” polling will have no effect on the speed at which the firmware binary is download since its download in one shot.

Thanks for reporting back and validating what I have observed.

Regards,
Serge

1 Like

Hey @ssozonoff,

Apologies I missed the notification for your last reply. My previous test was done on a Cell+WiFi Notecard that did have Wi-Fi configured.

I just went through and ran the test again with a cellular-only connection and saw the same behavior.

TJ