Raspberry Pi Setup

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi i'm steve halliday and this is the first in a series of videos where we're going to explore bare metal programming on raspberry pi bare metal programming means that the programs that we write will run directly on the hardware without any operating system between our program and the hardware itself we're going to explore this by doing three different things first we're going to start out by building some machine language programs we'll use a hex editor and we'll create binary files that run directly on the hardware next we'll find that the machine language programming is a bit tedious so we'll want to build some tools so we'll build a simple little assembler that will allow us to use mnemonics to program the raspberry pi and finally we'll build a small compiler on top of our assembler that will allow us to use a high-level language to program the raspberry pi what you're looking at here is a picture of my raspberry pi this is the full computer right here it's about the size of now toys box it'll run linux and does everything a full computer will do i'll give you a brief tour up here in this top left corner is an ethernet connector we can actually plug ethernet cables right in here and hook up to a network this box here is a couple of usb ports so we can hook up a keyboard and a mouse down here you've got an audio jack so you can plug your headphones in listen to music if you want this is a video jack this is rca composite video for older televisions for example or if you've got a monitor that will accept hdmi this is actually an hdmi jack up here here you have what are called gpio pins these are pins that you can program the raspberry pi to affect external hardware say for example if you wanted to do some robotics or something like that you could use these pins to control the robot and then this right here is the actual processor this is a bmc 2835 system on a chip soc which means that it's a little bit more than a cpu it has it has more capabilities than just a cpu and then actually the ram is glued on top of the soc it cuts down on the footprint a little bit and then the thing you can't see from here is right in here is a pocket that holds the sd card the sd card is the persistent storage for the pi and it's effectively the disc for the pie a couple other points of interest the soc actually runs an arm chip so it's the same processor that you have a lot of your mobile devices on this machine i've clocked it at 700 megahertz which is the standard and also it has 512 megabytes of ram on it before we begin bare metal programming on a raspberry pi it probably makes sense to make sure all our hardware is in working order an easy way to do that is to configure our pi so that we can boot linux on our machine and make sure that everything's in working order once we have our machine running linux then we can replace the linux kernel with our own bare metal program to set up our machine to run linux we need to do two things first we need to format the drive with a boot partition and then we also need to install a linux kernel in order to do this let's go pi dot org website here that we're looking at right now and we'll go the download page to find some tools that we can use on this page you'll notice several links here's a link to a quick start guide this actually takes you to a different page right now than the quick start guide link up here this link up here just gives you a diagram of the of the pi whereas this link here gives you a diagram and some text to tell you about how to set things up if you if you want to go down that path here's the formatting tool link will go here when we want to get our formatting tool so that we can format the sd card here are a couple links to zip files that give you a set of many kernel images we won't use these because these are a little bit of overkill for what we want to do we'll just download the specific image that we want if you use these what happens is you'll set these kernel images on your machine and then the first time that you boot your machine it will allow you to choose which kernel you're interested in we really only want one kernel so we'll just install the kernel that we're interested in let's go to get the formatting tool first as you can see the formatting tool actually comes in two flavors we can get a windows or a mac uh version of it i'm running on a mac so i'm going to use the mac formatting tool which we find down here and we can download by pressing this button here when we run the formatting tool it gives us a pop-up so we can authenticate ourselves let me type in my password here for a second and then we get this screen which allows us to choose what kind of format we want i found that the quick format seems to work a lot of times but sometimes i'll format the sd card with a quick format and then i'll get an error when i install the image in which case i have to come back and do the overwrite format which takes quite a bit longer so you can try the quick format first if that doesn't work when you start to install the image come back reformat your drive using the overwrite format with the sd card formatted now we're ready to install the kernel i told you before that i don't want to install the full raspberry pi setup with all the kernels and then let it choose a kernel instead i'm going to directly choose the kernel that i want to install i found the easiest way to do that is to go to this website e-linux dot org slash rpi underscore easy underscore sd underscore card underscore setup this page has a lot of instructions for how to set up an sd card for your raspberry pi on this page you'll find a couple of links that will link you to two different two different pages one is for windows setup which would take you over here to this imagewriter which would give you an application here that you could then use to install your kernel or you can go to the mac version if you've got a mac and it takes you this page here this allows you to download another app which is specifically built to help us install the kernel that we want i've downloaded this app and used it to install linux on my sd cards i haven't used the windows installation program but i assume it's fairly straightforward as well the only tricky part of using the mac installation program is that once you tell it to actually install the kernel there's no indication that it's doing anything but i guess a script is running in the background when the script is complete you'll get a pop-up that tells you you can remove the sd card when i format my sd card and when i install the kernel i plug the sd card into the slot on my mac and hopefully your windows box has one as well i probably should have mentioned that before you can actually install the kernel you need to download the kernel this application will help you install the kernel once it's downloaded in order to download the kernel you've got to go get the kernel we'll go back to the raspberry pi downloads page and down below this newbie section here you'll find the raspbian wheezy image down here and this is what i use down here so you can download this image put it somewhere on your disk and then when you run the sd card setup program it'll ask you for that image and you can give it to get give the program that image at that point and it'll go through and do the install for you now that we've formatted sd card and have installed our kernel on it we can eject the sd card from our computer and we can place it in the sd card card pocket on the back side of the raspberry pi here okay now we're set up to connect up the other components to our raspberry pi first thing we'll do is hook a mouse up to it we'll plug the mouse in here to the usb port next we'll connect a keyboard we'll plug it in the same way into the other usb port for a monitor we have an hdmi cable we can plug into the hdmi slot and now we're about ready to go the only thing we're missing is power when i took you on the tour of the raspberry pi i didn't mention this connector right here this is a little power connector but we aren't going to use this instead we're going to use a terminal emulator for most of our work with raspberry pi so what we will do is we will hook up the power of these two gpio pins here and a couple other pins we'll use for our our serial port for the terminal emulator now in order to do that we need a usb cable of some sort if you happen to have an old mouse kicking around you can click the cable off of that and use it or if you don't have a mouse maybe you can find one laying around somewhere let's see what we can find hmm wonder where i should check for this anybody looking no here's an open door let's see what's in this office i see a mouse oh there's a mouse i wonder if it's a usb mouse hm sure enough usb connector here's the mouse and clip here pretty good here's the usb cable that i found just laying around and you can see that i've hooked some connectors to it for there's four wires on the usb cable and we have white green black and red the black and the red wires are the power wires and the green the white wires are for the serial cable what we want to do is we want to hook the red cable into one of these two end pins it can go to either one but we'll use the second one in next we're going to hook the black wire next to it on this pin and now the white wire goes next onto that pin and then finally the green wire goes on the last pin there last of the four adjacent pins now you can see that we can take this and plug the usb cable into our computer and that powers up the raspberry pi and we see the light coming on and if we look at the monitor we can see that we're actually starting to boot linux up in just a moment here we'll see that it will prompt us for login if you use the raspbian wheezy kernel that i suggest you use when you get to log in prompt you can use pi as the username and the password is raspberry since we use the usb cable that we found laying around to power our raspberry pi and also to connect to the serial port we can actually interface with our raspberry pi using a terminal emulator which means we can disconnect the usb keyboard and mouse and also the hdmi cable so what i'm going to do here is i'm going to run a simple terminal emulator that i've got on my mac and connect to my raspberry pi we see here that it gives us our login prompt so i'll type in pi as my username and raspberry if it's spelled r-a-s-p-b-e-r-r-y don't forget the p in there and now we're logged in and here we are running linux hey what happened to my mouse well i guess that's the end of our first video i look forward to the next video where we'll talk about bare metal programming on raspberry pi
Info
Channel: Jamie King
Views: 14,233
Rating: undefined out of 5
Keywords: Raspberry Pi (Computer), GNU/Linux (Operating System)
Id: Y6uQG-2T4_w
Channel Id: undefined
Length: 12min 4sec (724 seconds)
Published: Fri Jul 19 2013
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.