Getting started with GHI RLP
The .NET Micro Framework allows .NET developers like myself to develop solutions that run on embedded devices even though I've had little to no experience with embedded devices in the past. Instead off having to learn everything from scratch again, I can simply rely on my knowledge of the .NET Framework and get started right away.
However, the introduction of the .NET Micro Framework does not mean the end of Assembler or even C code. Code running on the .NET Framework is managed code, which, compared to native code, is really really slow. Now before you punch me in the face, by "slow" I do not mean .NET applications do not perform well. If you're using a Windows application it doesn't really matter whether it takes 500ns or 500us to open a file, but when you're dealing with hardware solutions 500ns might make a world of difference. And it's at that point the .NET Micro Framework breakes down, as managed code is not realtime executed code. In 99% of all situations, managed code will work perfect fine and you won't need anything else... But when you do, when performance really matters, it doesn't mean you have to ditch the .NET Framework entirely... because GHI provides us with a way to combine managed and native code in a single appplication.
GHI's devices such as the ChipworkX and EMX provide a feature called Runtime Loadable Procedures (RLP):
RLP allows developers to load/execute their own compiled C/Assembly procedures at runtime. RLP supports loading ELF executables and, for advanced users, you can load binary images using GHIElectronics.NETMF.Hardware.LowLevel.AddressSpace class. If needed, the user can load multiple images in the reserved RLP memory region. Compiled C/Assembly procedures are executed natively and can perform much faster than managed application, up to 10000 times faster! This is very useful for calculation intensive applications. Also, RLP has extensions that can be used directly from Native code. You can use dynamic memory, install interrupts and much more.
Getting started with RLP can be a bit daunting, especially if you're used spending your days inside of Visual Studio. My goal here is to help you get started with RLP, setting up your system, writing and consuming your first RLP, etc..
This is all about getting you started, or detailed information about RLP, please visit the documentation page[1] for the RLP class.
The RLP code will be written in C but it cannot be compiled using just any C compiler. It has to be a C compiler for ARM cpu's.
GHI uses the freely available Yagarto toolchain for Windows, and that's what we'll do here.
First you'll have to download 'Yagarto Tools' and 'Yagarto GNU ARM toolchain' from the Yagarto website.
After both packages have been downloaded, start by installing the toolchain:
Make sure you select the 'Add YAGARTO to the PATH variable' option
The tools will not work when you install them to a path containing spaces, the installer however will still suggest you install it to '...\Program Files...', so make sure you change it before continuing:
Trackbacks
- FEZ XBee Sensor: Hat Trick | GigaMegaBlog | http://gigamegatech.com/2011/10/29/fez-xbee-sensor-hat-trick/
Discussion
Lorenzo Maiorfi
Maybe it would be useful for MAKE newbies to know that makefile requires TAB characters under each directive, or you'll get "* missing separator" issues.
Timothy
@Lorenzo, thnx, I did forget to mention that :)
Joost
Very useful thanks !
Gift Ideas
Nice introduction about GHI RLP here. Thanks.
Xykon
For those like me who found this in a search engine and the intro stops after downloading from the Yagarto website, I suggest you try this link instead: http://www.itcrowd.be/getting-started-with-ghi-rlp?revision=27
Other than that very nice tutorial, very helpful!
TimothyP
Hey,
I don't know what's up with that. Every now and then for some reason people get and older revision... I'll upgrade the funnelweb installation and update the blog more often when I get back to Europe