[ARM bare metal program][1] ARM bare metal program development environment construction

Publisher:温柔阳光Latest update time:2022-04-22 Source: eefocusKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

[1] Environment Construction

Install the cross-compilation toolchain (arm-linux-gcc4.4.3)

See Bolg for details.


Cross-compilation basics

arm-linux-gcc common commands

1. Check the search path of header files and library files:


arm-linux-gcc -print-libgcc-file-name


2.arm-linux-gcc common commands


arm-linux-gcc -g -c led.S

//-c is for assembly-only operation -g adds debugging information

arm-linux-ld -Tled.lds -o led.elf led.o

//Perform link operation

arm-linux-readelf -a led.elf

//View the elf file header information

arm-linux-objdump -D -S led.elf

//Perform disassembly operations

arm-linux-objcopy -O binary led.elf led.bin

//Convert to binary file


Makefile Basics

basic structure

target: prerequisites

    command


Using variables

- Definition: obj=func1.o func2.o

- Use: $(obj)


Special variables

- $^: represents all dependent files

- $@: represents the target

- $< : represents the first dependent file


General rules (examples)

%.o : %.c

    arm-linux-gcc -o %@ -g -c %^


Linker script

SECTIONS {

        . = 0x30008000;

        . = ALGN(4);

        .text :

        {

            start.o(.text)

            *(.text)

        }

        . = ALGN(4);

        .data :

        {

            *(.data)

        }

        bss_start=.

        . = ALGN(4);

        .bss :

        {

            *(.bss)

        }


}


Set the starting link address

. = 0x30008000;


Set 4-byte alignment

. = ALGN(4);


Using variables

bss_start=.


Code snippet header file

start.o(.text)

*(.text)


Eclipse Integrated Development Environment

- arm-linux-gcc

- arm-linux-gdb

- JLink_Linux

- eclipse


Note: Environment variables are configured in /etc/profile.


Keywords:ARM Reference address:[ARM bare metal program][1] ARM bare metal program development environment construction

Previous article:[ARM bare metal program][8]ARM processor startup process (S3C2440)
Next article:[ARM bare metal program][2] TQ2440, ADS1.2, JLINK to establish an integrated development environment

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号