สิ่งที่เกี่ยวข้อง

วันจันทร์ที่ ๓ ธันวาคม พ.ศ. ๒๕๕๐

ตัวอย่างการพัฒนาสำหรับ uCLinux

ตัวอย่างนี้จะแสดงถึงวิธีการพัฒนาเบื้องต้น
โดยจะใช้ arm-elf-gcc ในการ Compile

การติดตั้ง arm-efl-gcc สำหรับ uClinux
  1. Download ตัวติดตั้งได้เช่นกัน ที่ ucLinux ARM cross compiler
  2. จากนั้นเลือก Binary ไฟล์ (นามสกุล .sh) มายังเครื่องแล้วทำตามขั้นตอนดังนี้
    1. [_shell_] chmod a+x arm-elf-tools-xxxxxxxx.sh
    2. [_shell_] sudo ./arm-elf-tools-xxxxxxxx.sh (กรณีทดลองบน Ubuntu)
ตัวอย่างการพัฒนา
  1. Coding ไฟล์ตัวอย่าง hello.c
  2.    #include <stdio.h>

    int main(void) {
    printf("Hello, embedded linux!\n");
    return 0;
    }

  3. Compile ด้วย arm-elf-gcc แล้วเราจะได้ Binary ไฟล์ที่พร้อมทำงานบน Embedded Linux
  4. $>arm-elf-gcc -Wl,-elf2flt -o hello hello.c
Powered by ScribeFire.

ไม่มีความคิดเห็น:

ผู้สนับสนุน

จัดตามกลุ่ม