How to make applications on UCOS2..???

Hussain Aftab
Hi,

I am using mini2440 can anyone please tell me how to 
make and run my own application on UCOS2.

I have loaded the image provided in the mini2440 cd in the folder Ucos2
it works fine but it after loading the image it only shows an
image on the screen and some messages on COM port..

Thanx in advance

Regards
Hussain Aftab

Mike Bailey
I haven't got any further with uCOS other than loading the image either.
However, the top level uCOS source directory has a .mcp file in it and I
believe that this is an ADS project file. So it looks like you need to
install ADS1.2 (also on the DVD) to set up and compile your own projects.
I am assuming that you have the andahammer DVD or similar.

Hussain Aftab
Thanx for the reply..

I have installed ADS1.2 and loaded the .mcp file
I also edited the file "main.c" 
in which i defined my own task in which i print some text on 
the lcd and serial port..

what i need to know is how to control GPIO..??

Mike Bailey
I've installed ADS1.2 now to have a play with uCOS. It's a lot more fun
than this Linux and CE stuff. Well that's my view anyway!

Regarding the GPIO. You can switch the LEDS on and off by writing to bits
5-8 in rGPBDAT. RGPCON is already set to outputs for GPB0-GPB10 in
TargetInit(). All the addresses are defined in 2440addr.h.
There is some code at the end of Task1 that seems to be flashing the LEDS
to help you ...

     //led 
     if(TestCnt%2)
       rGPBDAT = 0x0000;
     else
      rGPBDAT = 0x07fe;

Not sure why they are writing to other bits in PORTB ???

The switches can be handled in a similar way through PORT G but beware that
this port is also used to control outputs such as the LCD power on GPG4.
You can read the switches using rGPGDAT and appropriate masks for the bits.
rGPGCON is also set in TargetInit().

Hope this helps.

Hussain Aftab
Hi

Thanx Mike it does helps..

Do you know how to use any USB device in Ucos2.
I mean i can't see any file related to USB..

Mike Bailey
I mananged to get the LEDS to light individually and I also added a line to
read the switches in Task 1 and display them on the console.

I haven't seen any driver for the USB or the SD Card in the uCOSII sources.
The board support in uCOSII seems quite poor. I was considering using code
from the supervivi and Linux sources and building a decent library - but
that's going to take quite a while! 

I have been downloading the code to the NAND using the supervivi 'a'
[Absolute User Application] command which is a bit of pain with all the
NOR/NAND and ON/OFF switching just to test a one line change. Not good for
the NAND Flash either! Has anyone managed to set ADS to link a binary to
load and run in RAM and what supervivi command do you use? I presume that I
need to use the 'load ram' command line or is that what 'Download & Run'
does ? Any help appreciated.

Mike Bailey
Looking through the andahammer DVD I've found some useful code. The source
directories for 2440test has code to drive the SD card and the source
directories for the open source bootloader (YL2440A_MON) has code to drive
the USB. Lots of useful stuff on the DVD - and on this site too.

bullt
Hi,

I program which ADS, and need acces in the SD card.

I don't know "I was considering using code
from the supervivi and Linux sources and building a decent library - but
that's going to take quite a while! "

Help mi please.