Hi, I’m trying to make first steps with a FEZ Flea and SPI (and later Wiznet). I think i stumbled upon a bug in deployment (from Visual Studio in my case). Output of TinyCLR Device Deployment and assemblies actually residing on the device after deployment do not match.
Here we can see that GHIElectronics.TinyCLR.Devices.Gpio is deployed:
Attempting to connect to device 'USB:SC13048': iteration 0.
Opening port '\\?\usb#vid_1b9f&pid_5012#5&1e9a0576&0&1#{c13bcfe9-5e84-4187-9baa-45597ffcbb6f}'.
Attaching debugger engine.
Debugger engine attached.
Generating device specific assemblies.
- FezFleaWiznet5500 v1.0.0.0 with size 524 bytes at 'C:\Users\Banjobeni\OneDrive\Projects\TinyCLR\FezFleaWiznet5500\bin\Debug\pe\FezFleaWiznet5500.pe'.
- mscorlib v2.3.0.1000 with size 72’556 bytes at 'C:\Users\Banjobeni\OneDrive\Projects\TinyCLR\FezFleaWiznet5500\bin\Debug\pe\mscorlib.pe'.
- GHIElectronics.TinyCLR.Devices.Gpio v2.3.0.1000 with size 4’880 bytes at 'C:\Users\Banjobeni\OneDrive\Projects\TinyCLR\FezFleaWiznet5500\bin\Debug\pe\GHIElectronics.TinyCLR.Devices.Gpio.pe'.
- GHIElectronics.TinyCLR.Devices.Spi v2.3.0.1000 with size 6’284 bytes at 'C:\Users\Banjobeni\OneDrive\Projects\TinyCLR\FezFleaWiznet5500\bin\Debug\pe\GHIElectronics.TinyCLR.Devices.Spi.pe'.
- GHIElectronics.TinyCLR.Native v2.3.0.1000 with size 6’200 bytes at 'C:\Users\Banjobeni\OneDrive\Projects\TinyCLR\FezFleaWiznet5500\bin\Debug\pe\GHIElectronics.TinyCLR.Native.pe'.
Total deployment size is 90’444 bytes.
Incrementally deploying assemblies to the device:
Allocating assemblies:
- Address: 0x08047000 => mscorlib
- Address: 0x08058B6C => GHIElectronics.TinyCLR.Devices.Spi
- Address: 0x0805A3F8 => GHIElectronics.TinyCLR.Native
- Address: 0x0805BC30 => GHIElectronics.TinyCLR.Devices.Gpio
- Address: 0x0805CF40 => FezFleaWiznet5500
Deploying assemblies:
- Writing sector 1: Ignored (same crc)
- Writing sector 2: Ignored (same crc)
[..]
But when running this we get this output (removed some line breaks for brevety):
Found debugger!
Create TS.
Loading Deployment Assemblies.
Attaching deployed file.
Assembly: mscorlib (2.3.0.1000) Attaching deployed file.
Assembly: GHIElectronics.TinyCLR.Devices.Spi (2.3.0.1000) Attaching deployed file.
Assembly: GHIElectronics.TinyCLR.Native (2.3.0.1000) Resolving.
Link failure: some assembly references cannot be resolved!!
Assembly: GHIElectronics.TinyCLR.Devices.Spi (2.3.0.1000) needs assembly 'GHIElectronics.TinyCLR.Devices.Gpio' (2.3.0.1000)
Error: a3000000
Waiting for debug commands...
The program '[15] TinyCLR application: Managed' has exited with code 0 (0x0).
Consequently, this matches the listed in TinyCLR Config after deployment:
So the GHIElectronics.TinyCLR.Devices.Gpio is missing although it is said to have been deployed to the device.
Steps to reproduce:
-
Flash the FEZ Flea (SC13048) with Firmware v2.3.0.1000 (RTW) (also tried v2.3.0.2000, but no help)
-
Create new Visual Studio project (using VS Extensions “TinyCLR OS Project” v2.3.0.1000")
-
Use NuGet to add references to the following libraries (in this order):
GHIElectronics.TinyCLR.Native (v2.3.0.1000)
GHIElectronics.TinyCLR.Devices.Gpio (v2.3.0.1000)
GHIElectronics.TinyCLR.Devices.Spi (v2.3.0.1000)
GHIElectronics.TinyCLR.Pins (v2.3.0.1000 (!) there is also a v2.3.0.2000 but updating to that doesn’t help either) -
Add the following code to Program.cs:
using System.Diagnostics;
using GHIElectronics.TinyCLR.Devices.Spi;
using GHIElectronics.TinyCLR.Pins;
namespace FezFleaWiznet5500 {
internal class Program {
static void Main() {
Debug.WriteLine("hello sad world.");
var spiController = SpiController.FromName(SC13048.SpiBus.Spi1);
}
}
}
Is this a bug - or what might I be doing wrong?