Netduino home hardware projects downloads community

Jump to content

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

rockybooth's Content

There have been 16 items by rockybooth (Search limited from 05-July 19)

By content type

See this member's

Sort by                Order  

#57997 Netduino Plus 2 Firmware v4.2.2 (update 2)

Posted by rockybooth on 07 May 2014 - 06:11 PM in Netduino Plus 2 (and Netduino Plus 1)

I have had no problems with Win8 or 8.1.  Check you driver version, and see how it shows up in Device Manager.  Sometimes NETMF devices will show up as something not properly identified.  Trying connecting and disconnecting to see if something appears/disappears. Then see how it is identified.

#54845 Read problems from SD Card

Posted by rockybooth on 23 December 2013 - 07:57 PM in Netduino Plus 2 (and Netduino Plus 1)

I do not see a ReadLine method for FileStream.  Perhaps you could post an example.


#54828 Read problems from SD Card

Posted by rockybooth on 23 December 2013 - 05:16 AM in Netduino Plus 2 (and Netduino Plus 1)


I was wondering if anyone had any suggestions on this, or if I should just consider the SDCard ability unreliable, perhaps until the next OS revision comes along?

Have a great Christmas!

#54507 How do I monitor MISO/DRDY?

Posted by rockybooth on 06 December 2013 - 01:13 AM in General Discussion

I was able to use leiba's suggestion of monitoring the conversion complete signal with this:

    Public Function ReadVolts() As Single        _spi.Dispose()        Dim cs As New OutputPort(_pin, False)        Dim adcout As New InputPort(Pins.GPIO_PIN_D12, False, Port.ResistorMode.Disabled)        While adcout.Read = True        End While        cs.Dispose()        adcout.Dispose()        SetupSPI()        Write7799Reg(&H58)        Return ReadAD7799Volts()    End Function

Has anyone had success with a different method?



#54137 Read problems from SD Card

Posted by rockybooth on 17 November 2013 - 11:06 PM in Netduino Plus 2 (and Netduino Plus 1)


I reproduced this bug on another Netduino 2+ card with 1GB Sandisk card. 

I would really appreciate if someone could reproduce or not reproduce this issue.  At this point I am wondering if the SD card read is dependable (at least in VB). Alternately if anyone has a test sequence in VB that I could try, I would appreciate it.

Here is some more information on my toolchain:



Create TS.
 Loading start at 806a988, end 8085288
Assembly: mscorlib (
Assembly: Microsoft.SPOT.Native (
Assembly: Microsoft.SPOT.Hardware (
Assembly: Microsoft.SPOT.Net (
Assembly: System (
Assembly: Microsoft.SPOT.Hardware.SerialPort (
Assembly: Microsoft.SPOT.IO (
Assembly: System.IO (
Assembly: Microsoft.SPOT.Hardware.PWM (
Assembly: Microsoft.SPOT.Hardware.Usb (
Assembly: SecretLabs.NETMF.Diagnostics (
Assembly: SecretLabs.NETMF.Hardware.Netduino (
Assembly: Microsoft.SPOT.Hardware.OneWire (
Assembly: Microsoft.SPOT.Time (
Loading Deployment Assemblies.
Attaching deployed file.
Assembly: Microsoft.VisualBasic (
Attaching deployed file.
Assembly: Microsoft.SPOT.Graphics (
Attaching deployed file.
Assembly: SecretLabs.NETMF.IO (
Attaching deployed file.
Assembly: CFcardUsage (
Attaching deployed file.
Assembly: SecretLabs.NETMF.Hardware.AnalogInput (
Attaching deployed file.
Assembly: SecretLabs.NETMF.Hardware (
The debugging target runtime is loading the application assemblies and starting execution.


#54133 SPI issue: bad first write

Posted by rockybooth on 17 November 2013 - 09:33 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks Baxter:

In looking at both the logic analyzer and scope, I have attached a scope trace showing what happens.  Ignore the yellow (reply from device or MISO) - the green is CS(bar), pink MOSI, and blue is the clock. You can see that the clock goes low before CS, but then after CS seems to go high impediance (made an input?), then finally reaches a "1" and works fine after that. However, the external device (and logic probe) thinks the drift higher is a clock edge, and thus gets nine clock cycles, not eight.  

Adding an external pull up on the clock seems to help.

This seems a clear bug in the SPI, but one that will only show up on the first write.  Some applications and external devices may not show a problem. The AD7799 that I am targeting has Schmit triggers on its inputs, so the slow rise work "just fine" (not).

It would be nice to get a response from Chris on this.  


Attached Thumbnails

  • galleryContent-1149405514.png

#54120 SPI issue: bad first write

Posted by rockybooth on 16 November 2013 - 09:23 PM in Netduino Plus 2 (and Netduino Plus 1)


I am working on adding an spi device and only the first write after initialization appears corrupted, with subsequent writes being correct.  Perhaps I do not have the latest firmware or drivers.  Since this is simply writing, it is my understanding that it should not depend on if a device is attached.  My full code did not work, so I have reduced this to this simplest task hoping that someone might help.

Here is the code, and at the bottom are the versions of the tool chain.

Option Explicit OnOption Strict OnImports System.IOImports System.ThreadingImports System.IO.PortsImports Microsoft.SPOT'Imports Microsoft.SPOT.Hardware'Imports Microsoft.SPOT.Net.NetworkInformationImports SecretLabs.NETMF.HardwareImports SecretLabs.NETMF.Hardware.NetduinoImports Microsoft.VisualBasic.ConstantsNamespace TestADC7799    Public Module Module1        Dim _spi As SPI        Sub Main()            Debug.Print("Startup")            SetupSPI()            For j As Byte = 0 To 254                Write7799Reg(j)            Next j            Debug.Print("Finished")        End Sub        ''' <summary>        ''' Configures SPI parameters particular to ths ADC 7799        ''' </summary>        ''' <remarks></remarks>        Sub SetupSPI()            Dim _csht As UInteger = 1  ' _chipselect holdtime mS (time that CD must remain active before unselecting, or time after the read write completion)            Dim _csas As Boolean = False ' Chip select active state            Dim _csst As UInteger = 10 ' Chip select Setup Time mS (time acter cs before reading)            Dim _ce As Boolean = True  ' If true, data is sampled on the rising edge, else falling edge            Dim _cis As Boolean = True  ' click idle state, high if true            Dim _cr As UInteger = 100    ' clock frequency in kHz            Dim spiConfig As New SPI.Configuration(Pins.GPIO_PIN_D10, _csas, _csst, _csht, _cis, _ce, _cr, Microsoft.SPOT.Hardware.SPI.SPI_module.SPI1)            _spi = New SPI(spiConfig)        End Sub        Sub Write7799Reg(something As Byte)            Dim b(0) As Byte            Debug.Print("Writing Register 1 byte " & something.ToString("X"))            b(0) = something            _spi.Write(b)        End Sub    End ModuleEnd Namespace

The output window shows:

Assembly: Microsoft.VisualBasic (
Assembly: Microsoft.SPOT.Graphics (
Assembly: SecretLabs.NETMF.IO (
Assembly: SecretLabs.NETMF.Hardware.AnalogInput (
Assembly: SecretLabs.NETMF.Hardware (
MFDeploy reports:

Pinging... TinyCLR


HalSystemInfo.halVendorInfo:   Netduino Plus 2 (v4.2.2.2) by Secret Labs LLC

HalSystemInfo.oemCode:   34

HalSystemInfo.modelCode:   177


The logic analyzer shows that the initial idle state of the CLK line does not match the settings.


My code is attached.




Attached Thumbnails

  • Capture.PNG

#54047 Read problems from SD Card

Posted by rockybooth on 12 November 2013 - 06:52 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi All:


I have been having mixed success with SD.   I can usually write to the SD card, and read the contents in my PC.  However, when I execute the code below, it will ALWAYS crash during the read segment (ReadFile).  It always crashed with this being displayed in the debug window: A first chance exception of type 'System.IndexOutOfRangeException' occurred in System.IO.dll

Error in ReadFile; Exception was thrown: System.IndexOutOfRangeException
This may happen after 78 lines read, or after as many as 778 reads, or various numbers in between.


I am using the latest 4.2 firmware, Visual Studio 2012 Pro, Visual Basic, NetFramework 4.2.

I am using a SanDisk 128MB microSD card.


As this fails after different number of reads, perhaps the hardware is bad.  On this assumption I ordered another Netduino Plus 2 which I will try tonight. 


I see in the forums that there seem to be quite a bit of problems with the SD card.  If anyone has any suggestion on how to resolve this, please comment!  


Thanks .  


Imports System.netImports System.Net.SocketsImports System.IOImports System.TextImports System.ThreadingImports System.IO.PortsImports Microsoft.SPOTImports Microsoft.SPOT.HardwareImports Microsoft.SPOT.Net.NetworkInformationImports Microsoft.SPOT.IOImports SecretLabs.NETMF.HardwareImports SecretLabs.NETMF.Hardware.NetduinoImports Microsoft.VisualBasic.ConstantsNamespace CFcardUsage    Public Module Module1        Dim cardPresent As Boolean = True        Sub Main()            ' eject handler suggested by Stephan at            AddHandler SPOT.IO.RemovableMedia.Eject, AddressOf RemovableMedia_Eject            AddHandler Microsoft.SPOT.IO.RemovableMedia.Insert, AddressOf RemovableMedia_Insert            Debug.Print("Startup CF Card Usage")            ' Define path and filename            Dim strPath As String = "SD" & DateTime.Now.ToString("yyyyMM")            Dim strFileName As String = strPath & "" & DateTime.Now.ToString("yyyyMMdd") & ".log"            ' make sure disk is there and create directory if needed            Try                If Not File.Exists(strFileName) Then ' ** This shows a AND the following line executes, also throwing an exception                    If Not Directory.Exists(strPath) Then '** This also shows a System.IO.IOexception in debugger, and the following line executes                        Directory.CreateDirectory(strPath) ' ** the exception appears to be thrown her and goes to the catch                    End If                End If            Catch ex As Exception                Debug.Print("Exception thrown - " & ex.Message)                Debug.Print("Presumably there is no readable card present")                cardPresent = False            End Try            ' if no card is found, wait for one to be inserted            Do While True                If cardPresent Then Exit Do                Debug.Print("insert card")                Threading.Thread.Sleep(1000)            Loop            Debug.Print(strFileName)            ' open the streamwriter            Dim sw As StreamWriter = New StreamWriter(File.OpenWrite(strFileName))            sw.WriteLine("This is to write the files to the netduino card")            'lets learn how fast we can write to these cards            Dim StartTime As DateTime = DateTime.Now            Dim excp As Boolean = False            For i As Integer = 0 To 10000                Dim t As String = DateTime.Now.ToString                Dim EndTime As TimeSpan = DateTime.Now.Subtract(StartTime)                Try  ' if this fails, lets get the error, and stop writing so I can see if prior data is ok                    sw.Write("Memory usage " & Microsoft.SPOT.Debug.GC(False).ToString & "; Elapsed time " & EndTime.Seconds.ToString & "." & EndTime.Milliseconds.ToString)                    sw.WriteLine("; line number " & i.ToString & " at " & t & ", ms counter = " & DateTime.Now.Millisecond.ToString & ", tics= " & DateTime.Now.Ticks.ToString & ", machine time " & Hardware.Utility.GetMachineTime.Ticks.ToString)                Catch ex As Exception                    Debug.Print("Exception " & ex.Message & ", at i=" & i.ToString & ", ET= " & EndTime.ToString)                    ' exit the write loop                    Exit For                End Try                If i Mod 1000 = 0 Then Debug.Print(i.ToString)            Next            ' try everything possible to make sure the writes are complete to the card            sw.Flush()            sw.BaseStream.Flush()            sw.BaseStream.Close()            sw.Dispose()            ' if there was a write error, just exit, otherwise read back the contents            If Not excp Then ReadFile(strFileName)        End Sub        Sub ReadFile(filename As String)            ' this will read and display the contents of the card.            If File.Exists(filename) = False Then                Debug.Print("File does not exist")                Return            End If            Dim sr As StreamReader = New StreamReader(filename)            Dim s As String = ""            Do                Try                    s = sr.ReadLine() ' crashes with index out of range exception ( after some number of reads                Catch ex As Exception ' must use a try/catch or file will be deleted or not found. Does not seen to always work                    Debug.Print("Error in ReadFile; " & ex.Message)                    Exit Do                End Try                Debug.Print("Mem now: " & Microsoft.SPOT.Debug.GC(False).ToString & "; Recorded data: " & s)            Loop Until sr.EndOfStream            Debug.Print("Last line read was: " & s)            sr.Close()            sr.Dispose()        End Sub        Sub RemovableMedia_Eject(sender As Object, e As Microsoft.SPOT.IO.MediaEventArgs)            Debug.Print("Ejected")            cardPresent = False        End Sub        Sub RemovableMedia_Insert(sender As Object, e As Microsoft.SPOT.IO.MediaEventArgs)            Debug.Print("Inserted or present")            cardPresent = True        End Sub    End ModuleEnd Namespace


#53971 Netduino Plus 2 Firmware v4.2.2 (update 2)

Posted by rockybooth on 11 November 2013 - 05:13 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi Noxia:

That may be the problem.  When I look in the Framework folders, I see the different versions of the frameworks, each with a tools folder, but the only one with the tool present is 4.3.  I originally installed 4.3 because I use Visual Studio 2012 Pro and I want to work in VB.  The tools documentation for the Netduino 2 Plus say you must use C# Express 2010.  If I try to install the Framework 4.2 it refuses as I do not have Visual Studio 2010.  

Version 4.3 is rated a "stable" version at codeplex, so I do not understand why I would have to use the tool for 4.2.  


#53903 Netduino Plus 2 Firmware v4.2.2 (update 2)

Posted by rockybooth on 08 November 2013 - 04:36 PM in Netduino Plus 2 (and Netduino Plus 1)

Update- I was able to flash with the DFU file, and execute simple programs.  I still have not been able to set the MAC address with the same symptom that I posted in the previous message's screengrab.  

Any suggestions?


#53877 Netduino Plus 2 Firmware v4.2.2 (update 2)

Posted by rockybooth on 08 November 2013 - 01:04 AM in Netduino Plus 2 (and Netduino Plus 1)

I follwoed the instructions to erase the firmware, and then flash the DFU file, with verify, successfully (I thought), 

When I got to the step to set the MAC address I get the following:

Unable to erase configuration sector memory.  (see screengrab)

I saw another post from someone who had the same problem but flashed with the wrong file.  I verified that I used the correct file.


I attempted to program a simple app using visual studio but got the error "An error has occurred please check your hardware."


Can anyone suggest a next step?

Attached Thumbnails

  • Capture.PNG

#53872 Can't get past go

Posted by rockybooth on 07 November 2013 - 11:53 PM in General Discussion

No sure what you mean by filter driver.  This is a driver for a specific USB device that has in encrypted code that lock execution of the compiler to the computer with the device installed.  The driver is digitally signed, and I am using the current driver.  The driver was developed for Win7.  My takehome message is that the WinDgb application in the windows SDK is very handy!

#53868 Can't get past go

Posted by rockybooth on 07 November 2013 - 10:51 PM in General Discussion

Well, I got past GO.

I installed WinDgb and examined the crash memory dump.  It turns out that it pointed to a driver:

"Probably caused by : sparkey.sys ( sparkey+44f2 )"

Removing the device allowed me to again access 

This is used by a compiler for PIC devices (ProtonBasic) and is a software protection "dongle". If anyone is interested, I found the BSOD investigation instructions at http://www.networkwo...ash-268274.html

Now if I can just get my Netduiino Plus2 working again...


#53864 Trying to determine if I should reflash NP2

Posted by rockybooth on 07 November 2013 - 08:29 PM in Netduino Plus 2 (and Netduino Plus 1)


I am just getting started with the NP2, and after several successful "blink-the-LED" efforts I switched to try the PWM functions, and started getting compile warnings (overflow will not throw exception), I was unable to reprogram the device. 

I tried the deployment tool, and find that while I can ping the device and get back the following:

Pinging... IP Address:
No debugger!
Create TS.
 Loading start at 806a988, end 8085288
Assembly: mscorlib (
Assembly: Microsoft.SPOT.Native (
Assembly: Microsoft.SPOT.Hardware (
Assembly: Microsoft.SPOT.Net (
Assembly: System (
Assembly: Microsoft.SPOT.Hardware.SerialPort (
Assembly: Microsoft.SPOT.IO (
Assembly: System.IO (
Assembly: Microsoft.SPOT.Hardware.PWM (
Assembly: Microsoft.SPOT.Hardware.Usb (
Assembly: SecretLabs.NETMF.Diagnosti
After I get this, if I re-ping, there is no response.  Also, if I disconnect and reconnect (unplug/plug) I get the same response.  Please note it always fails to complete the line: "Assembly: SecretLabs.NETMF.Diagnosti" and I do not know if there should be more lines. 
I am not sure what I should do next.  Perhaps erase the device and reload?  If so, is there a procedure with locations of the necessary files specified?
Running Win8.0/32 on an old laptop.  The target framework is .NET Micro Framework 4.2. Using Visual Studio 2012 pro and VB.  

#53839 Can't get past go

Posted by rockybooth on 06 November 2013 - 12:53 AM in General Discussion

Hi Chris:

Thanks for the tips - I am quite enthused about this new (to me) platform.

After my problems on my main PC, I tried an old laptop that had Win8/32, and was able to load, build, deploy, and run on a NetDuino Plus 2!

Back at my main PC, I can compile, load, run a Net Micro Framework Console Application without problem.

I BSOD with if I select a Netduino Plus 2 Application.  If I change the Target framework to .NET  Micro Framework 4.2 in Project/Application tab, an then go to the References tab, I verify that .NET 4.2.xx files are selected.  I even close and re-open the project and again verify 4.2.

When I then go to the .NET Micro Framework tab, immediate BSOD, every time!

Any suggestions what to try next?


#53788 Can't get past go

Posted by rockybooth on 03 November 2013 - 12:45 AM in General Discussion

I just purchased a netduino plus 2, but can't get past go...

I have installed .NET Micro Framework 4.3 (RTM)
Visual studio is Premimum 2012, 11.0.60610.01 Update 3
Windows 8.1/64 (all updates applied)
Start visual studio, select from templates Netduino Plus 2 application, 
then go to My Project, and select .NET Micro Framework, the PC will immediately crash (blue screen) with a Bad_pool_header and proceed to reboot.
This happens if I select VB or C#.
This happens with both framework 4.2 and 4.3.
This happens with the board both connencted and disconnected
I have not entered any code, just picked a template.
No other programs are running, and this is completely reproducible.
The only thing slightly unusual about my setup is that the development tools are not on C: but another drive (O:). I have not problems developing in VB.NET.
Any suggestions are appreciated as I have no idea what to do next.
Thanks for your help

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.