Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Netduino Firmware v4.2.0 RC3 (all editions)


  • Please log in to reply
112 replies to this topic

#21 Valkyrie-MT

Valkyrie-MT

    Advanced Member

  • Members
  • PipPipPip
  • 315 posts
  • LocationIndiana, USA

Posted 21 October 2011 - 05:50 PM

This looks a bit like this issue:
http://netduino.code....com/workitem/2
Or am I wrong? :)


Actually, I think you ARE wrong :). The codeplex issue is about double.Parse throwing a not implemented exception and another issue which looks like it exceeds the range of a long. The problem Stavros describes here looks different to me.

-Valkyrie-MT

#22 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 21 October 2011 - 05:52 PM

Actually, I think you ARE wrong :). The codeplex issue is about double.Parse throwing a not implemented exception and another issue which looks like it exceeds the range of a long. The problem Stavros describes here looks different to me.

Actually that issue #2 should be two issues :D
I also mention some strange calculations when using a Long in a Double calculation.

Either way, I'm sure Chris will figure the bug(s) out, eventually :D
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#23 Valkyrie-MT

Valkyrie-MT

    Advanced Member

  • Members
  • PipPipPip
  • 315 posts
  • LocationIndiana, USA

Posted 21 October 2011 - 06:10 PM

Actually, I think you ARE wrong :). The codeplex issue is about double.Parse throwing a not implemented exception and another issue which looks like it exceeds the range of a long. The problem Stavros describes here looks different to me.


OK, I think I figured out some of it. It's a casting issue, a typo, and an overflow. To get the correct value that Stavros indicated, the variable should be 8242800 (needs another 0 on the end -- typo?). Now, if you cast the 3000 as an integer, you can reproduce the answer of -62.072... But why the heck is it -62? It looks like netduino does the multiply of 3000 x 8242800 as integers first, then casts as double, but if you multiply those, that overflows the integer datatype by exceeding 2,147,483,647. If it were cast as a single first, it would not overflow and give you the right answer.

On .NET Framework 3.5 (Desktop computer)
(double)((3000.0d * (int)8242800) / 16777216);
1473.9274978637695
(double)(((int)3000.0 * (int)8242800) / 16777216d);
-62.072502136230469

I will have to try this on my netduino and emulator later and with version 4.1 firmware.

-Valkyrie-MT

#24 Dixon

Dixon

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 21 October 2011 - 07:50 PM

Its SimpleStorage included already?

#25 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 22 October 2011 - 12:15 AM

Valkyrie-MT, very interesting! The .NET MF team made some big changes to the floating point support in .NET MF 4.2...perhaps there are a few kinks to work out still. Dixon, we're setting up .NET MF 4.2 for Simple Storage support. The framework is there; we still need to work out the implementation details. Chris

#26 Valkyrie-MT

Valkyrie-MT

    Advanced Member

  • Members
  • PipPipPip
  • 315 posts
  • LocationIndiana, USA

Posted 22 October 2011 - 02:38 AM

Didnt know people started uploading issues there.


I think this is a great test case and is easy to reproduce, so I opened a ticket just for this. People can vote for it here:

http://netmf.codeple...m/workitem/1320

Good find Stavros!

-Valkyrie-MT

#27 ajcg1973

ajcg1973

    Advanced Member

  • Members
  • PipPipPip
  • 71 posts

Posted 22 October 2011 - 06:32 AM

I'm having an issue with double.ToString(string format). I have existing code that calculates temperature and then displays the result to the debug window. In 4.1.0.6 I used .ToString("N2") to round up to two places on my Mini and after the upgrade to 4.2 the ToString(*) call no longer works. No matter what value I give "N" I get the full value. I have done a simple test on the emulator and that is working fine. Here is a basic code example to demonstrate:


public static void Main()
{
	double testDbl = 123.456789;

	Debug.Print(testDbl.ToString());
	Debug.Print(testDbl.ToString("N1"));
	Debug.Print(testDbl.ToString("N2"));
	Debug.Print(testDbl.ToString("N3"));
	Debug.Print(testDbl.ToString("N4"));

	Thread.Sleep(Timeout.Infinite);
}

Outputs in the Debug window for the emulator:
The thread '<No Name>' (0x2) has exited with code 0 (0x0).
123.456789
123.5
123.46
123.457
123.4568

Outputs in the Debug window for the Mini:
 The thread '<No Name>' (0x2) has exited with code 0 (0x0).
123.4568
123.4568
123.4568
123.4568
123.4568


#28 Stavros Tekes

Stavros Tekes

    Member

  • Members
  • PipPip
  • 17 posts
  • LocationThessaloniki, Greece

Posted 22 October 2011 - 11:19 AM

I think this is a great test case and is easy to reproduce, so I opened a ticket just for this. People can vote for it here:

http://netmf.codeple...m/workitem/1320

Good find Stavros!

-Valkyrie-MT


Hi Valkyrie,

I had it posted on the netduino issue tracker since I didnt know if the problem was on netmf or netduino. The link to that is http://netduino.code....com/workitem/6

Cheers
Stavros

#29 Dan T

Dan T

    Advanced Member

  • Members
  • PipPipPip
  • 91 posts
  • LocationBoston (Greater)

Posted 23 October 2011 - 02:30 AM

I'm having an issue with double.ToString(string format).


Confirmed with my own code (format string "F5"). Works fine in emulator.

BTW, Where the heck is the help page for these format strings? (Where in "PSDK.chm", I mean.)

#30 ajcg1973

ajcg1973

    Advanced Member

  • Members
  • PipPipPip
  • 71 posts

Posted 23 October 2011 - 06:04 AM

Confirmed with my own code (format string "F5"). Works fine in emulator.

BTW, Where the heck is the help page for these format strings? (Where in "PSDK.chm", I mean.)



Here is where I have been looking for the string format options for an int32 on NetMF 4.1: http://msdn.microsof...y/ee436732.aspx. I'm not sure if anything has changed for 4.2 but I doubt it (except I did her hear a rumor that you can use "X" now to output the hex string).

#31 baxter

baxter

    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 23 October 2011 - 06:45 PM

Format "x2" works for byte to hex in 4.2RC1,
Public Function bytesToHexString(ByVal arr() As Byte,
                          Optional ByVal addSpc As Boolean = False) As String
        Dim sb As New System.Text.StringBuilder()
        Dim separator As String = String.Empty
        If (addSpc) Then separator = " "
        For i As Integer = 0 To arr.Length - 1
            sb.Append(arr(i).ToString("x2") & separator)
        Next i
        Return sb.ToString.TrimEnd
    End Function
Baxter

#32 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 23 October 2011 - 08:00 PM

about the toString issue. I looked into this, it's not a Netduino specific bug but a .NET Microframework issue, so I created an item about it to their bugtracker: http://netmf.codeple...m/workitem/1322
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#33 Alladdin

Alladdin

    New Member

  • Members
  • Pip
  • 5 posts

Posted 24 October 2011 - 07:31 AM

Very interesting. A puzzle! :)

If you ping the device in MFDeploy (after flashing the bootloader and before uploading TinyCLR) what message do you get?

Also, if you hold down the pushbutton on your Netduino Plus after plugging it into your PC...and then press Ping in MFDeploy, what message do you get?

Chris


Some update:

I tried other netduino (no plus), here is my steps:

- Run MFDepoly
- Connect netduino with pushed button
- Erase (fw, storage, deployment)
- Reconnect netduino with pusheded button
- Deploy FW 4.2 RC3
- Reconnect netduino
- Ping with response 'tinyclr'
- Run VisualStudio
- Deploy project
- After that netduino flashes with blue led (maybe restart), no debug log output but application running (led on pin flashes)
- Run MFDeploy
- Reconnect netduino
- No response to ping

I tried it with both old and new bootloaders.

I have windows XP. Is there anybody with WinXP and working 4.2 RC3 FW?

#34 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 24 October 2011 - 08:02 AM

Hi Alladdin, Did you stop the debugger in Visual Studio before reconnecting Netduino and trying to ping it? If not, Visual Studio will automatically reconnect to your Netduino. Also, if you hold down the pushbutton on your Netduino while plugging it into your PC...it will go into bootloader mode. Chris

#35 Alladdin

Alladdin

    New Member

  • Members
  • Pip
  • 5 posts

Posted 24 October 2011 - 11:38 AM

Hi Alladdin,

Did you stop the debugger in Visual Studio before reconnecting Netduino and trying to ping it? If not, Visual Studio will automatically reconnect to your Netduino.

Also, if you hold down the pushbutton on your Netduino while plugging it into your PC...it will go into bootloader mode.

Chris


Yes, I stopped debugger before reconnect.

I must hold down the button if I want to deploy new FW. If I try to deploy firmware without entering bootloader (hold down the button) then it's not possible to deploy FW because connect to bootloader fails.

It's look like I have problem with my computer, windows or usb driver.

#36 Species8372

Species8372

    New Member

  • Members
  • Pip
  • 7 posts

Posted 24 October 2011 - 12:24 PM

Hi all, sorry for being the bad guy, but i really miss * the interop entry-point or * the gcc-buildable source :'-( Species8372

#37 sjr84

sjr84

    New Member

  • Members
  • Pip
  • 1 posts

Posted 24 October 2011 - 08:14 PM

There appears to be an issue with HttpWebRequest in this new firmware. I've reduced my code to the simplest test case of making the request and trying to get the response, but it seems to freeze on getting the response (pressing pause in Visual Studio shows that the execution never gets past that line.

public static void Main()
{
    Debug.Print(Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()[0].IPAddress);
    HttpWebRequest request = HttpWebRequest.Create("http://example.com") as HttpWebRequest;
    Debug.Print("Request created");
    WebResponse response = request.GetResponse();
}
Any ideas? It also used to freeze on the previous RC's but only if unplugging the network cable, and then re-plugging it back in (or dropping the connection some other way). As a note it works fine in the emulator, so assume its an issue with the firmware.

#38 PhilG

PhilG

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationMaine

Posted 24 October 2011 - 09:38 PM

When I updated v4.1.0.6 to v4.2RC1 last week, my code that connects to a time server stoped working. It seems that the following doesn't work: s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); s.Connect(ep); Whereas the following does work (for a different endpoint): s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); s.Connect(ep); The endpoints are correct in both cases. Is this a known problem? If so, has it been fixed in RC3? Also with 4.2RC1 the reset button must be used to get the debugger to run after every deploy. The USB cable needs to be disconnected about one in 10 times to get deployment. VS Pro 2010 crashes during deployment about 2-3 times a day, usually after fiddling with the USB cable during a deploy.

#39 Valkyrie-MT

Valkyrie-MT

    Advanced Member

  • Members
  • PipPipPip
  • 315 posts
  • LocationIndiana, USA

Posted 24 October 2011 - 11:07 PM

When I updated v4.1.0.6 to v4.2RC1 last week, my code that connects to a time server stoped working.


This was previously reported and worked around here.

Also, I do believe the fix for this was in the 4.2 RC3 firmware.

With respect to the unplugging the USB cable and pressing the reset button... I have to do the same thing myself. I hope it gets fixed soon...

-Valkyrie-MT

#40 Silent12

Silent12

    New Member

  • Members
  • Pip
  • 5 posts

Posted 24 October 2011 - 11:41 PM

Okay, like nothing is working with this RC3 ... even Socket.Connect is now broken ... Seriously, how many people are working on this, one or what ? Could you upload the RC1 firmware somewhere ? (why do you replace the post with the RC3 !?)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.