ARM development experience! (Suitable for beginners)

Publisher:AningmengLatest update time:2015-03-16 Source: laoguKeywords:arm Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
I did some development for arm some time ago, mainly writing the startup software for arm and porting uCOS-II to arm7. I like to do things in a simple way, and make a framework from the simplest and most basic aspects, and then supplement it in this framework. I am also a person who likes to discuss with others, and I hope someone can give me opinions and suggestions. My experience is very elementary, just some basic things. Now I share it with you, hoping to leave some memories for you before I graduate. ^_^ 

    Since these things are really worthless to publish in a paper, but I feel that they can serve as an introduction to ARM development. Due to my limited level and experience, mistakes are inevitable. But if I don't share them with you, I won't be able to find them even if there are mistakes, right? Haha. I will try to publish the first article in the series now to see how valuable it is. If you think it is valuable, I will continue to serialize. 
Series 1: 
Preface 
This document is a summary and experience of my study of ARM programming. People who read this document should first read the help documents and related content of ADS1.2. This document will not make a detailed description of the compiler and connector, and will point out the specific content in the chapter of the relevant materials when necessary. At the same time, people who read this document need to understand the ARM instruction set and some basic content of ARM assembly as well as related programming content of C and C++. At the same time, you also need to understand the pipeline structure of ARM and some basic programming knowledge. At the same time, in order to facilitate the reference of English documents, all relevant terms are in the original English.

Chapter 1 STARTU
1 ARM startup 
Before the main program is executed, general embedded systems need to perform some initialization processes to create an environment for embedded program operation, especially some advanced embedded systems. Because the core chip uses memory mapping, memory protection and other mechanisms, and the programming uses high-level languages ​​​​C, C++ and even JAVA, it is necessary to first create a hardware environment suitable for program operation, and then initialize or configure or trim the run-time library. These tasks must be completed before the main program is run, so a startup program or program group is very important for an embedded system. To write a startup program, you need to have a certain understanding of the details of the compiler, linker and assembler, and you also need to have some understanding of the address allocation and memory mapping mechanism of the ARM chip hardware itself. 
2 The working process of the ARM program 
is first compiled from various source files to generate object files, and then the object files are linked to generate Image files, and then downloaded to the specified address of the solid-state memory on the target board, such as flash, EEPROM, ROM, etc., according to the description file. Before the program is executed, according to certain description files, the part of the data that needs to be read and written is read out and placed in the dynamic memory such as RAM, and then the program starts to execute from ROM. Or sometimes, in order to improve the running speed of the program, all programs (except for some root parts, which will be mentioned later) can be placed in the specified RAM through a description file, and then the program will start to execute from the RAM, but this will consume a lot of dynamic memory, so most programs will take a compromise method, putting the parts that need to run quickly and the parts that need to be read and written into the RAM (generally, the process of reading solid-state memory is the same as the process of dynamic memory, but writing is different, so the read-write part must be placed in the RAM), and the read-only part and the part that does not require such high speed into the solid-state memory. At the same time, the exception vector table of the ARM structure is stipulated to be placed in the address space starting at address 0x00000000, and the general CPU will remap this vector segment to other RAM in order to improve the exception response speed, so the address of the exception vector jump program must be accurately specified in the description file to the remap location. Before the application program is executed, some files are also needed to describe the environment in which the application program is executed. For example, the system working clock and bus frequency. The general embedded programming languages ​​now are C, C++, etc. If the runtime-library is used when using them, then the heap needs to be initialized for these library functions before the program is executed. Then ARM may work in different modes, and it is necessary to set up the stack for different working modes. In this way, the file that describes the link address and all the initialization programs before the application runs are the startup program group 
3 STARTUP classification 
In this way, the functions performed by the startup program are classified. One type is the link address description, and the other type is various initialization programs. Depending on the application, the content, structure and complexity of the description file and the initialization program will be different. But basically, they must all implement the following functions. 
3.1 Description file implementation function 
The description file can be a simple few characters on the link command line, or it can be a very complex file, but it must complete the following functions: 
; Specify the address for program download 
; Specify the address for program execution 
3.2 Initialization program implementation function 
The initialization program has different structures and complexities depending on the application, but it must complete the following basic functions: 
; Exception vector initialization 
; Memory environment initialization 
; Other hardware environment initialization

Keywords:arm Reference address:ARM development experience! (Suitable for beginners)

Previous article:ARM development experience! (Part 2)
Next article:Interrupt control of 44b0X

Recommended ReadingLatest update time:2024-11-23 08:08

Implementation of network remote monitoring of embedded Boa server based on ARM9 processor
As high-tech technology is gradually integrated into traditional agricultural and sideline industries, greenhouse cultivation has become a way to produce off-season crops. This paper introduces the design of a greenhouse monitoring and control system based on the S3C2410 processor, and designs a network remote monitor
[Microcontroller]
Implementation of network remote monitoring of embedded Boa server based on ARM9 processor
The first bare metal ARM program
1. Check the schematic diagram and data sheet to set the IO port function Tip: The chip used here is Samsung's S3C2440A 1.1.LED1 is connected to the IO port of GPF4. From the schematic diagram, it can be seen that the LED light is lit by low level. 1.2 Check the data sheet and configure the registers Register De
[Microcontroller]
The first bare metal ARM program
Embedded System Architecture - ARM Processor 
ARM was founded in Cambridge, UK in 1991, mainly selling licenses for chip design technology. At present, processors using ARM technology intellectual property (IP) cores, commonly known as ARM processors, have spread across various product markets such as industrial control, consumer electronics, communication system
[Microcontroller]
Embedded System Architecture - ARM Processor 
Regarding μClinux transplantation issues on ARM7 S3C4510B
Linux is an operating system that supports processors of multiple architectures and has strong portability. Describes the method and process of porting μClinux to a target board based on the S3C4510B processor. First, it introduces the S3C4510B processor and μClinux, and briefly explains how to build a transplantation
[Microcontroller]
Regarding μClinux transplantation issues on ARM7 S3C4510B
Cross-compile Python-2.7.13 to ARM (aarch32) platform
environment Host: ubuntu14.04 64bit Development board: qemu + vexpress-a9 (reference: http://www.cnblogs.com/pengdonglin137/p/6442583.html) Toolchain: arm-none-linux-gnueabi-gcc (gcc version 4.8.3 20140320) Python version: Python-2.7.13 Go to top reference http://www.41443.com/HTML/Python/20151105/414154.html
[Microcontroller]
ARMLinux s3c2440 UART Analysis 2
Software (linux-2.6.30.4): The serial port driver of the Linux system is different from the general character device. It adopts a hierarchical architecture and is implemented as a serial system. (1) Focus on the low-level drivers of UART or other low-level serial hardware features. (2) TTY driver that interfaces w
[Microcontroller]
ARMLinux s3c2440 UART Analysis 2
ARM(44b0) beginner summary (reprinted)
My development board is s3c44b0x, 2m NOR FLASH is in bank0, 8m sdram is in bank6. First, let's look at the problem we are going to solve. Some ARM chips have built-in RAM and FALSH. This allows the program to be run directly on the chip. The 44B0X chip only has a few K caches, and both ROM and RAM are external chips. O
[Microcontroller]
Preliminary creation of makefile, detailed explanation of arm-linux- (gcc/ld/objcopy/objdump)
Enter vi Makefile in linux to create a Makefile file Note: You must add the TAB key before the command line For example: assemble two files led.c and crt0.S to create a Makefile 1 1 led.bin : crt0.S led.c 2 2 arm-linux-gcc -c -o crt0.o crt0.c 3 3 arm-linux-gcc -c -o led.o l
[Microcontroller]
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号