RT2880 SDK Programming Guide

Q1. HOW TO ADD NEW USER APPLICATION

(a) Edit RT288x_SDK/source/config/config.in

    mainmenu_option next_comment
    comment 'XXX Add-on Applications'
    bool 'hello_world'                 CONFIG_USER_HELLO_WORLD
    endmenu

(b) Edit RT288x_SDK/source/user/Makefile

    dir_$(CONFIG_USER_HELLO_WORLD)     += hello

(c) Create hello directory in RT288x_SDK/source/user

(d) Add Makefile to RT288x_SDK/source/user/hello
   
    EXEC = hello
    OBJS = hello.o
    CFLAGS +=

    all: $(EXEC)
    $(EXEC): $(OBJS)
            $(CC) $(LDFLAGS) -o $@ $(OBJS)
    romfs:
           $(ROMFSINST) /bin/$(EXEC)
    clean:
           -rm -f $(EXEC) *.elf *.gdb *.o

(e) Add hello.c to RT288x_SDK/source/user/hello

   main()
   {
        printf("hello world\n");
   }

(f) Execute "make menuconfig" and turn on hello_world item

   Kernel/Library/Defaults Selection -> 
   Customize Vendor/User Settings ->
   XXX Add-on Applications  ---> [*] hello_world (NEW)

(g) build new image

   #make dep
   #make

(h) Check compile result

   #cd RT288x_SDK/source/romfs/bin
   #file hello
   #hello: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), 
           dynamically linked (uses shared libs), stripped

(i) Test on demo board

   BusyBox v1.4.2 (2007-05-04 11:15:35 CST) Built-in shell (ash)
   Enter 'help' for a list of built-in commands.

  / # 
  / # hello
  hello world
  / # 


-----------------------------

Q2: HOW TO EXECUTE COMMAND AT BOOTUP TIME?

(a) Edit RT288x_SDK/source/vendors/Ralink/RT2880-IC+/rcS
   
   #!/bin/sh
   mount -a
   goahead& <-- add new command here

----------------------------

Q3: HOW TO ADD FILE IN RAMDISK?

    If you execute "make clean", script will delete RT288x_SDK/source/romfs directory.
    You can't copy file to RT288x_SDK/source/romfs manually because it will disappear
    after executing "make clean".

(a) copy xxx.bin to RT288x_SDK/source/vendors/Ralink/RT2880-IC+

(b) edit RT288x_SDK/source/vendors/Ralink/RT2880-IC+/Makefile

   romfs:
        $(ROMFSINST) /etc_ro/xxx.bin

   Script will copy xxx.bin to RT288x_SDK/source/romfs/etc_ro after executing "make romfs"

----------------------------

Q4: HOW TO SUPPORT NEW PLATFORM?

    Different products use different kernel & application setting. RT2880 SDK can easily 
    support new platform.

    Example: If you need to support a new product 802.11n AP with 5 ports gigabit switch, 
             please perform the following steps.
	    
	     Notes: New product use vitesse Gigabit switch instead of IC+.

(a) Create new product working directory

    #cd RT288x_SDK/source/vendors/Ralink
    #cp -r RT2880-IC+ RT2880-VITESSE 

(b) Add/remove file in RT288x_SDK/source/vendors/Ralink/RT2880-VITESSE

    Example: If Vitesse platform need xxx.bin in /etc_ro

    #cp xxx.bin RT288x_SDK/source/vendors/Ralink/RT2880-VITESSE     
    #vi RT288x_SDK/source/vendors/Ralink/RT2880-VITESSE/Makefile

    romfs:
        $(ROMFSINST) /etc_ro/xxx.bin
    
(c) Change Kernel/User Setting (Ex: turn on Vitesse driver)

   #make menuconfig

   Select the Product you wish to target  ---> 
   ( ) RT2880-FPGA                         
   ( ) RT2880-IC+
   ( ) RT2880-MARVELL  
   (X) RT2880-VITESSE 
   
   Kernel/Library/Defaults Selection  --->
   [*] Customize Kernel Settings

(d) Update default settings 

   Kernel/Library/Defaults Selection  --->
   [*] Update Default Vendor Settings

   New setting will be save to RT288x_SDK/source/vendors/Ralink/RT2880-VITESSE
 
  -config.busybox: busybox configuration
  -config.linux-2.4.x: linux kenrel configuration
  -config.vendor: user application configuration


-----------------------------
Updated by Steven Liu on 2007.05.03
