Assembly link failure

Nov 10, 2012 at 9:07 PM
Edited Nov 10, 2012 at 9:14 PM

I am getting the following error when trying to deploy to a Netduino:

-------------------------------- 

Resolving.

Link failure: some assembly references cannot be resolved!!

Assembly: Toolbox.NETMF.Hardware (1.0.0.0) needs assembly 'Microsoft.SPOT.Hardware.PWM' (4.2.0.1)

Assembly: Toolbox.NETMF.Hardware (1.0.0.0) needs assembly 'Toolbox.NETMF' (0.1.0.0)

--------------------- 

Here are the versions of my software:

.net micro framework SDK 4.2 (QFE2)

Netduino SDK 4.2.1 November 2012

I downloaded the toolbox yesterday.

 

I found Moicrosoft.Spot.Hardware.PWM 4.2.0.1, and added it to my project but it does not help

I don't know how to resolve the assembly issue where Toolbox.NETMF is the wrong version, they all came in the same package.

 

Any help would be appreciated as I have no idea how to proceed.

Thanks!

 

Nov 11, 2012 at 7:52 AM

Hi there!

Quick question: are you using vb.net or c#?

Nov 11, 2012 at 3:37 PM

 

Thanks for the response. It was VB.net but I went ahead and built it in C# to check and it gave the same exact error.

The code is a sample I found online to use MultiI2C in the toolkit to run a 16 PWM board from adafruit.

 

Here is the offending class

/* 
* 
*      Adafruit 16 channel 12 bit PWM Servo Driver NETMF 
*      *      Code Translated by Brandon Watt Oct 2012 
*      *       * This board use I2C to communicate, 2 pins are required to  
*      * interface. For Netduino/Arduino Uno, thats SCL -> Analog 5, SDA -> Analog 4 
*      *  * Brandon Watt: Inital release (1.0) Translated arduino code into c# 
*      * Based on driver files found at "https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library" *
*      */
        
using System;
using Microsoft.SPOT;
using System.Threading;
using Toolbox.NETMF.Hardware;

namespace CsAdafruitPWM
{
    class Ada16PWM
    { 
    private MultiI2C _Device;
        private const byte PCS9685_SUBADR1 = 0x2;
        private const byte PCA9685_SUBADR2 = 0x3;
        private const byte PCA9685_SUBADR3 = 0x4;
        private const byte PCA9685_MODE1 = 0x0; 
        private const byte PCA9685_PRESCALE = 0xFE; 
        private const byte LED0_ON_L = 0x6;   
        private const byte LED0_ON_H = 0x7;     
        private const byte LED0_OFF_L = 0x8;   
        private const byte LED0_OFF_H = 0x9;      
        private const byte ALLLED_ON_L = 0xFA;   
        private const byte ALLLED_ON_H = 0xFB;      
        private const byte ALLLED_OFF_L = 0xFC;       
        private const byte ALLLED_OFF_H = 0xFD;       
        private byte _i2caddr;
        public Ada16PWM(byte addr = 0x40, int ClockRateKhz = 200)        
        {            
            _i2caddr = addr; 
            this._Device = new MultiI2C(_i2caddr, ClockRateKhz);
        }        
        public void Begin()        
        {            
            Reset();        
        }        
        public void Reset()       
        {           
            write8(PCA9685_MODE1, 0x0);        
        }        
        public void setPWMFreq(float freq)        
        {            
            float prescaleval = 25000000;            
            prescaleval /= 4096;           
            prescaleval /= freq;            
            prescaleval -= 1;           
            // Debug.Print("Estimated pre-scale: " + prescaleval);            
            byte prescale = (byte)System.Math.Floor(prescaleval + 0.5);           
            // Debug.Print("Final Pre-scale: " + prescale);            
            byte oldmode = read8(PCA9685_MODE1);            
            byte newmode = (byte)((oldmode & 0x7F) | 0x10); // sleep            
            write8(PCA9685_MODE1, newmode); // go to sleep            
            write8(PCA9685_PRESCALE, prescale); // set the prescaler           
            write8(PCA9685_MODE1, oldmode);            
            Thread.Sleep(5);            
            write8(PCA9685_MODE1, (byte)(oldmode | 0x80));       
        }        
        public void setPWM(byte num, UInt16 on, UInt16 off)       
        {          
            write8((byte)(LED0_ON_L + 4 * num), (byte)on);     
            write8((byte)(LED0_ON_H + 4 * num), (byte)(on >> 8));          
            write8((byte)(LED0_OFF_L + 4 * num), (byte)off);         
            write8((byte)(LED0_OFF_H + 4 * num), (byte)(off >> 8));      
        }        private byte read8(byte addr)      
        {            
            byte[] ReadBuffer = new byte[1];           
            this._Device.WriteRead(new byte[] { addr }, ReadBuffer);        
            return ReadBuffer[0];      
        }       
        private void write8(byte addr, byte d)       
        {           
            this._Device.Write(new byte[] { addr, d });        
        }    
    }
}



Nov 16, 2012 at 6:12 AM

I'm having the same problem. I'm using a Netduino Plus, SDK 4.1 and Toolbox 19492. My code downloads until a add a ref to Toolbox.NETMF.

When I do that I see the following:

----------------------------------------------------------------------------------------------------------------------

Resolving.

Link failure: some assembly references cannot be resolved!!


Assembly: Toolbox.NETMF (0.1.0.0) needs assembly 'mscorlib' (4.2.0.0)

Assembly: Toolbox.NETMF (0.1.0.0) needs assembly 'Microsoft.SPOT.Hardware' (4.2.0.0)

Error: a3000000

Waiting for debug commands...

The program '[1] Micro Framework application: Managed' has exited with code 0 (0x0).

--------------------------------------------------------------------------------------------------------------------------------------

Any suggestions?

 

Thanks

Michael Dent

Nov 21, 2012 at 7:22 PM

Interesting. Just to be sure, I just recompiled all DLLs. Could you download the latest, and try it again please?

http://netmftoolbox.codeplex.com/SourceControl/changeset/view/20014

Nov 23, 2012 at 6:23 AM

That did it for me. No errors when downloading the assembly.

 

Thanks

Mike