This looks a bit like this issue:
http://netduino.code....com/workitem/2
Or am I wrong?
Actually, I think you ARE wrong

-Valkyrie-MT
![]() |
  | |||||||||||||
![]() |
|
![]() |
||||||||||||
![]() Netduino Firmware v4.2.0 RC3 (all editions)
Started by Chris Walker, Oct 21 2011 04:06 AM
112 replies to this topic
#21
Posted 21 October 2011 - 05:50 PM
Actually, I think you ARE wrong ![]() -Valkyrie-MT
#22
Posted 21 October 2011 - 05:52 PM Actually that issue #2 should be two issues ![]() 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 ![]()
"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
Posted 21 October 2011 - 06:10 PM
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
Posted 21 October 2011 - 07:50 PM
Its SimpleStorage included already?
#25
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
Posted 22 October 2011 - 02:38 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
#27
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
Posted 22 October 2011 - 11:19 AM
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
Posted 23 October 2011 - 02:30 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.)
#30
Posted 23 October 2011 - 06:04 AM
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
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 FunctionBaxter
#32
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
Posted 24 October 2011 - 07:31 AM
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
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
Posted 24 October 2011 - 11:38 AM
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
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
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
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
Posted 24 October 2011 - 11:07 PM
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
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 topic0 members, 0 guests, 0 anonymous users | ||||||||||||||
![]() |
||||||||||||||
![]() |
|
![]() |
||||||||||||
![]() |
This webpage is licensed under a Creative Commons Attribution-ShareAlike License. | ![]() |
||||||||||||
![]() |