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.

Emilio x64's Content

There have been 39 items by Emilio x64 (Search limited from 07-May 23)


By content type

See this member's


Sort by                Order  

#52053 Timers not working right, more or less at the speed of light

Posted by Emilio x64 on 09 August 2013 - 03:34 PM in Visual Studio

Doesn't one of the arguments in the button event/interrupt give you the time an even occurred?

 

You are right about Timers running forever.  I found that out earlier this year and ended up writing a post about it.

 

Regards,

Mark

 

Perhaps it does in the emulator application but that information is AFAIK not available on the NETMF application because it doesn't receive a button event.




#52049 Timers not working right, more or less at the speed of light

Posted by Emilio x64 on 08 August 2013 - 11:01 PM in Visual Studio

In my NETMF application I make use of two types of Timers from System.Threading (is there a better one?).

 

One timer actually times the period of time a button is depressed, if it is less than 2 seconds X happens but if it is pressed for more than 2 seconds then Y happens. This is common in embedded devices.The timer is started when the NETMF application detects that the GPIO pin has gone low (active low) and it also detects when the button is released when the GPIO pin goes high. I am using I/O interrupts on both edges to detect the press/release.

 

The other timer is a loop processing timer which is used to periodically do the processing of signals and state transitions of my state machine. When a button is pressed for example a Pressed signal is put into the queue and at the next processing loop the signal is picked up from the queue and processed according to the state.

 

Now, I also found out that in NETMF Timers aren't what we are used to in the standard framework, namely that you can't start/stop them the usual way, they start as soon as they are created (unless a delay is specified) and they keep on running forever. The only way to stop it is by Disposing the timer instance and setting it to null so that it is garbage collected. I use 2000 (milliseconds) for the button press/release and originally used 200 ms for the loop processing.

 

Now, I am testing my "virtual device" and see that even if I click quickly on the button (much less than 2 seconds) the timeout signal is raised as if I had pressed the button for more than 2 seconds!!!

 

Am I missing something here? is there perhaps some NETMF setting that controls the time base of the timers? it appears to me that they are running at the speed of light and therefore what is supposed to be 2 seconds turns out to be more like 100 milliseconds!




#52013 Netduino Board Support Package?

Posted by Emilio x64 on 07 August 2013 - 12:33 AM in Netduino Plus 2 (and Netduino Plus 1)

In addition to the NETMF 4.3 SDK I also installed the Netduino SDK. Isn't there some "using netduino;" kind of using directive that can/should be used to have access to Netduino-specific things?

 

In my custom emulator how do I set the available RAM/ROM and perhaps speed of the Netduino's core processor? I ask because there must be a way (I think) that the development environment warns me if my code or data segments are too large for the hardware I am targetting.




#51989 Netduino Board Support Package?

Posted by Emilio x64 on 06 August 2013 - 04:22 PM in Netduino Plus 2 (and Netduino Plus 1)

I am planning to use the Netduino Plus 2 (don't know if it is an overkill yet, have to see my memory requirements). I was wondering if there is some Netduino BSP (Board Support Package) that contains the definitions that map Netduino-specific stuff to NETMF ? 

 

For example, I read that in an SDK I should map my own pin definitions (board specific) to the NETMF Cpu.Pin.GPIO_* enumeration. Is there such a thing for Netduino?

 

Also, how do I go about specifying GPIO 16 ??? if that is possible.




#51709 Creating Device Emulator project with .NET MF 4.3 SDK throws exception

Posted by Emilio x64 on 26 July 2013 - 03:23 PM in Beta Firmware and Drivers

OK the target is okay. What I have consistently noted is that the emulator tends to crash many times on startup with the same error, that it found the emulator but failed to (re)connect to the emulator.

 

I observe that my custom emulator UI pops up and the Output Window shows "Emulator found..." and many times it crashes a few seconds after that. If I try several times (without any change) then at some point it does connect to the emulator and I see a bunch of messages on the Output Window indicating the progress of loading assemblies and data from the PE file (memory usage, etc.).

 

Even in the cases it crashes I see that before it crashes I can FULLY interact with the WinForms custom emulator UI I created. Operating it does not cause the exception. Why the uF Emulator backend fails to (re)connect on initial loading puzzles me. Sometimes doing a "Clean Project" followed by "Rebuild Solution" does it, but other times it doesn't. Sometimes I have to try like 5-6 times to get it to run.

 

BTW... is there a flag or something in my emulator UI (WinForms) that I can use to wait for the Microsoft Emulator to be READY? I see a message on the Output Window that says "Hello World!" and that's how I know it is ready but I want to disable the UI until that phase is reached.




#51692 Common library target choice

Posted by Emilio x64 on 25 July 2013 - 10:44 PM in General Discussion

Just found out it is not possible. If you reference a uF common library from the emulator you get this error:

Warning	1	The project 'CommonLibrary' cannot be referenced. The referenced project is targeted to a different framework family (.NETMicroFramework)	MyDeviceEmulator

so the problem remains how to share certain data types (interfaces, classes, structs) that are common to both the emulator and the uF application taking into consideration that the common library should behave the same (some methods such as ToString are implemented differently in the frameworks) and compile under both frameworks. Pity...




#51670 Production Ideas...

Posted by Emilio x64 on 24 July 2013 - 07:59 PM in General Discussion

OK, I am new to Netduino, let's say I spent quite some time developing a project using the .NET uF based on the Netduino hardware and I am ready to create boards... Obviously I wouldn't want to just have a true netduinon inside.

 

1.  How do I go about creating my own board that would integrate the Netduino (minus a few things I don't need from the board) and my own "add-on" module all in one board?

 

2. Who can produce those boards in small quantities?

 

3. Would I need to re-port the uF or something? 

 

4. How do I get to permanently download my custom firmware (the app developed in vs.2013) into the board?

 

I don't know if somebody has already gone through that process or what. I would like to do it with Netduino but if that is not possible then I would opt for a PIC based design that is perhaps easier to produce. Anyway, just need some feedback for my "custom appliance"




#51668 Common library target choice

Posted by Emilio x64 on 24 July 2013 - 07:53 PM in General Discussion

Since I don't have a device yet and it is good for early prototyping, I am using a custom emulator for my project for the time being. As we all know (I recently only...) the Device Emulator project is targeted to the standard .NET framework (v4.5).

 

My actual application is a .NET Microframework v4.3 project with ".NET Microframework 4.3" as the target. So far so good...

 

Now, since for the configuration of both applications I need things like pin numbers and perhaps a few interface definitions, rather than duplicating them in both the uF console app and the .NET device emulator project, I thought a common library project would be more suitable to share those things I mentioned.

 

My question is... such "common library" project to be used with both the Device Emulator project AND the uF Console Application should be targetted at the uF (the lowest denominator) or is this approach just not possible?




#51665 How you debug these things?

Posted by Emilio x64 on 24 July 2013 - 05:47 PM in Netduino Plus 2 (and Netduino Plus 1)

I found the following messages on the "Microframework Device Deployment" category of the Output Window in VS.2013:

Looking for a device on transport 'Emulator'Launching emulator with command line: '"N:CodeMicroFrameworkDisplayMyDeviceEmulatorbinDebugMyDeviceEmulator.exe" "/waitfordebugger" "/load:C:Program Files (x86)Microsoft .NET Micro Frameworkv4.3AssembliesleMicrosoft.SPOT.Native.pe" "/load:C:Program Files (x86)Microsoft .NET Micro Frameworkv4.3Assemblieslemscorlib.pe" "/load:C:Program Files (x86)Microsoft .NET Micro Frameworkv4.3AssembliesleMicrosoft.SPOT.Graphics.pe" "/load:C:Program Files (x86)Microsoft .NET Micro Frameworkv4.3AssembliesleMicrosoft.SPOT.Hardware.pe" "/load:N:CodeMicroFrameworkDisplayMyDeviceEmulatorbinDebugleMyDeviceEmulator.pe"'Restarting interpreter...Attaching to device...Deployment error: failed to (re)connect debugger engine to debugging target.The debugging target and the debugger engine failed to initialize because of unspecified device errors.The debugger engine thread has terminated unexpectedly with error 'Debugger engine could not attach to debugging target.'.

But that "unknown device errors" isn't really much of a help, isn't it? shouldn't it give a stack trace or something to work with?




#51664 How you debug these things?

Posted by Emilio x64 on 24 July 2013 - 05:40 PM in Netduino Plus 2 (and Netduino Plus 1)

I am planning a design based on the Netduino Plus 2 (tentative) and I created a custom emulator (nothing fancy really) project in VS.2013 Ultimate on Windows 7 Ultimate x64. As pointed out in a previous question this is targetted to a desktop framework (.NET 4.5) and it seems to work well.

 

I also created the Microframework application (SDK 4.3). Basically the application sends commands to the device (as emulated) via the SPI bus, It sends 16 bit commands to control a MAXIM 7219 chip.

 

I seem to have gotten the communication between emulator an app right from the examples. So, I can click on a button on the emulator which causes an interrupt to be processed on the app (Emulator to App comms). Also the application sends commands via SPI to the emulator (no actual device yet). My emulator receives the SPI commands and acts accordingly to update the custom UI. I also have a form that shows the registers of the device which has SPI (slave) and see that the commands are received.

 

The problem is... If I add initialization code in the app that sends initialization commands via SPI then the whole thing crashes. If I omit the initialization code (sent by SPI) and simply assume everything is initialized then I can interact with the emulator.

 

So to my question, how can one debug these things? when I enabled the initialization code sent to my device the emulator UI appears, I see in the Output Windows "found emulator!..."  and then I briefly see a bunch of messages, the thing crashes and the whole output window is ERASED leaving me with absolutely no clue as to what went wrong. 

 

I put a breakpoint on the call to the initialization code which is invoked in Program.cs then it doesn't even break, it craps out erases all output and no clue.... If I remove that call to the initialization then 99% of the times it starts and works. But usually the 1st time it crashes (same modus operandi of erasing all useable output) and the next time it runs fine.

 

How can I debug this???? I am not even using an actual hardware device. Why are the breakpoints ignored in DEbug mode?




#51586 Creating Device Emulator project with .NET MF 4.3 SDK throws exception

Posted by Emilio x64 on 19 July 2013 - 09:58 PM in Beta Firmware and Drivers

Well as I mention it is spurious, it may fail several times in a row and then the next one it doesn't crash. I have been developing .NET web & desktop apps for years under a restricted account and haven't encountered any real issues.

 

I tried putting a try/catch on the Main of the Emulator project but even with that it simply crashes back to VS and leaves absolutely no information (log, output) about what went wrong. Even the output window is empty.

 

BTW the Device Emulator project wouldn't load today anymore (didn't have that yesterday because I never existed VS). I had to change the target framework of the Emulator (no the MF application) to .NET 4.5. The target framework drop down would only show standard (not micro) framework versions. The MF application project however DOES show only the Microframework versions in that Target Framework dropdown. So is that okay? should I target my emulator at any of the std. frameworks (4.0, 4.5) ?

 

By trying multiple times and attempting to being extremely fast to do Select All & Copy in the Output window when the crash ocurrs I managed to get this. When it happens this information is left only for a second or two in the output window before it is cleared and replaced by "Found debugger!". I think that needs some attention.

Looking for a device on transport 'Emulator'Launching emulator with command line: '"N:CodeMicroFrameworkMyAppMyDeviceEmulatorbinDebugMyDeviceEmulator.exe" "/waitfordebugger" "/load:C:Program Files (x86)Microsoft .NET Micro Frameworkv4.3AssembliesleMicrosoft.SPOT.Native.pe" "/load:C:Program Files (x86)Microsoft .NET Micro Frameworkv4.3Assemblieslemscorlib.pe" "/load:C:Program Files (x86)Microsoft .NET Micro Frameworkv4.3AssembliesleMicrosoft.SPOT.Graphics.pe" "/load:C:Program Files (x86)Microsoft .NET Micro Frameworkv4.3AssembliesleMicrosoft.SPOT.Hardware.pe" "/load:N:CodeMicroFrameworkMyAppMyDeviceEmulatorbinDebugleMyApp.pe"'Restarting interpreter...Attaching to device...Deployment error: failed to (re)connect debugger engine to debugging target.The debugging target and the debugger engine failed to initialize because of unspecified device errors.The debugger engine thread has terminated unexpectedly with error 'Debugger engine could not attach to debugging target.'.



#51575 Creating Device Emulator project with .NET MF 4.3 SDK throws exception

Posted by Emilio x64 on 19 July 2013 - 03:28 PM in Beta Firmware and Drivers

I am using Visual Studio 2012 Ultimate on a Windows 7 Ultimate x64 OS. I am new to Netduino. I downloaded and installed the .NET MF 4.3 as well as the Netduino 4.3 SDK (couldn't find the link to the x64 version).

 

I opened VS 2012 and created a Device Emulator project but every time I compiled it it gave a warning about missing references to the 4.3 libraries or so, but it would compile. In the project properlies I did see that the Target Framework was EMPTY but clicking on it would list the standard .NET frameworks but NOT the 4.3 Microframework, why?

 

I also created a sample MF console application. I was able to build the solution and run it. On ocassions and without any reason or interaction the whole thing would crash with an exception on the emulator but it wouldn't let me see well (the exception data disappears after the emulator window disappears, it disappears by itself after a little while). And then just the same without change it would work well and I am not doing anything fancy.

 

However, the problem now being that I used it until past midnight multiple times. This morning I started VS.2012 and opened my MF solution and now (no changes) the Device Emulator project would not load. It said I didn't have the Targeting Pack. It simply doesn't load anymore.

 

The same happens with some sample projects I downloaded, they don't load into VS.2012

 

There is a problem with the installer too. Like all security conscious people, I use my Administrator account for just that and have been developing under a restricted user account for years. I noticed that I could not find the samples on my restricted account. As it turned out, the installer placed the Samples files in the Documents folder of the Administrator user (where the install was made for ALL users). I would suggest those files be put in the Public user Documents folder or let the user where to install them.




#51554 The right Netduino board and my application

Posted by Emilio x64 on 19 July 2013 - 12:09 AM in General Discussion

I am new to NetDuino... Since it is obvious the RAM and ROM on an embedded system such as the netduino is limited, I believe some 384KB maximum on the Plus 2, I would like to know how can I determine what are the actual memory requirements of my application.

 

I have not bought the netduino board yet because I don't want to buy one and then find out it doesn't have enough  memory to run my application. I don't know how effective the .Net MF is at squeezing stuff up. Back in my embedded days I developed (with my team) a multihandset cordless phone with only 512 bytes of RAM using C but for that I had to really know my compiler's output very well to adjust the coding accordingly.

 

Currently I have my eyes set on the Netduino Plus 2 but I will first have to see how big my application is.




#51552 Missing reference assemblies?

Posted by Emilio x64 on 18 July 2013 - 11:59 PM in General Discussion

Although I am a veteran .NET developer with .NET 4.x using Visual Studio Ultimate 2012 I am a newbie to the .NET Micro Framework. I am running Windows 7 Ultimate x64.

 

A few days ago I successfully installed the .NET Microframework v4.3 as well as the corresponding Netduino SDK v4.3. When I start Visual Studio I can see the new project templates.

 

As a starter I created a Device Emulator project but when I try to compile it I get this error:

 

Warning 1 The reference assemblies for framework ".NETFramework,Version=v4.3" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. MyDeviceEmulator

So how comes? I have installed them without error. I checked the device emulator project properties and the Target Framework is empty. When I click on it I only see the standard .NET frameworks (2.0 3.0 4.0 4.5) but NOT the 4.3 Micro Framework.

 

I didn't see the NetDuino 4.3 x64 version so I installed the standard x86 version, would that be the problem? I wouldn't think so.

 
 




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.