ARM Development

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
User avatar
Pancakes
Member
Member
Posts: 75
Joined: Mon Mar 19, 2012 1:52 pm

ARM Development

Post by Pancakes »

I thought this would be a good way to put a little spotlight on ARM development. As you may know the ARM architecture is quite popular with mobile phones, digital televisions, and even in mobile computers. I think it is a nice platform because it is very simple design in operation.

If your looking for a real challenge and experience then developing for the X86/X64 is definitely a great route with all the backwards compatibility, processor modes, various hardware, and features. So I do not want to subtract anyone from developing for it.

You can for quite a cheap price purchase development boards with an ARM processor and various modules or hardware attached. And, with the appearance of many ARM based devices it is easier to get your hands on a real piece of hardware with even a display attached. Also, QEMU supports emulation of an ARM system for a few different boards.

Also, the wiki is slowly being populated with information about developing for the ARM and for some of you who have dreams of making money you might find the ARM market quite lucrative or even help land your self a job one day having some experience.

Here is our main page on the wiki for ARM development:
http://wiki.osdev.org/ARM_Overview

I threw together a nice starting point for experimentation and learning today:
http://wiki.osdev.org/ARM_Integrator-CP_IRQTimerAndPIC

That last link will help to jump start you into the world of ARM by giving you a real example that will save you hours of collecting information and trying to get started. If you own a development board or some device. You will just need to have the correct values for the memory locations for the stacks, and be able to write the image to FLASH or load it into memory somehow on the device.

Also, the ARM provides a nice route directly into electrical engineering if your interested in that sort of stuff. This is made possible because of not only their SOC (system on a chip) design but they provide GPIO (general purpose input/output) hardware unlike an X86/X64 CPU. I suppose you could technically use pins off an X64/X32 CPU that are meant for other things, but this is likely going to be quite difficult as the availability of such hardware is limited and could be expensive (I have no knowledge in this are). This GPIO hardware provides you with high speed pins directly off the SOC to use to interface with other hardware. The pins can be used for external interrupt events, sink current, source current, or even be connected to various internal hardware such as ADCs (analog to digital converters [voltage measurement]), DACs (digital to analog converters [sound output, waveform output, ..etc], PWM (pulse width modulation for driving motors), and many other things. I can not name how many times I have used an ARM device to interface with other hardware either for experimentation or to fix things. Once time I flashed the wrong BIOS on my PC motherboard and had to directly wire up to the serial BIOS (old style was parallel) on the motherboard to write the correct BIOS back onto the chip! Was a real challenge and fun.

So for those of you who are interested in these types of things the ARM platform is a good way to start and also enjoy developing an operating system!
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: ARM Development

Post by bwat »

Pancakes wrote:You can for quite a cheap price purchase development boards with an ARM processor and various modules or hardware attached. And, with the appearance of many ARM based devices it is easier to get your hands on a real piece of hardware with even a display attached. Also, QEMU supports emulation of an ARM system for a few different boards.
...
Also, the ARM provides a nice route directly into electrical engineering if your interested in that sort of stuff. This is made possible because of not only their SOC (system on a chip) design but they provide GPIO (general purpose input/output) hardware unlike an X86/X64 CPU.
...
You're quite right!

The desktop PC is becoming more and more unfriendly for OS developing it seems. Back when the ISA bus was still used, a hobbyist could buy a ISA prototyping board, throw a few logic gates together and end up with their own I/O card. When that bus disappeared it became harder but we still had the parallel port for digital I/O. Now that's gone from most home computers. Looks like ARM will be the top-end platform for hobbyist low-level hacking. I had a quick look on the website of my local electronics supplier and they have 17 ARM development kits (that's not including the Raspberry Pi). That's pretty good.
Every universe of discourse has its logical structure --- S. K. Langer.
embryo

Re: ARM Development

Post by embryo »

bwat wrote:The desktop PC is becoming more and more unfriendly for OS developing it seems ... Looks like ARM will be the top-end platform for hobbyist low-level hacking.
What kind of hacking is supposed? Is it something like microcontroller's area of domination? What hardware the controller is supposed to manage?

It seems desktop PC is targeted for different market - office and entertainment, while microcontrollers target some hardware management (like robots). How many hackers make robots?
Antti
Member
Member
Posts: 923
Joined: Thu Jul 05, 2012 5:12 am
Location: Finland

Re: ARM Development

Post by Antti »

bwat wrote:The desktop PC is becoming more and more unfriendly for OS developing it seems.
The desktop PC is a very interesting piece of hardware. Why? You can currently write an OS that runs on real production computers and compete with real OSes. I really like this fact and it is pleasing to continue developing on the PC hardware in spite of all its negative things. Anyway, the ARM development and development boards are interesting too.
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: ARM Development

Post by bwat »

embryo wrote:
bwat wrote:The desktop PC is becoming more and more unfriendly for OS developing it seems ... Looks like ARM will be the top-end platform for hobbyist low-level hacking.
What kind of hacking is supposed? Is it something like microcontroller's area of domination? What hardware the controller is supposed to manage?
Anything really, even just simple stuff to kill boredom.
embryo wrote:It seems desktop PC is targeted for different market - office and entertainment, while microcontrollers target some hardware management (like robots).
Now yes, but in the old days it was a much more hackable platform. The PC was an open platform. Just look at the ISA bus connector - it's basically the CPUs address bus, data bus, control signals and interrupt lines - everything you need right there. Anybody that's had some basic digital design instruction, i.e. knows about logic gates, flip-flops, state machines, processor buses, and has access to some 74' series chips and other basic components should be able to build something and interface it with a computer. To me that's a necessary part of a general purpose computing platform. These days you need to understand USB. It's not impossible to get the PC to interface with the outside world but it's more work than it used to be and beginners need more knowledge, or 3rd part hardware/drivers, just to get started.

For me a non-x86 future is looking more and more attractive from a hacking point of view. I took delivery of a FPGA starter kit from Altera the other day. The next step for me is designing my own computational platforms in hardware. My inspiration is the work of this young man:

embryo wrote:How many hackers make robots?
Loads. There's a whole home robot revolution going on, especially in aviation. Those of us who stick to x86 desktop machines will miss out.
Every universe of discourse has its logical structure --- S. K. Langer.
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: ARM Development

Post by bwat »

Antti wrote:
bwat wrote:The desktop PC is becoming more and more unfriendly for OS developing it seems.
The desktop PC is a very interesting piece of hardware. Why? You can currently write an OS that runs on real production computers and compete with real OSes. I really like this fact and it is pleasing to continue developing on the PC hardware in spite of all its negative things. Anyway, the ARM development and development boards are interesting too.
It's great for software development, but when it comes to interfacing with the real world with homebrew hardware, it went downhill when the buses got more complicated (understandable) and they started dropping the parallel port. I've done a quick check. It seems the parallel port PCI cards cost about the same as a Raspberry Pi. I'm not sure which one I would buy to tell the truth....
Every universe of discourse has its logical structure --- S. K. Langer.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: ARM Development

Post by Brendan »

Hi,
bwat wrote:It's great for software development, but when it comes to interfacing with the real world with homebrew hardware, it went downhill when the buses got more complicated (understandable) and they started dropping the parallel port. I've done a quick check. It seems the parallel port PCI cards cost about the same as a Raspberry Pi. I'm not sure which one I would buy to tell the truth....
I was playing with a Raspberry Pi recently. For a python programmer, I wrote a "thing" in C to get data from a temperature/humidity sensor and control an air conditioner (via. a "PiFace" expansion board, where the driver does bit-banging on the Pi's GPIOs to get a serial bus to talk to the PiFace board, to control GPIOs!). This week I find out he's added code to pump the data from my utility into a mySQL database; and added a CRON job that executes a python script every minute to generate a pretty graph (png) in Apache's directory (so people can just see the graph in a remote web browser). It all sounded great in theory, except that the temperature sensor needs precise timing to avoid data corruption due to losing sync and is running in user-space because there's no kernel driver for it, and python is causing 100% CPU load for 30 seconds every minute just to draw the graph, and the resulting task switches cause my code to do "retry until data not corrupt and give up if too many retries" and miss samples, etc. It's mostly a huge ugly hack that makes me cry.

In any case, after using the thing for a while, my best guess is that the CPU is about as powerful as an old 166 MHz Pentium that people give away/throw away now.

Also note that there's no parallel port on the Raspberry Pi; and if you actually need a parallel port (I have no idea why anyone would anymore) then you might want to consider getting a USB to parallel converter that you can plug into a PC or a Raspberry Pi.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
embryo

Re: ARM Development

Post by embryo »

bwat wrote:I took delivery of a FPGA starter kit from Altera the other day. The next step for me is designing my own computational platforms in hardware.
It is really interesting! What do you think about a processor to be as open as possible? It is just right for FPGA based development. And in the end there can be a compiler able to parallel a standard sequential program in a very effective way. The idea is really attractive to me. But implementation can be very time consuming :(
bwat wrote:My inspiration is the work of this young man:
For me the multicopters are a kind of an inspiration. And the use for them is photography. But it's still waiting to be done ...
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: ARM Development

Post by bwat »

Brendan wrote: Also note that there's no parallel port on the Raspberry Pi; and if you actually need a parallel port (I have no idea why anyone would anymore) then you might want to consider getting a USB to parallel converter that you can plug into a PC or a Raspberry Pi.
The PC parallel port is useful for hardware hacking as it gives you 5 inputs, 12 outputs, and one of those inputs can be configured to generate an interrupt. These pins are TTL logic.
Every universe of discourse has its logical structure --- S. K. Langer.
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: ARM Development

Post by bwat »

embryo wrote:
bwat wrote:I took delivery of a FPGA starter kit from Altera the other day. The next step for me is designing my own computational platforms in hardware.
It is really interesting! What do you think about a processor to be as open as possible? It is just right for FPGA based development. And in the end there can be a compiler able to parallel a standard sequential program in a very effective way. The idea is really attractive to me. But implementation can be very time consuming :(
My plan is to build processors which are well suited to certain programming languages. These wont be general purpose run anything kind of processors. They will have support in hardware for unification and backtracking for logic programming languages, or beta reduction for functional programming, etc. This way the compilers are easier.

However, right now, I'm trying to teach myself verilog and Quartus II, so I'm trying to get an 8080 to run a basic I/O loop.
Every universe of discourse has its logical structure --- S. K. Langer.
embryo

Re: ARM Development

Post by embryo »

bwat wrote:My plan is to build processors which are well suited to certain programming languages. These wont be general purpose run anything kind of processors. They will have support in hardware for unification and backtracking for logic programming languages, or beta reduction for functional programming, etc. This way the compilers are easier.
It's ease of use, but not performance. However, ease of use is a very motivating thing :)
User avatar
Pancakes
Member
Member
Posts: 75
Joined: Mon Mar 19, 2012 1:52 pm

Re: ARM Development

Post by Pancakes »

I will also like to say that if any of you do buy a board and decide to wire it to something the very first and biggest mistake you will make (and yep I have burned a few CPUs up) is to over draw too much current from a pin or to put too much voltage on a pin. So make sure the very first thing you do is fine the max current each pin can handle (from the datasheet) and stay at or below 75% of it, and voltage is not as much of an easy mess up but if you put more voltage (using the pin as an input) than it can handle you can source too much current. It is weird but once you burn up a pin it either stops working or even worse your whole chip starts to burn up and it can happen slowly, lol. I burned a PWM module up once and slowly watched the whole chip die a slow death over about 15 minutes.

Use transistors to allow your pins to handle larger currents like BJTs or FETs (MOSFETs). Both differ greatly in what you use them for, but just figured I would throw this heads up and give some direction so you do not burn that nice development board up. It is generally a great idea to use a transistor (MOSFET preferred) for protection if you are not sure what could happen. BJTs can pull a lot of current too so I would mostly stick with using MOSFETs as they are mainly going to be what you want early on. I started with BJTs before I even knew a MOSFET existed and it really made a lot of the things I wanted to do more difficult. BJTs are cheaper from what I have always bought compared to MOSFETs. Also, you have two different types of MOSFET (N-channel and P-channel) and BJT (PNP, NPN) so experiment away! Plus, your output pins (from the CPU/GPIO) are going to be either totally on or totally off which makes using a MOSFET attractive versus a BJT.

http://www.electro-tech-online.com/thre ... bjt.39339/
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: ARM Development

Post by bwat »

Pancakes, do you program your boards with JTAG and if so what hardware/software do you use? Actually, whether you use JTAG or not it would be interesting to know what your set up is.
Every universe of discourse has its logical structure --- S. K. Langer.
User avatar
Pancakes
Member
Member
Posts: 75
Joined: Mon Mar 19, 2012 1:52 pm

Re: ARM Development

Post by Pancakes »

I got a JTAG dongle and I like using OpenOCD, but I also program stuff with out the JTAG. Some chips do not have it. I also have a $200 AVR board and it supports using USB to load an image onto FLASH, and then if I want I can hook JTAG up to it. I would have preferred an ARM board, but I forgot why I choose the AVR but anyway. Also have some tiny 8-bit 8-pin CPUs that I flash using my parallel port (USB to parallel connector) and they do not support JTAG at all. And, I had to build a translator circuit to change the voltages from the parallel port so it could talk with the PIC. Also, a lot of your CPUs can have an external clock which can be helpful because you can ether clock it slower or step it if you have a problem and can not or do not want to use JTAG.

I generally do not use debuggers because I am pretty good at debugging and find it challenging, but there is nothing wrong with using JTAG. JTAG can also manipulate memory meaning you can upload images with it so it is a little more than just a debugger which is cool.

I also keep a lot of resistors, diodes, capacitors, few inductors, transistors, LEDs, ribbons, headers, timers 555, op-amps, comparators, counters, XTAL crystals, ... you name it. I have a few bread boards (which I love). Honestly using a breadboard is my preferred way but its not fun when you start to deal with radio frequencies because of all the capacitance the tracks in the board cause. So I do not have much experience with RF because it is just more difficult for me.

The only thing I do not have is an oscilloscope! Yep, most of my stuff I just try to debug through various methods. I used to have an old CRT one but it finally broke on me.

I also use spice sometimes to experiment.

That is my setup. Nothing too crazy, but just enough to work on things.

But, if you want to get started I would recommend you get a two breadboards at least. That way when you build something you can keep it built and set it aside and use your other one to work on something else. Also, you want a soldering gun (one you can control the temperature with is a great) because too much heat can ruin the traces on a board. For example my AVR development board has all these pads where you can solder to it. I ruined two pins with too much heat! And, soldering is a technique so you have to be ready to accept the fact that your going to have trouble. Also, having plenty of wire of different colors. A JTAG connector is fine but not required unless you get a SOC (system on a chip) that requires it. Most high level SOCs have a special boot loader that can flash your code from USB. The boot code enables the USB controller and then waits when you hold a certain sequence of buttons. Also, ordering plenty of resistors and capacitors (ceramic and electrolytic) - just the mixed bags is good for starting. Diodes are a must. You might even want to get a few different kind of diodes both silicon and others because some are designed to have different or lower breakdown voltages and keep in mind diodes can act like transistors and voltage regulators. I would recommend you definitely get a handful of MOSFETs both N and P channel and a bunch of BJTs both NPN and PNP. And, also do not forget some voltage regulators. Either variable regulators or fixed. Having some 3.3V, 5V, and 12V are great. Computer power supplies are really nice to use too for voltages because they can give you different stable voltages, but remember you might want to miniaturize your design so having some regulators is a must. Also LEDs are just perfect for indicators. I would not worry with coils much unless but they can be fun to learn and do things with, but having some magnet wire is great for winding them with. And, having both a digital multimeter and an analog (needle). Having ribbons and connectors that can fit into your breadboards is nice too. Also having a adapter handy that can plug into your sound card (input or output) is very handy for a cheap oscilloscope or even for outputting (just make this easily by hand) - you know just buy an audio connector and solder on some wires. I like also having some braided and solid wire. Also buy a few crystals at different frequencies because you might find them very interesting to build an oscillator with.

You can do a lot of experimenting with breadboards especially at low frequencies and I would say that is likely going to be the best to use at first to learn. You can also find some electronics boards out there that come with a bunch of components and that might even be a better way for someone to start. I started with one when I was really young.

I would also like to say if you think computer programming is hard then your in for a real challenge with electromagnetism!
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: ARM Development

Post by bwat »

Pancakes wrote:I also keep a lot of resistors, diodes, capacitors, few inductors, transistors, LEDs, ribbons, headers, timers 555, op-amps, comparators, counters, XTAL crystals, ... you name it.

That was quite funny to read. You've just described the contents of the plastic boxes at my feet! For some reason I've got loads of 741 op amps as well. I was building small microphones a while ago and used them as amplifiers to connect the microphone to the PC's audio input. I must have bought a metric s**t load of them at the time.
Pancakes wrote:I have a few bread boards (which I love).
Breadboards are a necessity when you solder like I do. I don't solder enough to get good at it. Very little of what I build will survive long enough top warrant soldering.
Pancakes wrote:Honestly using a breadboard is my preferred way but its not fun when you start to deal with radio frequencies because of all the capacitance the tracks in the board cause. So I do not have much experience with RF because it is just more difficult for me.
Me neither. Can't say that I'm great at electronics. Anything outside digital design and very basic analogue circuits with op amps and transistors is a mystery to me.
Pancakes wrote:The only thing I do not have is an oscilloscope! Yep, most of my stuff I just try to debug through various methods. I used to have an old CRT one but it finally broke on me.
I made the mistake of buying a handheld single channel one some years ago. Don't ask me why I bought a single channel scope - they're not much more use than a voltmeter to be honest.
Pancakes wrote:I would also like to say if you think computer programming is hard then your in for a real challenge with electromagnetism!
I'll leave that to the clever people - just too much for me. I like my mathematics discrete.

Have you done anything with a FPGA? I've just started. Within three days I went from zero experience to having somebody else's 8080 design running on my board executing a small test program sitting an a ROM I had built with verilog - just reading switches and outputting their state to LEDs. I thought it would be much harder than it turned out to be. I'm now on a mission to get some processors designed and of course write an OS or two for them. Unfortunately the development board I have doesn't have too much I/O. I've got my eye on a DE0-Nano board.

I bought an Arduino starter kit as a present for someone who I'll help learn about electronics and programming. It was the first session yesterday and I wasn't sure if they would like it. They loved it! It comes with a little breadboard and loads of electrical components for the beginner who doesn't have those sorts of things at home. I actually might get one for myself as its a nice wee prototyping setup.
Every universe of discourse has its logical structure --- S. K. Langer.
Post Reply