Main Site Documentation

FEZ Hydra and RLPLite


#1

Anyone up to a callange? I know this won’t be easy and I plan on doing it myself but if you beat me to it then you get a gift from me personally :slight_smile:

Hydra now has RLPLite, which is documented here http://www.ghielectronics.com/downloads/NETMF/OSH%20Library%20Documentation/Index.html
and a tutorial here http://wiki.tinyclr.com/index.php?title=RLPLite_Demo

About 4 years ago, I compiled libmpeg2 into an RLP and ran it on ChipworkX. I didn’t know what to expect as far as speed but I was more than excited when playback was too fast and I had to add a delay! Remember this is all done in software so whoever write the libmpeg2 lib deserves a beer.
ChipworkX and Hydra are both ARM9 200Mhz so FEZ Hydra will run videos just fine.

Here is the very old project (unusable) http://wiki.tinyclr.com/index.php?title=RLP_Video_Playback
Too bad we lost the video when we moved our youtube account last year.

Are you the one to make this happen? Will you beat me to it?

Note: New OSH SDK will be out tomorrow morning and I will delete this note by then. Do not ask where the SDK is :slight_smile: It is Steven’s birthday so he didn’t have time to put the SDK up for everyone :wink:
Edit: it is up now!


#2

I’m not yet ready to take on such a worthy challenge, but to Steven, I’d like to offer:

Hippo Birdie Two Ewe
Hippo Birdie Two Ewe
Hippo Birdie Deer Steven
Hippo Birdie Two Ewe


#3

Happy Birthday to Steven! ;D


#4

Thanks guys!

OSH SDK is now up!


#5

Great news! Thanks, Steven. Happy belated b-day!

I’ve got to win the piezo contest so I can get a display for the Hydra before I can do anything to help with anything GUI related… :wink:


#6

I’m trying to write my first RLPLite function and I feel like someone has dropped me off in China and told me to start speaking Chinese… :frowning: All of the documentation besides the one simple example is concerning the .NET side of using an RLPLite function.

Where is the documentation located for actually writing RLPLite functions? For example, how do I set a pin’s state? I see in some of the RLP examples that there is an RLP.h file. Is it also valid for RLPLite? I see some magic number references in there that I don’t think apply to RLPLite.

Does RLPLite have it’s own native © functions or do I need to be reading the ARM documentation (for Hydra)? If that’s the case does it mean that an RLPLite function written for Hydra will not necessarily also work for Cerberus?


#7

I don’t have a Hydra, and so I haven’t tried RLPLite, but it looks to me like the major differences between RLP and RLPLite are, one, RLPLite doesn’t support elf binaries, so you need to set up the procedures manually, and two, you don’t get RLPext, so there is no RLPext->ReadPin or RLPext->WritePin. That means you’re stuck doing it yourself, it seems.

This is conjecture on my part, I could be wrong.


#8

What does that mean exactly? Keep in mind that I’ve only ever programmed micros in NETMF & Arduino.


#9

That means that there are no higher level wrappers for doing it. You have to manipulate mcu registers directly.
So in terms of toggling a pin. You will need to know the address of the register that is responsible for that pin and the the right bits in that register for that particular pin. All that can be found in the MCU documentation.


#10

I found the datasheet for the MCU here:
http://www.atmel.com/Images/doc6289.pdf

I see some memory map info in there but frankly I’m clueless about what to do with it. Is there a good “getting started” guide or a sample program somewhere that I can start with?


#11

atmel site should have a lot of good examples.


#12

Everyone with experience in RLP feel free to jump in… Maybe I don’t know what I’m looking for but I don’t see any sort of SDK type info on the Atmel site. Please drop in your links & suggestions for someone just writing their first RLP function. If you know off the cuff how to set a digital I/O pin from Hydra RLPLite that would be appreciated also.


#13

Writing code in RLP to access processor = writing native code on the processor = must have understanding if processor registeres and must be comfortable in reading datasheets.

Now, of your RLP is processor independent, like writing an algorithm method then you do not need that.

I suggest you try to control an IO using Register class first so you understand the underlying processor then dig into RLP.


#14

Thanks, Gus. Playing with the Register class will be an easier way to discover if I’m figuring out the datasheet. The question still exists though on where someone should go to get started. Maybe I need to take a step back…

I had hoped to accomplish two things this weekend. First, I wanted to figure out how to and write my first RLPLite function. That turned into a third task… Create thread/wiki post that we could refer people to that are trying to get started in RLP. Considering the number of hobbyist & software devs here compared to EEs, I think something more is needed than what is currently available on this site regarding the topic. I want to provide that quick start tutorial here if I can just get started… We are almost daily replying to thread posts with “sure it can be done in RLP” or “it would be faster in RLP”. If someone not experienced in RLP wants to get started then it would be great to have this post to send them to.

Second thing I wanted to accomplish…actually the primary thing and what got this all started is I want to contribute OutputCompare() for Hydra. Am I over-complicating this? Can it be done w/o RLP? I saw Elmue’s Code post…

http://code.tinyclr.com/project/453/signalgenerator-for-1-8-digital-outputs/

and thought it would be simple enough to convert that to a single pin input function that acts identical to the current OutputCompare() but I quickly spotted differences in RLP & RLPLite that I didn’t know how to handle and here we are.


#15

I think I’ll give a try to mpeg2 decoding. The problem is that I have no hydra so if someone would test the code and give me feedback it would be great.

Later Edit: I can’t find any download link on your initial ChipworkX project.


#16

I would start by making a blocking version, which means it can be done very easily. You are still thinking NETMF and “outputPort” object. You need to forget all this when native programming, Yes the big RLP has extensions to help put but RLPLite doesn’t. So before you even look into RLP, you need to learn how to control the processor registers. As I suggested, you need to blink an LED using Register class. Register class works like a pointer in C++.

Register ABCD = new Register(memory_address);
ABCD.Write(123);

This is not an easy one unless you are an expert developer. The good news is I had finished this 2 weeks ago. I just need to clean it up and post it for everyone to enjoy :slight_smile:


#17

I guess I’m no expert but there’s only one way to become better: try harder things.

I don’t think that this is that hard. Just need to do some memory manager (for malloc, realloc and free) and a display image function to write each frame directly to the video memory + some refactoring on the existing functions. Everything else should be just fine.


#18

Having recently gone through this exact stuff for the STM32F4-Discovery board, it really makes you appreciate the full-fat RLP.

That being said, it’s certainly possible. As Gus suggests, I’d do it with Register first, if only so you can easily debug it and understand what’s going on.

At a high level, it works like this: everything in the MCU is laid out in memory. You turn things on/off, enable/disable things, and configure things by storing special values in special places in memory. This is what the Register class allows you to do, store and read these special memory locations.

You’ll have to read (carefully!) the processor’s datasheet and reference manual to put all the pieces of the puzzle together, because every processor is different in how it works.


#19

I’m definitely going to start with Register class as I’m figuring out the address structure. But once I get that figure out what would be the equivalent RLPLite function for accomplishing…

Register ABCD = new Register(memory_address);
ABCD.Write(123);

or am I thinking too high level here. Is it really something as simple as creating a pointer to memory_address and then setting the value there to 1 or 0 to set pin state?

I took a Computer Architecture course in college where we built an RSC (Really Simple Computer) and programmed it in assembly. This is all very familiar. I’m just struggling with how to do it in C. I’m making some progress though… The biggest problem was my assumption that RLP had an SDK of it’s own and that obviously was a bad assumption.


#20

Like I said, these work like pointers.

int32 * ABCD = memory_addess;
*ABCD =123;