Beginners Guide to C# and the .NET Micro Framework by Gus Issa - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

8. Assembly/Firmware Matching

NETMF devices usually include extended features provided by the manufactures. It is very important that the firmware loaded on the device matches the assemblies being loaded from Visual Studio. The firmware will fail to run if the version of the assembly/library that used in the project does not match the version of the firmware.

This is a very common issue that users run into when updating the firmware where the application just stops working and debugging seems to fail. You may see “checksum mismatch” in the output window.

Here is what happens:

Scenario #1: A developer has received a new device. This device happens to have firmware version 1.0 on it. Then the developer went to the website and downloaded the latest SDK. The SDK has firmware version 1.1 in it. When trying to upload a project, VS2010 will fail to attach to the device with no indication why! The developer will now think the new device is not functioning, but actually, the device is just fine. In this example, the firmware is version 1.0 and the assembly is version 1.1 so the system will refuse to run. To fix the issue, update the firmware on the device to match the firmware in the SDK.

Scenario #2: A developer has a perfectly working system that, for example, uses firmware version 2.1. Then a new SDK comes out with firmware version 2.2, so the developer installs the new SDK on the PC then uploads the new firmware to the device (FEZ). When rebooting the device, it stops working because the new loaded firmware is version 2.2 but the user application is still using assembly version 2.1. To fix this issue, open the project that has the user application and remove any device-specific assemblies. After they are removed, go back and add them back. With this move the new files will be fetched from the new SDK.

Boot-up Messages

We can easily see why the system is not running using MFDeploy. NETMF outputs many useful messages on power up. Should the system become unresponsive, fails to run or for any other debug purposes, we can use MFDeploy to display these boot up messages. Also, all “Debug.Print” messages that we usually see on the output window are visible on MFDeploy.

To display the boot up messages, click on “Target->Connect” from the menu then reset the device. Right after you reset the device in one second, click on “ping”. MFDeploy will freeze for a second then display a long list of messages.

img65.png

img66.png