How to deploy TinyCLR to FEZ Raptor and porting the Gadgeteer modules drivers to TinyCLR

My point exactly. Please re-read my post.

Truth Table time

A = (ud != 0x54)
B = (ud != 0x55)

where ud = 0x54… A = FALSE, B= TRUE, A && B = FALSE
where ud = 0x55… A = TRUE, B = FALSE, A && B = FALSE
where ud = anything else… A = TRUE, B = TRUE, A && B = TRUE.

so the code as shown:

if (ud != 0x55 && ud != 0x54)
                this.ErrorPrint("Setting the display configuration failed.");

will trigger the error display when ud isn’t returned as 0x54 or 0x55. You need to check what the return value is and see what that really means (datasheet time)

Edit: this code just makes more sense as:

if (!(ud == 0x55 || ud == 0x54))
                this.ErrorPrint("Setting the display configuration failed.");

3 Likes

@ Brett - De Morgan’s Law to the rescue!

1 Like

ok driver for :
-RFIDReader
-XbeeAdapter
-PulseOximeter

are ready…

get it from GitHub - Gravicode/GadgeteerToTinyCLR: This is our effort to port gadgeteer modules/mainboards to TinyCLR

Thanks to Dave for xbee module. :wink:

I need some help, in some method in serial cam L1 driver, it is always throw an exception… I have added more delay, still error…
This method will read sequential data from camera with UART

I would hold on using serial until we bring back G400 to TinyCLR.

Thankyou, this worked to update bootloader, was always showing 2.0.1 even after transfer.
Even in the video (very nice video, thanks mif) the xmodem transfer seems to time out?
Was it successful?

After upgrading to Bootloader 2.0.2 and Firmware 0.4.0 (tried 0.3.0 also) Im still having trouble deploying assemblies to the G400 Raptor.

Using Nuget Packages v0.4.0

Seems to suggest Firmware is not correct, but I did appear to successfully update to v0.4.0
How can I tell what version of firmware is actually running?

VS2017 Output:-

Found debugger!
Create TS.
Loading start at 2005e600, end 2005e68c

Assembly: mscorlib (0.0.0.0) Loading Deployment Assemblies.

Attaching deployed file.

Assembly: G400TinyCLR4 (1.0.0.0) Attaching deployed file.

Assembly: GHIElectronics.TinyCLR.Core (0.4.0.0)

Error: the reference GHIElectronics.TinyCLR.Core cannot be used with this version of the firmware.

Please make sure your firmware and references have the same major and minor version.

Firmware checksum 0xB6206F22 does not match the assembly checksum 0x406CD440.

Resolving.

Link failure: some assembly references cannot be resolved!!

Assembly: G400TinyCLR4 (1.0.0.0) needs assembly ‘GHIElectronics.TinyCLR.Core’ (0.4.0.0)

Error: a3000000

Waiting for debug commands…

The program ‘[7] TinyCLR application: Managed’ has exited with code 0 (0x0).

You do not have the correct assemblies. Do you have everything 0.4.0 installed, including the extension? Did you start a new project?

Thankyou!

So Tried on G120, same result

Updated G120 to TinyClr 0.4.0
New Project
(Defaulted to 0.5.0 TinyCLR.Core (as have 3/4/5 local NuGet)
DownGraded to v0.4.0
Built
Deployed and get same on G120, Im missing something obvoius?
Checked Reference in Object Browser and it shows GHIElectronics.TinyCLR.Core runtime version v4.0.30019 and Version 0.4.0.0
VS2017

Found debugger!

Create TS.

Loading start at 41ab0, end 41b3c

Assembly: mscorlib (0.0.0.0) Loading Deployment Assemblies.

Attaching deployed file.

Assembly: G120TinyCLR4 (1.0.0.0) Attaching deployed file.

Assembly: GHIElectronics.TinyCLR.Core (0.4.0.0)

Error: the reference GHIElectronics.TinyCLR.Core cannot be used with this version of the firmware.

Please make sure your firmware and references have the same major and minor version.

Firmware checksum 0xB6206F22 does not match the assembly checksum 0x406CD440.

Resolving.

Link failure: some assembly references cannot be resolved!!

Assembly: G120TinyCLR4 (1.0.0.0) needs assembly ‘GHIElectronics.TinyCLR.Core’ (0.4.0.0)

Error: a3000000

Waiting for debug commands…

The program ‘[10] TinyCLR application: Managed’ has exited with code 0 (0x0).

Re-installed VS Extention and says “Already Installed”

Uninstall the extension first.

1 Like

Thanks for your time, appreciated! Really want to get this going on either G400 or G120 board…

Hmmm, Yes VS2017 Preview it did say I had “Tiny CLR OS Project System” 0.5.0 Installed.
Interesting, as if I look at the TinyCLR 0.5.0 dowload ZIP I had it doesn’t contain a .vsix extention so not sure where I got the new 0.5.0 extension from. Maybe an Auto Upgrade?

So now running Extension 0.4.0

But same result.
Also have re-burn Bootloader and Firmware for G120 G120 Firmware.0.4.0.ghi several times now…
I must be stupid!

How can I tell what version of the Firmware has been burnt into the SOC?

HANG on!!!

Reset G120 and Now working!!!

I am stupid!
Sorry to waste your time.
Wonder where the 0.5.0 VS vsix Extention came from…
I didn’t un-install it because I assumed that the vsix extention was just deployment tooling only and not tied to a ‘SDK’ version, my wrong assumption.

Does this extension force the 0.5.0 assemblies to be linked? Even though Im referencing 0.4.0 ??

1 Like

Hello! I am beginning my attempts to use the drivers from that repository.

The example (TinyApp) links to TinyCLR references v 0.4.0 - it wasnt that difficult to get it to all build with 0.6.0 (just removing a reference to G400s.i2sbus I think

However I ran into my first stumbling block trying to use the TestMotor() / MotorDriverL298 object

The example shows use with a FEZRaptor, but when I change to FEZReaper, there looks to be a completely different abstraction for the PWM items in the associated socket items in the Reaper object vs the Raptor object.

Can anyone see how one could instantiation a MotorDriverL298 using a FEZReaper instead of a FEZRaptor?

Existing sample:

static void TestMotor()
{
    MotorDriverL298 motor = new MotorDriverL298(FEZRaptor.Socket18.PwmPin.Controller0.Id, FEZRaptor.Socket18.PwmPin.Controller1.Id,
       FEZRaptor.Socket18.PwmPin.Controller0.PC18, FEZRaptor.Socket18.PwmPin.Controller1.PC19, FEZRaptor.Socket18.Pin6, FEZRaptor.Socket18.Pin9);
    motor.SetSpeed(MotorDriverL298.Motor.Motor1, -0.8);
    motor.SetSpeed(MotorDriverL298.Motor.Motor2, -0.8);
    Thread.Sleep(Timeout.Infinite);
}

(The FEZReaper.Socket objects do not have PwmPin)

Time to RTFM :wink:
http://docs.ghielectronics.com/tinyclr/tutorials/pwm.html
For example, PwmController.FromId(FEZ.PwmPin.Controller4.Id) should start you down the South Island Garden Path you were looking for - just don’t stop for any hobbits you see!