LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   New to Embedded, Need some starting help. (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/new-to-embedded-need-some-starting-help-599503/)

RobinVossen 11-14-2007 02:33 AM

New to Embedded, Need some starting help.
 
Well, I posted this on a couple of forums.
But I dont get a response on either. I hope the Embedded Linux Users Group around here know more..

Well, I am really new to Embedded. I made somethings. But I want to go smaler..
Ive made Radio's, GameStasions but all on the size of Mini-ITX..
I want to go smaller.
Id like to know, how to code a ROM Chip?
I know C++ and ARM Assembler.
please keep in mind, I am a poor student. I dont have nor earn lots of money.
I cant afford a ROM progemmer board that costs like 700$
Well here is my first post I made:
Code:

Hello, I am really interested into making devices that run linux.
I made a couple of Embedded Linux stuff already.
eg a Security Point. And Music box that downloads the music off the inet.
But, I want to go smaller more advanced now.
You all might think that I have to big plans. but no I know I dont have enough knowledge now but I am going to learn ;)

I want to make embedded linux in devices that dont support Normal RW media. (eg a HD, SD-Stick, USB)
I want to boot linux from a ROM chip.
I know its possible. But I have no idea how.
I dont know how to write to a ROM chip for example. (A friend of me said that you can do it with a COM cable or a Printer cable.. but, I dont know..)
And, well I know I have to cross compile everything to a arm architecture. I recall that you can setup gnuc++ to do that..
But, well my question is. Can I install Linux on a ROM chip?
And how does it work with bootloaders etc then?
Is there somebody who knows a website, book, article that I should read.
Or just know it your self?

And does somebody know how I can simulate this? So I can practice before I demolish hardware ;)    (Might be good to know I am not a Electronics man. I know software. I know C++ I might learn some assembler if I need it for this..)

Well, Cheers.
Robin

In the meanwhile I (as I said before) learned Basic ARM Assembler.
Anyhow, is there anyone who can/wants to help me.
Id be really delighted.

Cheers,
Robin

theNbomr 11-15-2007 03:52 PM

If you know assembler, you probably know that the typical output from a cross assembler-linker is a hex record file, very often Intel hex format, or Motorola S-record format (may be other common standards these days; I haven't done this stuff for years). These are a plaintext format of the binary data to be burned into a ROM/EPROM/NVRAM, etc. The actual programming does require a PROM burner, but these can be had for much less than $700 (check out ebay), or can be fabricated with some effort. At any rate, the burner communicates with a PC, usually using some custom software, which sends a specified hex file to the burner, where it is programmed into the ROM.
--- rod.

RobinVossen 11-16-2007 12:25 AM

Ok, thanks thats already one step to were I want to go.
Ive been told that I can also use compiled C++ on a ROM chip.
But, well I think I just have to find that out..
When I entered PROM Burner in eBay I didnt find anything.
And at google. I found some, so I guess I am going to read that all.
The cleartext you were talking about is just what the ARM Assambler (Compiler) spits out right?
Well, thanks alot.

Cheers,
Robin

theNbomr 11-16-2007 09:44 AM

In order to get something a PROM burner can cope with, your cross compiler and linker must generate a complete statically linked image, and it must be in a format that the burner software recognizes. I have already mentioned a couple of these common formats. There may be conversion tools to convert a.out format or other binary format object code to something downloadable for the burner. The source language that the object code originates from does not matter.
I did a search on ebay for 'PROM programmer', and got a few pages of items, many for under $50.
--- rod.

RobinVossen 11-16-2007 12:24 PM

Ok, well I knew about the Cross-Compiler.
Thanks a lot.
Though I think I've put my bar way to high.
After reading more about PROM I found out that that are ROM-Chips that are writeable once.
And, since I aint good with hardware I cant really risk that.
Id like to play around with it a little and have a Platform that I can try my stuff on. Eg a Old Phone or a Gameboy or a PDA or whatever.
I dont have enough Money and Technical Knowledge to make my own Boards or buy Hardware.
So well, thanks a lot. But I think my learning ARM Assembler will go in Vain :(

theNbomr 11-16-2007 02:56 PM

In the context of programmable memory, the term 'PROM' tends to be a catch-all word to include all of the various flavors of PROMs, EPROMs, EEPROMs, Flash ROMs, NVRAM, etc. Almost any circuit that takes a PROM will also accept a UV-erasable EPROM, which is what most developers use. I have also used Dallas Semiconductor (they still around?) NVRAMs, which can be re-written without erasing, and for which it would be simple to build a 'programmer' that interfaces directly to a PC printer port. UV-EPROMs can be salvaged from old PCs (BIOS chips) and other obsolete devices quite readily, and they are almost always socketed for easy removal.
--- rod.

RobinVossen 11-16-2007 04:24 PM

Thanks a lot AGAIN.. :)

Well, now I still need to find something to Plug the Chips on.. That has a screen :)
Something like a SingleBoard With a Screen :)
Or, well Id just have to find a way to implant a NVRAM or EPROM in a Simple Computer :) (eg, a Old GSM a Old PDA a old whatever..)

Well THANKS ALOT!
You helped me alot.
How can I repay?

Cheers,
Robin

theNbomr 11-16-2007 04:40 PM

If your target board has any kind of RS-232 port, it will almost certainly be easier to get things in and out of that, than to a video chip and keyboard interface (don't forget, you won't be in Kansas any more, Toto). This is usually the very first thing a developer wants to get working on a new system. Then you can hook it up to a terminal to see what your code is doing. Once you have something that is capable of displaying the plethora of debug messages that you will need to observe, you can commence with writing simple drivers for all of the different chips that make up the functionality of the board or system.
Post back here when you've had a little success.
--- rod.

RobinVossen 11-17-2007 02:52 AM

Ok, so lets review.
I need to get a PROM Programmer.
I need to get ROM-Chips to burn code on. Eg a EPROM or a NVRAM.
I need to get a Board to put all the Debugging and coding on before I plug it on a real board.
And now we are talking about a Circuit board that has a RS-232 Port(Female)on it.
Then I can use a Application on my linux box that is like a Remote Terminal for the Board Hooked on the RS-232 port.
Then I can use my own keyboard to enter commands and check what happens on it.
Then later on I can expand my Board by adding a little Screen a Little Keyboard etc by hooking them on that board. I can then start writing Drivers for them and I can then slowly change the device to a Small Standalone Embedded (Linux) pc.
And this all is written in ARM Assembler on a 84_64x PC with a Cross-Compiler to the ARM Circuit. But I can also use C++ and Cross Compile that to the ARM.
And I need to get some kind of tongs to get the ROM-Chip out my board right? (Whats that called?)

Thanks a lot.
If I made any mistakes in here please tell me.
I think this is going to be my Embedded (Linux) Forum :)
I am going to check my Wallet and Assemble the Devices I need.

theNbomr 11-17-2007 10:47 AM

Quote:

Originally Posted by RobinVossen (Post 2961787)
Ok, so lets review.
I need to get a PROM Programmer.
I need to get ROM-Chips to burn code on. Eg a EPROM or a NVRAM.
I need to get a Board to put all the Debugging and coding on before I plug it on a real board.
And now we are talking about a Circuit board that has a RS-232 Port(Female)on it.
Then I can use a Application on my linux box that is like a Remote Terminal for the Board Hooked on the RS-232 port.

Not exactly. You write code targetted to the target CPU. You burn the code onto a suitable EPROM, plug it in and test it. Your target host will have no Operating System, so you will have to write everything. In order to debug, you will need some way of seeing what your code is doing. A serial interface is good for this. You can access the serial interface with a terminal emulator running on a PC. I like C-Kermit running under Linux for this. This means that the first code you write for your new target should be drivers for the serial port (assuming there is one).
Quote:

Then I can use my own keyboard to enter commands and check what happens on it.
Then later on I can expand my Board by adding a little Screen a Little Keyboard etc by hooking them on that board. I can then start writing Drivers for them and I can then slowly change the device to a Small Standalone Embedded (Linux) pc.
Hardware expansion is up to you. You might be thinking too far ahead right now.
If you want the device to become a Linux pc, then this whole approach is not what you want to do. There are already a plethora of Linuxes on PCs. You don't need to burn any PROMs to install Linux.

Quote:

And this all is written in ARM Assembler on a 84_64x PC with a Cross-Compiler to the ARM Circuit. But I can also use C++ and Cross Compile that to the ARM.
And I need to get some kind of tongs to get the ROM-Chip out my board right? (Whats that called?)
.
Yup, you might need a chip extractor tool. These are usually specific to the form-factor of the chip, and can be pricey. I suggest you get a DIP socket of the right size for the EPROM(s) you are using, and put that into the existing socket. Plug your EPROM into that and use a screwdriver to pry it out. When the socket wears out, plug in a new one. Same thing if you wear out the EPROM chip (I've done quite a lot of this, and never damaged either part enough to require replacement).

--- rod.

RobinVossen 11-17-2007 02:22 PM

Quote:

Originally Posted by theNbomr (Post 2962106)
Not exactly. You write code targetted to the target CPU. You burn the code onto a suitable EPROM,

Well I did understand that but I want do use ARM Processors since I know a little assembler already and Ive read that its the smallest kind.

Quote:

Originally Posted by theNbomr (Post 2962106)
Your target host will have no Operating System, so you will have to write everything.

Yea, I also got to that point already. But I have to learn a lot for that :)
I think Ill find out what I need for a simple OS. And write one. (In Assembler :/ thats going to be hard.)
When I write a simple OS I need to be below the 4 Megs. So I think I am going to study the Linux Source for example.

Quote:

Originally Posted by theNbomr (Post 2962106)
In order to debug, you will need some way of seeing what your code is doing. A serial interface is good for this.

That is since writing drivers for it is Quite Easy?

You can access the serial interface with a terminal emulator running on a PC. I like C-Kermit running under Linux for this. This means that the first code you write for your new target should be drivers for the serial port (assuming there is one).

Quote:

Originally Posted by theNbomr (Post 2962106)
Hardware expansion is up to you. You might be thinking too far ahead right now.

Yea, ok Ill know that thats really hard. I think this is going to be a very good training for me before Ill go the the Uni :)

Quote:

Originally Posted by theNbomr (Post 2962106)
If you want the device to become a Linux pc, then this whole approach is not what you want to do. There are already a plethora of Linuxes on PCs.
You don't need to burn any PROMs to install Linux.

Nah I find this other thing way more interesting :)

Quote:

Originally Posted by theNbomr (Post 2962106)
Yup, you might need a chip extractor tool. These are usually specific to the form-factor of the chip, and can be pricey. I suggest you get a DIP socket of the right size for the EPROM(s) you are using, and put that into the existing socket. Plug your EPROM into that and use a screwdriver to pry it out. When the socket wears out, plug in a new one. Same thing if you wear out the EPROM chip (I've done quite a lot of this, and never damaged either part enough to require replacement).

--- rod.

Ok, Ill search for something.. :)
Thanks a lot.
I am SO happy with this info.
I have one more question. Do you have the name of a good shop were I can buy a PROM-Programmer a Extractor a couple of PROMs :)
Maybe some documents and or beginning documents?

Thanks,
Cheers,
Robin :)

theNbomr 11-17-2007 06:30 PM

Electronics hobbyists seem to be fond of Digi-Key.

As for an OS, many, if not most embedded systems don't use one. They use one canned application, and it simply runs forever. Embedded systems tend not to be general purpose systems, bu rather dedicated and specific. Whatever code contributes to the final product is all that is written.

There is nothing wrong with wanting to write an OS, but it probably makes more sense to write some more along the lines of what is commonly described as a ROM Monitor; basically a program that allows for some basic interaction with the hardware using a set of simple commands. It would do things like fill & dump ranges of memory, memory tests, operating various peripheral interfaces, jump to user code, etc.
The main documentation you will need will be data sheets for the peripheral chips on the target board, and some info about how they are addressed on the board. Start with the UART if there is one. Plus the CPU instruction set, if you are going to do everything in assembler.

Good Luck.

--- rod.

RobinVossen 11-18-2007 02:45 AM

Quote:

Electronics hobbyists seem to be fond of Digi-Key.
Wel, I aint a Electronic guy. I am not really intrested into that. But well I think I have to learn some basics? :(
I am only intrested into Programming since thats going to take me somewere ^^

Quote:

As for an OS, many, if not most embedded systems don't use one
Ok, good since well writing a OS is way to hard for a Newb in Assembler and a Advanced C++ coder who uses Unix librarys..

Quote:

but it probably makes more sense to write some more along the lines of what is commonly described as a ROM Monitor; basically a program that allows for some basic interaction with the hardware using a set of simple commands. It would do things like fill & dump ranges of memory, memory tests, operating various peripheral interfaces, jump to user code, etc.
Like this?
http://diycalculator.pcl.at/index.ph...onitor_Project

Quote:

The main documentation you will need will be data sheets for the peripheral chips on the target board, and some info about how they are addressed on the board. Start with the UART if there is one. Plus the CPU instruction set, if you are going to do everything in assembler.
Ill read that. The CPU instruction set is just the HowTo Assembler ARM (for example) with it right?
I think Ill do some in Assembler and maybe some in C++ (I just am going to try some stuff...


Thanks again.
I am now just going to look for some PROMs. PROMProgrammer
A Simple ARM Circuit with a little screen and a COM port.
Ill write a ROM-Monitor and then Ill Just am going to try stuff.
I have for example NO idea what kind of Embedded System I can build :P
But I think I am just going to play around with Hello World etc. ^^


All times are GMT -5. The time now is 03:56 PM.