Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Linux single board computer help

Status
Not open for further replies.

tomas632

New Member
Hi Guys,

I have been given a university project that involves a single board computer that is pre-installed with linux. The board in question (GESBC-9260) can be found here...

Low Cost ARM Single Board Computer

I have tried contacting them for help, but they were not too helpful to be honest. So far I have managed to power up the device and establish communications between my pc and sbc via a null modem cable. The sbc boots up with its internal boot loader, but after this does nothing as there is no code to execute. I have written a test file in c to try and get an led flashing, but am unsure whether i need to compile this on my pc and transfer to sbc or whether i can transfer the c file and compile on board. I know I have been very vague here, but if anyone could give any assistance or point me in the right direction it would be greatly appreciated.

Tom
 
Hi Guys,

I have been given a university project that involves a single board computer that is pre-installed with linux. The board in question (GESBC-9260) can be found here...

Low Cost ARM Single Board Computer

I have tried contacting them for help, but they were not too helpful to be honest. So far I have managed to power up the device and establish communications between my pc and sbc via a null modem cable. The sbc boots up with its internal boot loader, but after this does nothing as there is no code to execute. I have written a test file in c to try and get an led flashing, but am unsure whether i need to compile this on my pc and transfer to sbc or whether i can transfer the c file and compile on board. I know I have been very vague here, but if anyone could give any assistance or point me in the right direction it would be greatly appreciated.

Tom

Hi Tom,
I'd have to agree that they are a bit short on the documentation. :p

In the above case - trying to load your test file - yes, you need to build the exe on your pc and load it to your board with the bootloader. It is the lack of docs for the boot loader which frustrates me. There seems to be no link to such document on their support page, yet in the manual there is a reference to this:
User can consult U-boot manual for
other methods of loading data.
do you have this manual? I could be more helpful after perusing it.:D

As far as I can tell, you need to tell the loader what to do after booting. You can use the board in several different ways - it can run LINUX or operate without an OS running commands in a never ending loop.

First:
After power on the GESBC-9260 board, stop the U-boot auto-execution by press any key.
The LINUX FS is stored in ROM and must first be copied into RAM using these commands at the U-BOOT> prompt:
The net work address and server address must be set before network transfer can take place. The following commands will set the SBC IP address and server IP address,

set ipaddr xxx.xxx.xxx.xxx
set serverip xxx.xxx.xxx.xxx

The server IP is the IP address where a TFTP server must be run. To load Linux kernel type in the
following command,
t 0x22000000 uImage
The U-boot will load uImage file from the TFTP server whose IP address is specified by the serverip environment vairbale.(sic)
The NAND FLASH sectors must be erased first before new kernel image can be stored. The following command will erase the NAND FLASH sectors reserved for Linux kernel,

nand erase 0x100000 0x200000

The use the flowing command to store the kernel image from SDRAM to NAND FLASH,
nand write.jffs2 0x22000000 0x100000 0x200000

The following commands can be used to load root file system into the FLASH memory,

nand erase 0x400000 [available_nand_flash_memory_size]
t 0x21000000 rootfs.img
nand write.jffs2 0x21000000 x0400000 $(filesize)
Hope this is of some help, but the more details you can provide the more help you will get.:)

EDIT: There is a much better document at: https://www.glomationinc.com/info_ref.html
Which is called Linux 2.4 Kernel Startup procedure.
 
Last edited:
Yes, that would be the one. Thanks; I'll take a look at it so that when you come back with the results I'll have a clue (hopefully) of what is happening or not happening.:) :)

BTW I'm a tad envious of that sweet little piece of hardware. :p

EDIT: Those prices are incredible! They don't have ordering info on their page, where did you get yours, if I may ask?
 
Last edited:
I am a bit concerned with the step you have put below... This is suggesting i should remove the kernel from flash, why do i need to do this? I already have the kernel in the device and I can get it to boot up, but my problem is writing some code to run on the device e.g. flash an led by toggling an I/O pin. Should I be using a linux OS or can i write and compile my code in windows? Then the question is where in memory on the device do I put it? and how do i put it there? Sorry for these basic questions, I have no linux experience and little experience of this kind of thing except for basic PIC programming.

In answer to your question about ordering them, several of us ordered them via the university so I don't know it was done as there is no online ordering section. You could try contacting them and see what they say.

The LINUX FS is stored in ROM and must first be copied into RAM using these commands at the U-BOOT> prompt:
The net work address and server address must be set before network transfer can take place. The following commands will set the SBC IP address and server IP address,

set ipaddr xxx.xxx.xxx.xxx
set serverip xxx.xxx.xxx.xxx

The server IP is the IP address where a TFTP server must be run. To load Linux kernel type in the
following command,
t 0x22000000 uImage
The U-boot will load uImage file from the TFTP server whose IP address is specified by the serverip environment vairbale.(sic)
The NAND FLASH sectors must be erased first before new kernel image can be stored. The following command will erase the NAND FLASH sectors reserved for Linux kernel,

nand erase 0x100000 0x200000

The use the flowing command to store the kernel image from SDRAM to NAND FLASH,
nand write.jffs2 0x22000000 0x100000 0x200000

The following commands can be used to load root file system into the FLASH memory,

nand erase 0x400000 [available_nand_flash_memory_size]
t 0x21000000 rootfs.img
nand write.jffs2 0x21000000 x0400000 $(filesize)
 
OK, it is more clear what you wish to do. :) Let me go over those docs a while... You should be able to build the app on your desktop and cross compile for the LINUX kernal running on your board, then just run it as an executable under LINUX. I think you could also do this and run it without the OS, but it would be a totally different build.
I'll come back after reading a bit.... :)

I did think of contacting them by email, but at the moment I'm just dreaming of buying, :p
 
Hi Tom,
If you have the board up and running, and connected to a LAN, there is a very easy way to load your exe to the board and have it run. Go to https://www.glomationinc.com/info_ref.html and get
Getting started with the GESBC-9302 **broken link removed** by Paul Muller

From near the bottom of the page where it says 'user contributions.'

Turn to page 6 and read from 'Moving the File to The GESBC-9302.'

Actually the whole document is well written and should be quite helpful. Please keep me posted; if this will work for you then things are good. If not, then will try to find more help.
Robert

PS This is assuming you have telnet installed on your windoz box...

I think it would be much easier if you had Debian running on a desktop, however you should be able to do everything under winoz. Mr. Muller says that he installed Debian on a Pentium II machine (read old and very cheap to buy PC)
Installing Debian
Installing Debian Sarge is really quite easy. You download a stripped-down
installation version (about 50 Mbytes) that is burned onto a CD. You boot
your PC from this CD and the Debian install program detects all of the
peripherals on your PC and locates the available partitions in the hard drive. I
simply told Debian to occupy the last partition in the hard drive, and it installed
without incident.
 
Last edited:
Hi Robert
You are right about debian being easier. I installed cygwin on my windows pc, downloaded the cross compiler, compiled the .c file to a .out file and transferred to the SBC with a usb stick. The SBC cannot execute the binary .out file, which makes me think the cross compiler didn't compile into a format that the SBC will understand. I have now downloaded a debian .iso file, but am struggling to write this to disk with nero, I can't get debian to boot! it says there is no boot data present. Now going to try a different burning suite, will keep you posted with progress.
Tom
 
Hi Robert
...
compiled the .c file to a .out file and transferred to the SBC with a usb stick. The SBC cannot execute the binary .out file, which makes me think the cross compiler didn't compile into a format that the SBC will understand...
Tom

O.K. so just to verify - the source.c was a *known good* file? One of the test files which came in your package, perhaps? The reason I say this is that if we can eliminate variables, we can cut the time to success... Is it possible the source compiled but does not do what is expected (run time bugs?) If I recall my beginnings with other micros and the times my source did not initialize the chip properly... :p

How are your classmates making out with this project? You are talking to them, aren t you?

Some burning software is better than others. You usually have to tell the thing you want a boot disk...
 
hi, thanks for replying so quickly, the source is NOT a known good file, but it did have errors in to begin with and these flagged up as errors in cygwin. i then ironed these out and it compiled so i am sure the c file has no bugs in it. it is also only a simple hello world program, which was...

#include <stdio.h>
main ()
{
printf ("hello world!");
}

not sure about other classmates at minute as we are all at home for xmas break still and so i am not in contact with them at the minute, but i will be when i get back. will be interesting to see their progress.
 
Hi Tom,
Yes, simple enough, but what is it printing to? Do you have an LCD attached, or is standard out the serial port? The program may be running, but you won't know it if you can't see the output.

Could you just clarify this a bit for me:
The SBC cannot execute the binary .out file
How is it you know this? Was there any error message, or???

I think the old 'embedded hello world' - aka 'flash an LED' may be better here...

Ah, of course it is winter break; how on earth could I forget that one? :p

Also thought Martin Thomas's page may be of some interrest to you. He doesn't have any arm 9 projects, but lots of AT91SAM7 and lots for the Phillips LPC. What may be of interest though, are his notes on gcc and winarm...
**broken link removed**
 
it is printing to the serial port, i have a null modem cable connected to the sbc with a terminal program on my pc, the terminal receives every line of code that the sbc executes and in the .pdf you recommended to me the guy does exactly the same thing, but rather than hello world i get illegal operation. this answers your question of "how do you know this? was there an error message?" i will take a look at martin's projects. thanks for your help
 
success! managed to execute the file, it was all to do with the cross compiler. I have found a different one that is for cygwin especially and this did the trick. next step is to find the place i can put this file so that it executes on startup.
 
success! managed to execute the file, it was all to do with the cross compiler. I have found a different one that is for cygwin especially and this did the trick. next step is to find the place i can put this file so that it executes on startup.

Alright! You are on your way now. :)

Which compiler did you end up with then? I don't think the next steps will be as difficult as this one was. :)
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top