Deployment on SCM20260 fails

Hello,
I’m trying to load the firmware on my SC20260 board but I get an error every time.

I’m using TinyCLR Config V2.0.0 and trying to load the firmware named “SITCore Firmware v2.0.0.ghi”.

I get the same error both selecting the “SC20260_SC20260” port or “COMx” after a reset with LDR.
In both cases, it connects (“Connected” appears in green color), I click “Update Firmware”, “connecting to loader mode…” appears; then the progress bar goes from “Loading Firmware 0%” to “Loading Firmware 100%” and then a red status appears with the message “There was an error during the upload”.
If I reconnect the device I see that device mode is “Firmware” and version is “2.0.0.8000”.

I tried both connecting the board through an USB 2.0 powered hub or an USB 3.0 docking unit with same results.

What can be the reason of the error message?

Thanks In advance for any help.

Custom board?

Tried using powered USB hub?

yes, the usb hub is self powered… it is the same one I use to deploy on the g400d with no issues…

What if you use the latest TinyCLR to load the latest firmware?

Do you have a dev board?

Thank you Gus, I installed the latest “TinyCLR config v2.1.0-preview4” and tried to upload the latest firmware “SITCore Firmware v2.1.0.4000.ghi” and I get the same error at the end of the firmware upload (whan it arrives at 100%). The reason is not specified.

After uploading the firmware (with both versions 2.0.0 or 2.1.0 preview 4), the TinyCLR Config app reports that the firmware is installed, even if I got the error message.

But with TinyCLR 2.0.0 I can deploy correcttly a simple app (the example of a blinking led on your “Getting started” page) and I can debug with VS 2019 with no errors (the led blinks).

If I use the 2.1.0 preview 4 the compiler throws a checksum error even if:

  • I installed the correct vsix extension (TinyCLR OS Project System v2.1.0-preview4.vsix)
  • I downloaded and referred the TinyCLR OS Libraries v2.1.0-preview4 in the nuget manager

The output says this:

  1. In the TinyCLR Device Deployment output log:
    Looking for a device on transport ‘USB’.
    Found device port ‘USB’ with ID ‘1a9689a2-ce2c-409a-b2ec-7f4a08f9436d’ for transport ‘Usb’.
    Starting device deployment.
    Attempting to connect to device ‘USB:SC20260’: iteration 0.
    Opening port ‘\?\usb#vid_1b9f&pid_5010#6&34cd6bee&3&1#{c13bcfe9-5e84-4187-9baa-45597ffcbb6f}’.
    Attaching debugger engine.
    Debugger engine attached.
    Generating device specific assemblies.

    • TinyCLRTestApp v1.0.0.0 with size 608 bytes at ‘D:\Users\Vittorio\SCM20260\TinyCLRTestApp\TinyCLRTestApp\bin\Debug\pe\TinyCLRTestApp.pe’.
    • mscorlib v2.1.0.0 with size 71.832 bytes at ‘D:\Users\Vittorio\SCM20260\TinyCLRTestApp\TinyCLRTestApp\bin\Debug\pe\mscorlib.pe’.
    • GHIElectronics.TinyCLR.Devices.Gpio v2.1.0.0 with size 4.772 bytes at ‘D:\Users\Vittorio\SCM20260\TinyCLRTestApp\TinyCLRTestApp\bin\Debug\pe\GHIElectronics.TinyCLR.Devices.Gpio.pe’.
    • GHIElectronics.TinyCLR.Native v2.1.0.0 with size 5.692 bytes at ‘D:\Users\Vittorio\SCM20260\TinyCLRTestApp\TinyCLRTestApp\bin\Debug\pe\GHIElectronics.TinyCLR.Native.pe’.
      Total deployment size is 82.904 bytes.
      Incrementally deploying assemblies to the device:
      Allocating assemblies:
    • Address: 0x08140000 => mscorlib
    • Address: 0x08151898 => GHIElectronics.TinyCLR.Native
    • Address: 0x08152ED4 => GHIElectronics.TinyCLR.Devices.Gpio
    • Address: 0x08154178 => TinyCLRTestApp
      Deploying assemblies:
    • Erasing sector 1 (131.072 bytes).
    • Writing sector 1 (82.912 bytes).
      Assemblies deployed. There are 571.432 bytes left in the deployment area.
      Restarting interpreter.
      Attaching to device.
      Waiting for device to initialize.
  2. In the debug log:
    Found debugger!
    Create TS.
    Loading Deployment Assemblies.
    Attaching deployed file.
    Assembly: mscorlib (2.0.0.0)
    Error: the reference mscorlib cannot be used with this version of the firmware.
    Firmware checksum 0xC8BE8BE5 does not match the assembly checksum 0x88C3BB44.
    Resolving.
    The debugging target runtime is loading the application assemblies and starting execution.
    Ready.
    Cannot find any entrypoint!
    Done.
    Waiting for debug commands…
    The program ‘[1] TinyCLR application: Managed’ has terminated with code 0 (0x0).

The dev board I am using is a custom board, the same that I use with the G400D SOM as it is pin-compatible. I have a dozen of production apps that I want to move to this new SitCore SOM migrating the application from NETMF to TinyCLR (hoping that all the functionalities the applications use are supported by this framework).

Thanks for your kind support.

Have you tried doing an erase all?
image

I had something similar once and this fixed it for me.

Reading the output carefully you will see that your project is 2.0 and the device firmware is 2.1.

Update your project…

Yes, I did.
After erasing it (Erase All command), then I can connect the device via COMx port only, and when connected it says that the device mode is “Loader” and version “v2.1.3”.

After loading the firmware I get the same error “There was an error during the upload”.

If I connect again the device it says that device mode is “Firmware” and version is “2.1.0.4000”.

If I immediately choose “Erase application” I see this log in the debug window of TinyCLR Config:

???(?.=?
Found debugger!
Create TS.
Loading Deployment Assemblies.
Resolving.
Ready.
Cannot find any entrypoint!
Done.
Waiting for debug commands…
Probably this is normal as no any application has been deployed, but I don’t know if those trailing ???(?.=? characters are a normal behavior.

I can only think of power issues. The dev board is your best bet here. Also, can you try another PC?

Thank you.
The device firmware I am trying now is 2.1.0.preview4.
In Visual Studio I installed the matching v2.1.0preview4 vsix extension and all the ghi nuget packages referred in the application are matching V2.1.0preview4 version.

I didn’t find any other place to select a different mscorlib version, any suggestion?

Thank you

Make sure you are getting the nuget packages from the 2.1 set.

Remove all references from project and then add the 2.1 packages.

TheNuGet packages section of:

https://docs.ghielectronics.com/software/tinyclr/getting-started.html

The preview is not published. You need a need to install locally

Yes, I followed exactly that guide.

The only difference is that I did everything with version 2.0.0 and even if I got the firmware upload error, I could deploy and debug the application.

Then I tried the following:

  • Uploaded the 2.1.0.prev4 firmware on the board
  • Uninstalled the TinyCLR 2.0.0 extension (vsix)
  • Installed the TinyCLR 2.1.0.prev4 .vsix extension
  • Downloaded the nuget library TinyCLR 2.1.0.prev4
  • Updated (installed) the 4 used nuget libraries to version 2.1.0.prev4 with no issues.
  • Complilation completes successfully
  • Debug failed as described in my previous post.

BUT NOW I tried again to debug and it worked!!! The led is blinking… I didn’t change anything else… I can’t figure out why.

Next, I’ll try to find another powered USB hub (changing the PC is not an option) to see if the firmware deployment error disappears.

Thanks a lot for your help.

Did you verify that you had the proper NuGet packages by right clicking the project and selecting Manage NuGet packages?

Yes, each used library is correct, version 2.1.0.preview4.

Now I can debug, suddenly it started working, probably the VS2019 environment was still updating in background after changing the nuget package version, as after a few minutes the debug started working correctly without making any other change.

Thank you again, Mike!

2 Likes

Hello Gus,
I tried today the deployment of the firmware using a different brand new POWERED USB hub.
After the firmware upload arrives to 100%, I always get the error

.

Anyway, the system seems it is correctly loaded as I can connect the board to the VS2019 environment and debug correctly.

A reason for the error arised by TinyCLR Config would be useful.

The dev board I use is a custom board that It is correctly working for our G400D/NetMF4.3 projects.

A possible cause can be one or more pins that are connected on the board but I don’t know how to find them as the G400D and the SCM20260 should be pin-compatible.

Thank you,
Vittorio

I have no idea. But it would greatly help to try another PC. You do not need visual studio, just config tool.