User avatar
VascoFerraz
Posts: 83
Joined: Thu Aug 30, 2012 11:54 am

My first attempt to understand this Raspberry Pi

Thu Aug 30, 2012 1:13 pm

Hello from Portugal!

First of all let me thank you for this awesome project.

I already ordered one piece of this amazing hardware, however, I have a few questions about it.

I know that this is a microcontroller development board (like Arduino)... but one million times better. It can run a complex OS like Linux or just flash an LED.

If you want simply to flash an LED, you don't need to boot Linux. You could just write your code, compile it, send it to the uC and attach an LED to the corresponding GPIO port.

So, my questions are:

1) Which Integrated Development Environment (IDE) can you use to write code, compile it and sent it to the uC?

2) Should you use a software specific from ARM for the above procedure?

3) Do they (ARM) have an IDE for their uC's?

4) Can I make my own hardware to program the uC?

5) Is there any ICSP port on the Raspberry Pi? I think I saw an image from the 26 pin terminal (GPIO) stating that you have access to MISO, MOSI, CLK and RST. So, you can flash it via those terminals?!

Regards.

Vasco
Vasco Ferraz

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26659
Joined: Sat Jul 30, 2011 7:41 pm

Re: My first attempt to understand this Raspberry Pi

Thu Aug 30, 2012 1:17 pm

I'm afraid your first assumption is incorrect. It isn't a microcontroller like an Arduino. Its a fully fledged CPU. Imagine a desktop PC motherboard but using an Arm CPU instead of X86 (and a bit slower!)

So the rest of your questions, unfortunately, are mostly not relevent.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

adlambert

Re: My first attempt to understand this Raspberry Pi

Thu Aug 30, 2012 1:52 pm

In the olden days when the world was seen in black and white and there were only 3 TV channels, we used to take 8 bit CPUs and lash them onto stripboard with a 2732 EPPROM and a 6116 RAM chip. We could hardwire a couple of TTL chips like 74LS374 8 bit latches onto a fixed memory address. The output from the 374s would be wired to 7 segment LEDs.

Then I would individually type hex codes into the EPROM programmer, a little hand assembled sequence where I would set a stack pointer to some point in the 6116, and then write a number into the latches to light the 7 segment displays up. Just a couple of dozen codes or so. The EPROM would then be transferred to the ZIF socket and power applied. So exciting for us kids to see the right number on the LEDs.

If I could program Raspberry Pi the same way, with the SD card replacing the EPROM then I would be very happy.

Alas.....

User avatar
VascoFerraz
Posts: 83
Joined: Thu Aug 30, 2012 11:54 am

Re: My first attempt to understand this Raspberry Pi

Thu Aug 30, 2012 1:54 pm

So, are you saying that I need to boot 500MB of Linux to access the GPIO port to make an LED flash?

To conclude, I must boot a complex OS and inside that OS I can manipulate GPIO ports, UART, I²C bus, SPI...

Thanks :)
Vasco Ferraz

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13092
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: My first attempt to understand this Raspberry Pi

Thu Aug 30, 2012 1:55 pm

The PI isn't a "super arduino", but it can be programmed "bare metal", look in the bare metal forum for more info.
http://www.raspberrypi.org/phpBB3/viewforum.php?f=72

User avatar
VascoFerraz
Posts: 83
Joined: Thu Aug 30, 2012 11:54 am

Re: My first attempt to understand this Raspberry Pi

Thu Aug 30, 2012 1:57 pm

adlambert wrote:In the olden days when the world was seen in black and white and there were only 3 TV channels, we used to take 8 bit CPUs and lash them onto stripboard with a 2732 EPPROM and a 6116 RAM chip. We could hardwire a couple of TTL chips like 74LS374 8 bit latches onto a fixed memory address. The output from the 374s would be wired to 7 segment LEDs.

Then I would individually type hex codes into the EPROM programmer, a little hand assembled sequence where I would set a stack pointer to some point in the 6116, and then write a number into the latches to light the 7 segment displays up. Just a couple of dozen codes or so. The EPROM would then be transferred to the ZIF socket and power applied. So exciting for us kids to see the right number on the LEDs.

If I could program Raspberry Pi the same way, with the SD card replacing the EPROM then I would be very happy.

Alas.....
That was exactly what I was expecting from RaspPi... But as I see, it's not working like I was thinking it might
Vasco Ferraz

User avatar
VascoFerraz
Posts: 83
Joined: Thu Aug 30, 2012 11:54 am

Re: My first attempt to understand this Raspberry Pi

Thu Aug 30, 2012 1:59 pm

mahjongg wrote:The PI isn't a "super arduino", but it can be programmed "bare metal", look in the bare metal forum for more info.
http://www.raspberrypi.org/phpBB3/viewforum.php?f=72
So... who is right? Can I write a few dozens of Assembly lines, compile those, send it to the SD card to make an LED flash?

Or do I need to boot a 500MB OS to make an LED flash?

Thanks :)


EDIT:
After a few readings I think we can :) ... that is, we can write our code, compile it and put in the SD card. Then boot our RaspPi with an LED flashing code.
Vasco Ferraz

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: My first attempt to understand this Raspberry Pi

Thu Aug 30, 2012 2:07 pm

Both.
ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13092
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: My first attempt to understand this Raspberry Pi

Thu Aug 30, 2012 2:07 pm

KenshinPT wrote:
mahjongg wrote:The PI isn't a "super arduino", but it can be programmed "bare metal", look in the bare metal forum for more info.
http://www.raspberrypi.org/phpBB3/viewforum.php?f=72
So... who is right? Can I write a few dozens of Assembly lines, compile those, send it to the SD card to make an LED flash?

Or do I need to boot a 500MB OS to make an LED flash?

Thanks :)
Yes, if you are not using a full desktop OS in theory you can set things up so that you can execute just a few lines of your own assembler code, but you still need something that the PI can boot in place of the normal OS.

The PI will still start its full set of GPU software, and in fact its the GPU that boots the system, and loads its own firmware, then loads and executes its "OS".

What you need is probably a "bare metal framework" that can be loaded instead of a full OS.

Normally this is not how the PI is supposed to be used though. Wat you call the IDE normally runs on the PI itself, instead of a separate desktop.

User avatar
VascoFerraz
Posts: 83
Joined: Thu Aug 30, 2012 11:54 am

Re: My first attempt to understand this Raspberry Pi

Thu Aug 30, 2012 2:09 pm

mahjongg wrote:
KenshinPT wrote:
mahjongg wrote:The PI isn't a "super arduino", but it can be programmed "bare metal", look in the bare metal forum for more info.
http://www.raspberrypi.org/phpBB3/viewforum.php?f=72
So... who is right? Can I write a few dozens of Assembly lines, compile those, send it to the SD card to make an LED flash?

Or do I need to boot a 500MB OS to make an LED flash?

Thanks :)
Yes, if you are not using a full desktop OS in theory you can set things up so that you can execute just a few lines of your own assembler code, but you still need something that the PI can boot in place of the normal OS.

The PI will still start its full set of GPU software, and in fact its the GPU that boots the system, and loads its own firmware, then loads and executes its "OS".

What you need is probably a "bare metal framework" that can be loaded instead of a full OS.

Normally this is not how the PI is supposed to be used though. Wat you call the IDE normally runs on the PI itself, instead of a separate desktop.
I am happy again :) Thanks

And by the way: I call IDE to a software like MPLAB or the ARDUINO development software. Are you talking about the same?

I am making this questions because this is a very powerful hardware. Imagine that you want to build a CNC machine. Do you think you need a 500MB OS just to control 3 step motors?

Isn't easier to make your own code and boot it?
Vasco Ferraz

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26659
Joined: Sat Jul 30, 2011 7:41 pm

Re: My first attempt to understand this Raspberry Pi

Thu Aug 30, 2012 2:42 pm

The Raspi is designed to run Linux, but as others have said you can run bare code on it. However, you then don't get much in the way of support for usb stacks, ethernet stacks or display drivers if you go that way.

There are also no IDE's to support this sort of baremetal usage, as you might get with Arduino.

So, no this isn't just a souped up Arduino - and was never intended to be.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
VascoFerraz
Posts: 83
Joined: Thu Aug 30, 2012 11:54 am

Re: My first attempt to understand this Raspberry Pi

Thu Aug 30, 2012 3:16 pm

jamesh wrote:The Raspi is designed to run Linux, but as others have said you can run bare code on it. However, you then don't get much in the way of support for usb stacks, ethernet stacks or display drivers if you go that way.

There are also no IDE's to support this sort of baremetal usage, as you might get with Arduino.

So, no this isn't just a souped up Arduino - and was never intended to be.
I am not asking this in a bad intention... This is super great :) I was just asking if besides the linux I could use it as a "super arduino" even though knowing if I did that I will lose the USB, HDMI...

Of course coding HDMI in assembly or C with my bare hands is impossible (for me). But for a CNC machine or a Home Automation product i don't need HDMI or USB, I just need GPIO, timers, interrupts, ICSP... and for me that is possible. Of course that I could use arduino for that, and in fact I do :)

However, if it's easier to boot a 500MB OS, and then make a SW for Home Automation or CNC, it's also great... Because I can easily add a Touch Screen to control all Sensors in my house...

I will get the PI within 3/4 weeks :)

Regards and thank you so much for your help.
Vasco Ferraz

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: My first attempt to understand this Raspberry Pi

Thu Aug 30, 2012 6:14 pm

KenshinPT wrote:
jamesh wrote:The Raspi is designed to run Linux, but as others have said you can run bare code on it. However, you then don't get much in the way of support for usb stacks, ethernet stacks or display drivers if you go that way.

There are also no IDE's to support this sort of baremetal usage, as you might get with Arduino.

So, no this isn't just a souped up Arduino - and was never intended to be.
I am not asking this in a bad intention... This is super great :) I was just asking if besides the linux I could use it as a "super arduino" even though knowing if I did that I will lose the USB, HDMI...

Of course coding HDMI in assembly or C with my bare hands is impossible (for me). But for a CNC machine or a Home Automation product i don't need HDMI or USB, I just need GPIO, timers, interrupts, ICSP... and for me that is possible. Of course that I could use arduino for that, and in fact I do :)

However, if it's easier to boot a 500MB OS, and then make a SW for Home Automation or CNC, it's also great... Because I can easily add a Touch Screen to control all Sensors in my house...

I will get the PI within 3/4 weeks :)

Regards and thank you so much for your help.
You can program it like the arduino in bare metal
Example: flashing leds in bare metal on PI

Code: Select all

include 'DexBasic\DexBasic.inc'   
                 
pinMode  GPIO16, OUTPUT                            ; set GPIO 16 as output
                                                 
LetsLoop:                                         
digitalWrite  GPIO16, HIGH                         ; set LED on
delayMicroseconds  1000000                         ; waits 1 second
digitalWrite  GPIO16, LOW                          ; set  LED off
delayMicroseconds  1000000                      
goto  LetsLoop                                    
                                                  
align 4                                           
ProgramSize:                                      
Flashing leds on arduino

Code: Select all

int ledPin = 13;                 // LED connected to digital pin 13

void setup()
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
}

void loop()
{
  digitalWrite(ledPin, HIGH);   // sets the LED on
  delay(1000);                  // waits for a second
  digitalWrite(ledPin, LOW);    // sets the LED off
  delay(1000);                  // waits for a second
}

Nearly the same, also you can use bare metal HDMI as simple as this

Code: Select all

include 'DexBasic\DexBasic.inc'

load   BmpImage, ScreenBuffer
sync
end
BmpImage:
file 'Image1.bmp'
align 4
ProgramSize:
ScreenBuffer:
This will boot and dump the bmp file "Imag1.bmp" to screen in less than 2 seconds. 8-)
http://www.youtube.com/watch?v=Hc-5epQT ... el&list=UL

Bare metal CNC machine is also easy http://www.youtube.com/watch?v=TL71Nac2 ... el&list=UL
Batteries not included, Some assembly required.

User avatar
VascoFerraz
Posts: 83
Joined: Thu Aug 30, 2012 11:54 am

Re: My first attempt to understand this Raspberry Pi

Thu Aug 30, 2012 9:07 pm

Thank you so much DexOS :)

Your answer makes 100% sense and I was not buying the the need to load linux to flash an LED.

One thing is: It's difficult OR the Rasp Pi was NEVER intented to work like this.
Another think is: "America, Yes we can" :) lol

Second: You need to compile Linux into Assembly Instructions and load those in the SD card. If you need to do that with linux you should be able to do that with your own code. So... where's the IDE / compiler for that? Where do I compile my "Flashing LED" code?

Regards and thanks.
Vasco Ferraz

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13092
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: My first attempt to understand this Raspberry Pi

Thu Aug 30, 2012 11:48 pm

Look at it this way, the PI is both the "arduino" you can program in assembly or C for,
AND
is the desktop computer running all the editors assemblers linkers and compilers you need, here is a list of IDE (integrated development environments) written for Linux, many of which would run fine on a PI.
http://linuxmafia.com/faq/Devtools/ides.html

After you have created your "bare metal code" for the PI using these tools, you can use the same PI to execute it.

However, if you stay in the confines of a full OS, you get the great benefit of a large library of pre-written functions, especially useful for high end tasks, like USB communications.

Heater
Posts: 15949
Joined: Tue Jul 17, 2012 3:02 pm

Re: My first attempt to understand this Raspberry Pi

Fri Aug 31, 2012 6:07 am

KenshinPT,

I do appriciate your desire for the least amount of code and hardware to do simple things with a microcontroller. I'd like to suggest I different way for you look at the Pi though.

Normally for small jobs I would like to use an AVR or other simple, small, cheap microcontoller. I am more than happy to have no operating system in it and that every byte of code inside is mine. One of my favorite devices today is the Propeller MCU from Parallax Inc. http://www.parallax.com/tabid/407/Default.aspx.

However you still need a PC to run the tools, the IDE, editor, compiler, the downloader etc.

Then for some more adventutous projects you get the need to add storage to your micro-controller, asn SD card perhaps. Or you want to speak to it via USB. Or you need some display capability. Or you want to communicate with it over a network or even wirelessly. These things complicate your design and may take significant code, and perhaps the MCU does not really have the speed or memory to do it well.

One solution to all this is to combine the Raspberry Pi with your MCU into the project. For example there is already a Raspi format board carrying Arduino hardware that sits on top of a Raspberry Pi board. Others are develloping designs for such a format "plate" to carry the Propeller MCU.

This combination gives you in one small box the real-time processing and I/O capability of your MCU and the MCU now has access to all those higher level features, file system, network, USB display etc of the Raspberry Pi.

As a bonus you can now throw away your PC and develop all your code actually on the embedded system you have built. All self contained.

I would suggest this rather than bare metal programming the Pi and missing out on all the capabilities it has to offer.
Memory in C++ is a leaky abstraction .

User avatar
VascoFerraz
Posts: 83
Joined: Thu Aug 30, 2012 11:54 am

Re: My first attempt to understand this Raspberry Pi

Fri Aug 31, 2012 8:32 am

Heater wrote:KenshinPT,

I do appriciate your desire for the least amount of code and hardware to do simple things with a microcontroller. I'd like to suggest I different way for you look at the Pi though.

Normally for small jobs I would like to use an AVR or other simple, small, cheap microcontoller. I am more than happy to have no operating system in it and that every byte of code inside is mine. One of my favorite devices today is the Propeller MCU from Parallax Inc. http://www.parallax.com/tabid/407/Default.aspx.

However you still need a PC to run the tools, the IDE, editor, compiler, the downloader etc.

Then for some more adventutous projects you get the need to add storage to your micro-controller, asn SD card perhaps. Or you want to speak to it via USB. Or you need some display capability. Or you want to communicate with it over a network or even wirelessly. These things complicate your design and may take significant code, and perhaps the MCU does not really have the speed or memory to do it well.

One solution to all this is to combine the Raspberry Pi with your MCU into the project. For example there is already a Raspi format board carrying Arduino hardware that sits on top of a Raspberry Pi board. Others are develloping designs for such a format "plate" to carry the Propeller MCU.

This combination gives you in one small box the real-time processing and I/O capability of your MCU and the MCU now has access to all those higher level features, file system, network, USB display etc of the Raspberry Pi.

As a bonus you can now throw away your PC and develop all your code actually on the embedded system you have built. All self contained.

I would suggest this rather than bare metal programming the Pi and missing out on all the capabilities it has to offer.
Your idea of this "embedded" system: RasPi + MCU is great. You can mix the benefits of an OS (communication, display, network...) with the real-time processing, timers, I/O, interrupts of the MCU.

So, if imagine that I want to control a step motor using the Arduino RF module.

1) I boot linux on RasPi
2) I open a software to manipulate the GPIO of the RasPi
3) I send, using that software, the right signal to the RF emitter... which is attached to the GPIO of the RaspPi
4) The RF emitter receives the signal and sends it.
5) The RF receiver translates that signal and send it to the step motor driver or another MCU, for example.

This procedure is correct? Which software should I use in Linux to manipulate the GPIO's of the RaspPi?

Thanks
Vasco Ferraz

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26659
Joined: Sat Jul 30, 2011 7:41 pm

Re: My first attempt to understand this Raspberry Pi

Fri Aug 31, 2012 9:57 am

I suggest a search on the forum for a couple of things - Gertboard and GPIO. That should give you the information you are looking for, as they have all been discussed at length.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Heater
Posts: 15949
Joined: Tue Jul 17, 2012 3:02 pm

Re: My first attempt to understand this Raspberry Pi

Fri Aug 31, 2012 10:04 am

KenshinPT,

I can't speak about using Arduino as I don't know so much about it.

My current efforts concern mating a Parallax Propeller MCU to the Raspi. The Propeller is notable because it has 8 32 bit CPU's each running at 20MIPs and 32KB shared RAM. It has 32 general purpose I/O pins, 16 timers, and hardware video support for TV and VGA output. It is very easy to program in C or Assembler and has a very simple Arduino style IDE "SimpleIDE". The Propeller is perfect for driving steppers or servos or reading encoders and a million other such jobs where you need a lot of pins and real-time control. All this for about 10 Euro. Oh and you can also use the pins for sigma.delta analog to digital conversion.
Soon there will be a Propeller II with 10 times the speed, much more RAM and 96 I/O pins. and other goodies.

Anyway the plan is to connect the Propeller to the Raspi's UART on the GPIO header and use that for programming the Propeller and subsequent communication between Raspi and Prop. The SimpleIDE has already been built for ARM and runs on the Raspi very well.

Then I want to design a board that is Raspi form factor, mating to the GPIO header, which carries a 40 Pin DIP Propeller (They come in surface mount as well). The board will have a few support devices for the Prop, XTAL and such, most of it's I/Os will be available on headers.

One idea is to add a few resistors and a VGA connector so that the Prop board can be used as a VGA
text terminal for the Pi.

So yes you have the idea:)
Memory in C++ is a leaky abstraction .

User avatar
VascoFerraz
Posts: 83
Joined: Thu Aug 30, 2012 11:54 am

Re: My first attempt to understand this Raspberry Pi

Fri Aug 31, 2012 10:55 am

Heater wrote:KenshinPT,

I can't speak about using Arduino as I don't know so much about it.

My current efforts concern mating a Parallax Propeller MCU to the Raspi. The Propeller is notable because it has 8 32 bit CPU's each running at 20MIPs and 32KB shared RAM. It has 32 general purpose I/O pins, 16 timers, and hardware video support for TV and VGA output. It is very easy to program in C or Assembler and has a very simple Arduino style IDE "SimpleIDE". The Propeller is perfect for driving steppers or servos or reading encoders and a million other such jobs where you need a lot of pins and real-time control. All this for about 10 Euro. Oh and you can also use the pins for sigma.delta analog to digital conversion.
Soon there will be a Propeller II with 10 times the speed, much more RAM and 96 I/O pins. and other goodies.

Anyway the plan is to connect the Propeller to the Raspi's UART on the GPIO header and use that for programming the Propeller and subsequent communication between Raspi and Prop. The SimpleIDE has already been built for ARM and runs on the Raspi very well.

Then I want to design a board that is Raspi form factor, mating to the GPIO header, which carries a 40 Pin DIP Propeller (They come in surface mount as well). The board will have a few support devices for the Prop, XTAL and such, most of it's I/Os will be available on headers.

One idea is to add a few resistors and a VGA connector so that the Prop board can be used as a VGA
text terminal for the Pi.

So yes you have the idea:)
I have a few experience with PIC's, ATMEGA's and 8051... but this Parallax uC looks really amazing :D

I use very often the MPLAB to work on PICs and the Arduino IDE when working on ATMEGA and both seem really simple and powerful BUT I am very tempted to start working with the Parallax uC.

I will get my hands on a RaspPi within 3/4 weeks... and for sure I will follow your advices :) But has I have more experience with PICs and ATMEGAs, maybe I'll start with those first.

Thanks.
Vasco Ferraz

Heater
Posts: 15949
Joined: Tue Jul 17, 2012 3:02 pm

Re: My first attempt to understand this Raspberry Pi

Fri Aug 31, 2012 11:59 am

Probably best to start out with what you know.

The Propeller is almost unique. What with 8 cores. The philosophy is that it has almost no peripherals like UART, SPI, USB in silicon with dedicated pins. Instead of using silicon space for peripherals you get CPU's. If you want a UART you write one in software and run it on a core. In fact one core can support 4 full duplex serial interfaces. Or you can create PWM servo drivers in software. One demo shows 32 servos being driven from a single Propeller. In this way the Prop is very flexible.

One interesting feature is the lack of interrupts. Well, with 8 cores you don't need interrupts. Just put what would be in an interrupt handler into a core that waits for the event to happen.

The nice result of this architecture is that you can mix software components made by others with your applications code and be sure that the "foreign" modules are not going to effect the timing of your applications code or of any other modules you have mixed in.

The nearest thing I can think of is the multi-core MCU's from XMOS. I have thought about the possibility of building a "plate" to carry an XMOS chip but I don't think their tool chain is available on ARM, the source code is not available yet to build the tools for ARM, and the chips themselves are a lot harder to work with hardware wise.
Memory in C++ is a leaky abstraction .

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: My first attempt to understand this Raspberry Pi

Fri Aug 31, 2012 5:56 pm

The idea with a PI and a arduino ( or other MCU ) on top is the best way to use the PI.
I am work on such a board, but i will still run a bare metal OS on the pi.
This may seem odd to some, but to me the PI OS only need to boot fast, be able to just power off instantly, be able to show high res graphics, be able to talk to and from the MCU, be able to read write to SD card, take input from keyboard/mouse, have both a cli and gui, plus a built in basic interpreter.
Being small in size is also important, say less the 50k in size.
This i have already done, just working on the PCB layout.
Anything else that is needed, would be added by a arduino shield.

This to me would also be better for eduction, as a 50k OS is more understandable, than a OS the size of linux.
Batteries not included, Some assembly required.

Heater
Posts: 15949
Joined: Tue Jul 17, 2012 3:02 pm

Re: My first attempt to understand this Raspberry Pi

Fri Aug 31, 2012 8:10 pm

DexOS

Interesting. Although I find the term "bare metal OS" a bit self contradictory. If your program is working through an OS then it is not "on the metal" as it were. Or is the OS code linked into the final loadable executable thus making the whole a "bare metal" program.

Anyway, the idea of a minimal simple OS as an educational example is excellent. Afterall Linux itself was inspired by the small Minix OS, as far as I can tell, which was ceated for that purpose. What is this 50K OS you are using.

On the other hand being able to build and run the development tools for your attached MCU on the Pi is attractive to me.
Memory in C++ is a leaky abstraction .

thradtke
Posts: 492
Joined: Wed May 16, 2012 5:16 am
Location: Germany / EL

Re: My first attempt to understand this Raspberry Pi

Fri Aug 31, 2012 9:09 pm

KenshinPT,

there's a significant difference between the Pi and the Arduino when it comes to things like these: Programming under an official OS is intended and supported on the first, bare programming is intended and supported on the latter.

It follows:

If your Arduino built into the CNC dies and there's no longer a supply of exactly this model, you grep another, more modern model and port (if necessary) your program with little effort. If, OTOH, you had programmed a Pi and rely on the GPIO always addressed the same or the framebuffer to be accessed always the same, you're likely lost on new Pi hardware, or have a hard time porting your software at least.

Hardware banging is strongly discuraged on desktop computers. Ancient systems like the Amiga really suffered from programmers touching the hardware without an abstraction layer.

If you must control e.g. CNC hardware with a desktop computer, your best bet would be a Pi with a supported RT OS like OS9 - but this doesn't exist as of now AFAIK (maybe that's a hint to someone ;-) ).
Rocket Scientist.

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: My first attempt to understand this Raspberry Pi

Fri Aug 31, 2012 10:07 pm

Heater wrote:DexOS

Interesting. Although I find the term "bare metal OS" a bit self contradictory. If your program is working through an OS then it is not "on the metal" as it were. Or is the OS code linked into the final loadable executable thus making the whole a "bare metal" program.

Anyway, the idea of a minimal simple OS as an educational example is excellent. Afterall Linux itself was inspired by the small Minix OS, as far as I can tell, which was ceated for that purpose. What is this 50K OS you are using.

On the other hand being able to build and run the development tools for your attached MCU on the Pi is attractive to me.
Bare metal OS to me means being able to have direct access to hardware, without a driver in between, example MS Dos was a bare metal OS.
To other's it may mean something else, like a single boot program etc.

The OS i am using is a OS i have been working on for a number of years, that is coded in 100% ASM, the x86 ver is 50k and has all the normal stuff like cli, gui, tcp/ip stack, has a fasm port and ide, so can be coded and assembled on the OS its self.
Now i have ported it to the pi, it uses a ps2 keyboard and mouse for input, so i am working on some pcb's to add the ps2 keyboard support to the pi, the pcb also has a basic arduino clone on it, plus a RTC.
I see it as a arduino with high graphics.
The x86 ver is fully open source, as will be the arm port, so if anyone wants the code let me know.
Batteries not included, Some assembly required.

Return to “General discussion”