Main Site Documentation

VS deployment error


#1

Hi,

I have the following issue with a FEZ
when I start the debugging, VS takes a very long time before finding the device,


then stops with deployment errors : please check your hardware

I have 2 Fez (w/wifi). The problem appears only with one of them.
I have reloaded the firmware (using DfuSe Demo) and reloaded the firmware using TeraTerm (TinyCLR sees the device FEZFEZ but can’t connect).
Is there anything I can check or should I consider the FEZ as not working anymore?

thanks


#2

Part Two

I was simply trying to send some cmd to the I2C bus.
The first FEZ was connected to a Air Quality click from Mikroe (SGP30 from Sensirion ! I2C adress 0x58)

I did use the Arduino Uno Shield to connect the board to the FEZ and used the defauft I2C values for the FEZ

Code used

var settings = new I2cConnectionSettings(0x58 >> 1) (I also tried 0x58)
{
BusSpeed = I2cBusSpeed.FastMode,
};
var controller = I2cController.FromName(FEZ.I2cBus.I2c1);
var device = controller.GetDevice(settings);

while true
{
device.Write(new byte [] {32,3}); // Init_air_quality 0x2003
}

-> Throw Exception (I did try also 0058…)

and after a while FEZ not responding

Finally realize that the I2C of the FEZ is not connected to the Arduino Shield (those are the 2 only pins that are not connected)

-> try the secong FEZ

var provider = new I2cControllerSoftwareProvider(FEZ.GpioPin.A4, FEZ.GpioPin.A5, false);
var controller = I2cController.FromProvider(provider);
var device = controller.GetDevice(new I2cConnectionSettings(0x58 >> 1) { AddressFormat = I2cAddressFormat.SevenBit, BusSpeed = I2cBusSpeed.StandardMode });

while true
{
device.Write(new byte [] {32,3});
}

It did run once and gives the same exception

And since then the second FEZ is not respondig even after reset of th eFEZ, restart VS

So no working FEZ anymore. I always get Unable to communicate with device USB:FEZCLR
before buying a new one, is there any working I2C for the FEZ for any sensor (Groove, or whatever ?)

thanks


#3

it’s unlikely that you need to buy a new one.

Please attempt to completely wipe the firmware from your devices. Please document well what steps you did to do that. Please ensure that you erase your application from the devices.

It is your code that is making the device non-responsive. We’ll get you back up and working with a simple “blink” app so you can prove that, then we can work on helping you fix your code.


#4

See that code? Very quickly, it will try to send a command to the device, and then loop around to do it again. For a start, you will always want to SLEEP in that kind of loop to give the sensor some time to process the command, but also to give CPU time to the TinyCLR OS to handle things like USB communication and debugging. Plus, what good is initialising the device over and over and over and over…


#5

Hi Brett

Yes, I know. The code is not complete. After sending the Init_Air_Quaility cmd, you have to send a Measure_Air_Quality cmd in regular interval of 1 sec.
The issue I have is that the device.Write is generating an exception, so the process doesn’t even go further this line and gives a System.Invalid.Operation Exception in TinyCLR.Devices.I2C.dll

If I use I2C, the device.WritePArtial doesn’t generate exception but doesn’t really help me much to access the data
If I used Software I2C (required here as pins are not accessible in the Arduino Shield, the device.WritePartial gives the same exception


#6

What does WritePartial return?


#7

Hi John

didn’t check the return value. I was looking at the signals using the I2C Logic program (Saleae).
Then I got issue with VS that was not able to communicate with the FEZ.

Still have one hour to go with my official job. I will rewire the board to use I2C and check for the value
returned by the write partial and will let you know.


#8

Hi John

Here are the result. I2C address of the SGP30 : 0x58
I use Software I2C A4/SDA A5/SCL

Address used 0x58 << 1

Address used 0x58

Address used 0x58 >> 1

Note that this device support I2CFstmode, but in this mode, I got one exception while issuing the WritePartial

I did try device.WritePartial(new byte[] { 32,8},0,2). It doesn’t crash but gives the same result


#9

Brett
yes. Right. I did incorrectly setup the Fez while trying to connect with TinyCLR config. I have erase the program and communication with VS is ok now;


#10

Hi John

I did a third trial with a weather click and got the same issue till…
As SCL/SDA are not connected to the Arduino click shield, I have to use wires to connect the bus and voltages to the click board. I just control with a multimeter and found that one of the wires had no contact (but seems perfect from the outside). I changed the wires and the I2C read and write doesn’t throw exception anymore. But the Software I2C still not OK (in this mode, no external wires, (shield)).

image


#11

Glad to hear you got hardware I2C working. Regarding software, there were some bugs that we’ve fixed for the next release. I’d test again in a few days when we have that out if you’re interested.


#12

Yes, sure. is there already a date for the next release ? :slight_smile:


#13

No specific date just yet