Task Tracker - Retain configuration when updating firmware

I just posted Retain configuration when updating firmware on Task Tracker. Feel free to discuss and make suggestions here.

@ Simon from Vilnius - Aside from friendly name, is there anything that you cannot get or set through code that is reset when you update the config?

Wow, that’s some really ancient stuff :slight_smile:

I didn’t actually try setting/getting network config in code. I set it from FezConfig, an boy it is an annoying feature :slight_smile:

@ Simon from Vilnius - Many things in the configuration can be saved and loaded through code. You could easily save those values in a configuration file or constants in your program that are set on every startup.

Persisting the configuration between firmwares is difficult because a new firmware could add a new value or move existing things around and then we have to track which releases can use the old configuration. The safest way to keep your specific configuration is to load it like I detailed above.

Friendly name included?

@ Simon from Vilnius - Except for friendly name. That is something we can look into providing a method to get/set, but we do not have anything at this time.

Damn it :slight_smile:

@ Simon from Vilnius - If it helps, the below code will change the friendly name as long as the device remains powered. It does not persist to flash so it will be lost on reset.


using Microsoft.SPOT.Hardware.UsbClient;

public class Program
{
	public static void Main()
	{
		var controller = UsbController.GetController(0);
		var config = controller.Configuration;

		for (var i = 0; i < config.descriptors.Length; i++)
		{
			var d = config.descriptors[i];

			if (d.GetType() == typeof(Configuration.StringDescriptor))
			{
				var s = (Configuration.StringDescriptor)d;

				if (s.bIndex == 5)
				{
					s.sString = "New Friendly Name";

					break;
				}
			}
		}

		controller.Configuration = config;
	}
}

1 Like

It would be better to allow user to write/read directly on flash…

Retain configuration when updating firmware was updated.

Status went from Proposed to Closed.

@ Simon from Vilnius - See my post at https://www.ghielectronics.com/community/forum/topic?id=19121&page=2#msg191898 for a persistent way to read and write the friendly name.