Begining with the CS - E9301

Hi everybody.

I’m an electronic engineer from Colombia, and now I’m beginning a project with the CS - E9301, and that is making me crazy because I don’t know where to begin. I’ll appreciate if you can help me.

I’ve read that I can program the board in C, C++ or Assembler, and I have installed the cygwin with the gcc libraries, the Eclipse and other programs, but I really don’t know where to begin. For example, I don’t know if I write my programs in Assembler, what programs I need to compile, to link, to debbug, and to program the board…I’m really lost…

Can anybody help me please?

PSDTA: My biggest problem is that I don’t use Linux and I don’t know anything about linux, so I need to program and compile over Windows XP, that’s why I installed cygwin.

Thanks.

Hello Dairo,

there are several ways how you could use your CS-EP9301. It comes with Linux and FreeBSD (or was it NetBSD?) preinstalled, so you just choose which one you want to use in the bootloader. Another possibility would be the use of eCos, which is also the base for the preinstalled bootloader Redboot. Of course it’s also possible to work with the CS-EP9301’s bare-metal, i.e. with no OS at all, doing everything on your own.

The most convenient solution is certainly the use of Linux (or *BSD, if you prefer). It allows you to use all functionality available on a desktop system, like I/O, memory management and debugging facilities. You could even develop large parts of your application on a Linux desktop, and only move to the target once you need access to real hardware (ADCs, SPI/I2C, etc.).

Of course, this requires knowledge about how Linux works, and if you’ve never worked with a Unix like system, you’re going to have a hard time.

If you need hard realtime, neither Linux nor *BSD are going to suit your needs, at least not in a base configuration. RT support in Linux is constantly improving, but the current mainline still doesn’t guarantee hard realtime as far as I know.

eCos is supposed to be a realtime operating system, but I haven’t used it myself for anything serious yet.

You’ll be able to use any programming language you want if you’re using Linux or *BSD. While eCos itself is free software, support for C++ libraries is only available in the commercial eCosPro offerings from ecoscentric.com. IIRC, C++ support for eCos is available freely, too, but you’ll have to search the net for this, and I don’t know how well it’s tested. Assembler is only going to be needed for very low-level stuff, like the initial parts of the bootloader, or hand-optimized code, where you believe that you’ll do better than a recent version of GCC (most likely, GCC is going to do better than you, if used correctly).

If this is a commercial project where you have access to a lot of resources (i.e. money), you might also want to look at the commercial offerings from companies like Windriver.com.

Best regards,

Dominic

Hello Dominic; :slight_smile:

Firstable I would like to thank you for your help, you can’t imagine how so useful it has been your

information, but I would like, if it doesn’t bother you, to ask some other questions. :oops:

My project is gonna be something like this: I want to connect a webcam to a Host USB port in the board,

so in that way I don’t need a PC to initialize the camera; then I’m gonna connect the board through the

Ethernet port to a network, to send the camera’s video through the network, and I’m gonna receive the

video in a remote PC (connected to the network), and I want to visualize the video in that PC; that’s the

first phase of my project.

So, my first doubt is, you told me that the most convenient solution is the use of Linux because in that

way I can use the functionality available on the S.O., but, if I do that, my application is gonna run if

I connect the board to a Windows based PC? :?:

Now, I have to be sincere, I don’t understand that about the preinstalled Linux or the pre-build images

ready to load with Redboot , Would you mind giving me some information about that?.

I mean, let’s say that I’m gonna program the board using the Linux preinstalled, how does that function?

I have my program in C++, and how can I store it into the board?

I’m very sorry of asking so much, but I really have tried to find some documents related with the board

and the use of it, and I haven’t found it yet, so the unique source of information about the board is

this, because I can read the pdfs about the chips, but to begin I need to know how to use the board.

:oops:

Thank you very much, thank you.

If you don’t want to write the driver for the webcam (documentation seems to be hard to get/impossible to get), you should stick with Linux - many webcams support linux.

There might be a problem if there are no open source drivers available for the USB webcam you choose. Some vendors offer binary drivers only, which wont run on an ARM machine, but I think it should be possible to find a USB webcam with freely available drivers for Linux.

You could put a small webserver on the CS-EP9301 that allows any client, no matter if it’s Linux or Windows, to receive data from the camera, so this shouldn’t be a problem.

I’ve deleted the bootloader and the linux that came with my CS-EP9301 as I didn’t like either of both, and I’m currently working on porting a different bootloader and installing a more recent version of Linux, so I can’t tell you what exactly you have to do in order to boot the preinstalled linux, but it was only one or two commands on the Redboot command line. Olimex should be able to tell you what the necessary Redboot commands are (I don’t use Redboot).

Once your linux system is running, you can connect to it via the serial port, log in, and work with it just like you work with any other remote linux machine (this is the part you’ll have to learn).

For development, I would export a filesystem from my desktop machine via NFS, and mount it on the embedded linux target. You compile the application on your host, and run it on your linux target just as if you mounted a remote windows share.

Once you’re done with writing your software, you’ll create a ramdisk image that includes both the stuff necessary for Linux to run and your application, write that to flash (using Redboot), configure Redboot to automatically boot Linux, and configure Linux to automatically run your application.

All of this is possible, and it has been done uncounted times, but you’ll definitely have to learn how Redboot and Linux work - you’re working on a more abstract platform than what you’d use if you programmed bare-metal (reading datasheets, figuring out how to program the registers), but you’ll have to learn how to use that platform.

Best regards,

Dominic

I’ll second Dominic.

To make your project in Linux will take few weeks if you know what you do and few months if you have no glue what you want to do.

Linux is famous that every problem solves with few line of code, but you lose month until you learn where these lines of code to be put :wink:

My advise - do your project on PC running Lunix, if you manage to do this then to run same on EP9301 will be matter of re-compilation of your sources for ARM and loading it in the EP9301, you even no need to buy the board before you finish your project.

With EP9301 you can do everything you can do on your desktop PC which run Linux.

Best regards

Tsvetan

Hi People,

I just have got my board CS E9301, and I’m doing my first tests, but I’m having a problem when I try to read a USB memory.

I have tried to mount the memory with commands like this:

mount -t vfat /dev/sdXX /mnt/usb

o

mount -t usbfs /dev/sdXX /mnt/usb

and I have tried with every possible sda and sdb, but nothing.

And the system is recognizing the memory, because it shows the next message when I plug in the memory:

usb 1-3: new full speed USB device using address 2

scsi0 : SCSI emulation for USB Mass Storage devices

Using anticipatory io scheduler

Vendor: Model: Rev:

Type: Direct-Access ANSI SCSI revision: 02

SCSI device sda: 2000609 512-byte hdwr sectors (1024 MB)

sda: assuming Write Enabled

sda: assuming drive cache: write through

sda: unknown partition table

Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type 0

Can anybody help me?

Thanks.

Regrets,

Ing. Dairo Ortiz.

Bogotá, Colombia.

Dairo,

Did you ever get a solution to this problem? I’m facing this issue myself.

I’m still running the 2.6.8.1-crus2.0.2 that came installed.

The usb code recognizes it, and fdisk shows a partition on /dev/sda1.

However it will not mount:

~ # mount -t msdos /dev/sda1 /media

mount: Mounting /dev/sda1 on /media failed: No such device

I even tried to run the netbsd that comes on the CD, but the file is

unreadable for some reason.

Things are going really great.

John

Linux will recognize when a USB drive is connected. Before you can mount it you have to create a file system on it. Do a man on mkfs.

It has a filesystem on it, and files. I can mount it on my desktop machine and it works fine.

Yet on the 9302 board I am using, it is recognized as a usb device, and fdisk shows that it has a partition on it, but it will not mount.

Has anybody gotten this to work??

To get USB drives to work with the default kernel do this:

Back up the drive contents

Make sure the backup is ok - you WILL lose all data on it

plug it into the development board

run the following

mke2fs /dev/sda

It warns you about creating one partition on the whole drive - do it anyway

You should now be able to mount the drive as follows:

mount /dev/sda /mnt

Works fine for me. Cool piece of kit