Tags: EMX, GHIElectronics
The first thing that you have to do to get started using EMX from GHIElectronics, www.ghielectronics.com, is to go to http://www.microsoft.com/netmf/default.mspx and download the Micro Framework SDK and install it. Then go over to GHI Electronics, http://www.ghielectronics.com/product/129, and download and install the GHI SDK for NETMF. While you are there be sure to download their free ebook, “Beginners guide to NETMF”. You will of course need Visual Studio. As of this time VS 2008 is supported not VS 2010.
The first thing that you will probably want to do is to update the firmware on the development board. This is accomplished in two steps and involves placing the EMX board into two different operating modes.
Updating the bootloader
Plug the development board into an available USB port on your computer using the supplied USB cable. If the computer asks to install any device drivers, ignore that for now. To access the bootloader update mode, you would hold down the Up, Down and Select buttons on the development board as you power up the board or push the reset button. So patience is called for here. Unless you have teeny tiny fingers, it’s very difficult to hold all three buttons down at the same time. You know you have it when the screen does not display the boot up messages and is washed out with white.
If this is the first time that you have accessed this mode, the Hardware wizard should start up and want to install device drivers. The drivers you want to install at this time are located at C:\Program Files\GHI Electronics\GHI NETMF v4.0 SDK\USB Drivers\GHI_Bootloader_Interface if you used the default location when you installed the GHI SDK. This driver allows you to connect to the board through the USB port using a terminal program. Once the driver is installed you are ready to go.
You need to use a terminal program to upload the new program to the processor. GHI reccommends Terra Term to use to upload the bootloader, you can download the program from their site. Personally, I have not had any success using Terra Term. I had heard that they have had problems with their 1K XModem protocol and I could never get it to work properly. I have used HyperTerminal that comes with Windows successfully. Start up your terminal program and connect to the EMX board. Hopefully you will be able to figure out which comport you need to use. Use 115200 8-N-1 and no flow control as your parameters.
Once you have connected, use the ‘E’ command to erase the memory. Note that you have to use upper case characters. Then press ‘Y’ to confirm the erase command. Wait until the board memory has been erased. While the erase is going on * characters are printed to the screen. They that stops you are ready to upload the new bootloader.
Press ‘X’ to begin the upload procedure. Again, remember upper case! The terminal program will start printing C characters to the screen indicating that the board is waiting for the upload. If you are using HyperTerminal, click the Transfer menu and Send File. Browse to the bootloader program to upload. In this case you want to go to C:\Program Files\GHI Electronics\GHI NETMF v4.0 SDK\EMX\Firmware\TinyBooter and select the TinyBooter.GHI file. Be sure to select XModem 1K to use for the transfer. The transfer only takes a few seconds. After the transfer is complete, the board will reboot itself in preparation for the next step.
EMX embedded system May 1, 2010Posted by wesaday in Programming, Technology.
Tags: EMX, GHIElectronics
Found this really cool item from GHIElectonics, www.ghielectronics.com. They have a variety of items, I got the EMX. It’s a development board that utilizes the Microsoft .NET Micro Framework. Basically it’s .NET embedded on a chip. And since I am more and more working with hardware and embedded systems, I broke open the old piggy bank and bought one. The board comes with a bunch of connectors that are already wired up so you can pretty much get going right away. It has a ton of features that could be used for a bunch of different applications. The good news is that you can program and debug the processor using Visual Studio. The bad news is that you have to code everything by hand which isn’t really bad unless you are doing a user interface using the touch screen as the Micro Framework does not have an overabundance of support for user interface components. What support there is does support WPF elements. XAML is not supported though.
WPF application memory leak January 18, 2010Posted by wesaday in Programming, Technology.
Tags: CMilChannel HwndSource, WPF
1 comment so far
I have had an issue with a memory leak in one of my WPF (v3.5 SP1) based applications for quite some time. I has been really hard to track down because the appliation runs for 5 days apparently just fine then crashed with an “Out Of Memory” exception. So I have been trying to use profilers and just about any other tool that I could find to try and track down what would be allocating memory on a continual basis and not letting it go. Imagine my surprise when running profilers that the “before” and “after” snapshots are virtually identical. Very frustrating.
I did find this blog entry here, http://blogs.msdn.com/jgoldb/archive/2008/02/04/finding-memory-leaks-in-wpf-based-applications.aspx, that disuss many memory leaks and fixes for them but nothing there exactly described my situation, or the meaning was not clear. The demostration application for the leaks has the leak in there but I am not doing what he did (that I know of) and he does not demonstrate how to work around the problem. Then I ran across this question on StackOverflow, http://stackoverflow.com/questions/801589/track-down-memory-leak-in-wpf, which described exactly what I was seeing. Which also pointed back to the first blog. So, after not thinking about it over the weekend and coming in fresh on Monday I looked again. I found this entry on StackOverflow, http://stackoverflow.com/questions/1705849/wpf-memory-leak-on-xp-cmilchannel-hwnd, which points out a very simple solution.
Apparently somewhere along the line, the application is getting confused as to who is doing the rendering. So messages are being allocated and sent, but no one is consuming them so they pile up until you run out of memory. The work around is to create a new HwndSource in the application constructor and that reregisters the window class with Windows and does not cause the confusion.
public partial class App : Application
new HwndSource(new HwndSourceParameters());
This appeared to work for me and hopefully will help someone else.
Wow March 7, 2008Posted by wesaday in Programming, Technology.
add a comment
Been a couple of days. Was playing around at work today. The head honcho thinks that UIs that are “flashy and neato” are the way to go. He’s kind of stubborn that way. So, I was playing around trying to figure out what we could to do to make this happen without exerting too much effort before it falls flat. One of the problems is that the boss man thinks that marketing people can able to design user interfaces. The other hurdle is that he thinks that all there is to designing a user interface is dragging and dropping pictures on the screen and they magically become buttons or grids or whatever you are thinking they are. So with these thing in mind, I created a kind of test application in WPF to check some of the stuff out. I was pretty much able to get a fairly decent program going with custom shaped buttons, styles, resource and animations without too much trouble. So I am thinking that using a combination of VS2008 and Expression Blend, that WPF would get us closer to the goal.
To do some learning and get used to some of this stuff, I will be writing a program that I need anyway and test out some of the capabilities of WPF at the same time. I have been needing a program that I can use to build installation programs. So this is my idea. I will create a program that can be configured to read a configuration file that contains project information, and translate that information to an XML file that will feed into WIX that will create an msi installation file. All of the installations will look and work exactly the same and we will have a single point of building these things. So that is it. Will be starting to work on that real soon. I actually have a working prototype program using Winforms but diving into WPF should be really easy to convert that code over.
Changes January 18, 2008Posted by wesaday in Programming, Technology.
add a comment
Oh boy changes. Have decided on another project (surprise, surprise). I decided that the original project was too intense for a “learning” project, so decided on something else that has a higher probability of getting done. Hopefully, I can post more details soon.
Another day, another quandry January 12, 2008Posted by wesaday in Programming, Technology.
add a comment
The application that I mean to write is admittedly, very ambitious. Especially when you only can do something in the program piecemeal. An hour or two in the evenings can’t move things along very fast. Even on the best of days when I want to do more programming after work.
The requirements cover a broadrange of techniques.
I would like to have the ability to define the GUI outside of the IDE. Along the lines of XAML or Marc Clifton’s MyXAML initiative http://www.myxaml.com.
A scripting environment would be a plus also
A plug-in architecture would be beneficial too.
Visual Studio 2008 has built in unit testing, so that will be the target IDE
The main problem with my plan is that MyXAML is open source and there is a possibility that my application will turn into a commercial product, if and when it’s ever done.
Hmmmm January 10, 2008Posted by wesaday in Programming, Technology.
add a comment
Well… first blog posting. Maybe I can do this as this weblog is easy to get to and post.
I think that I will use this forum to describe my trials and tribulations diving into the world of C# programming. Coming from a Visual C++ world, the C# language is not too much trouble to pick up. The major hurdle here is learning the .NET framework. The framework is way too big to learn in two or three weeks or months even. As with any application, careful and thoughtful planning will help things along.
I have chosen to emulate an application that I have already written and make it have a more up to date interface and a bit more more friendly to work with. I am thinking the adding an add-in framework and scripting will help with the extensibility and the maintenance. I have decided to use the QIOS Devsuite, http://www/qiosdevsuite.com, components coupled with the XtraEditors components from DevExpress, http://www.devexpress.com.
I am currently waffling between diving right in and making a bunch of mistakes and doing the “right” thing and doing a bunch of design up front with class diagrams, sequence diagrams and all that painful stuff.