【Development Environment Construction】
1. Development environment construction: operating system or virtual machine Ubuntu installation, network service configuration, Tool installation, etc.
Tool resources :
https://pan.baidu.com/s/1bpakJtP
// env/embedded linux software development environment (updated from time to time)
Steps to organize :
http://blog.csdn.net/sinat_36184075/article/details/71194832
2. Programming basics: cross-compilation usage, Makefile rules, common assembly instructions
Cross-compilation tool chain production :
http://blog.csdn.net/sinat_36184075/article/details/71195114
Makefile writing :
http://blog.csdn.net/sinat_36184075/article/details/54917518
Quick query of assembly instructions :
http://blog.csdn.net/sinat_36184075/article/details/55819869
3. Commonly used tools:
The use of tools under windows (SourceInsight, SecureCRT, keil, IAR, etc.)
The use of tools under linux (tftp, nfs, vi, man manual, basic command line command and grep/find/tar/diff/patch, etc.)
// The common tools are easy to use and can be checked by yourself.
[ARM9 Embedded System Foundation]
1.
GPIO interface
1) Embedded development steps:
Programming: mainly .c .h files;
Compile: The make command invokes the cross-compilation rules written in the Makefile to compile .bin binary file;
Programming: PC parallel port and JTAG connection or PC USB and serial port connection, use the corresponding Tools and commands for programming;
Run the test: Command to run or reset the development board to observe the running effect.
2) How to control hardware through GPIO pins:
There are 3 kinds of operations for a single pin: output high and low levels, detect pin status , Interrupt;
The operation of a pin is realized by reading and writing registers;
Method of reading and writing registers: through programming, read and write the addresses of registers;
// 2 points need to be combined: target board circuit diagram (determining pins), ARM chip manual Datasheet (operation instructions)
<brules, the corresponding .ko driver module file can be generated.
Driver Test (Page409).
2. Exception Handling Architecture
1) Linux Exception Handling Architecture
in init/main.c The kernel calls trap_init and init_IRQ two functions in the start_kernel function to set the exception handling function.
The trap_init() function (arch/arm/kernel/traps.c) is used to set various exception handling vectors, including interrupt vectors.
The init_IRQ() function (arch/arm/kernel/irq.c) is used to initialize the interrupt processing framework and set the default processing functions for various interrupts. When an interrupt occurs, the interrupt general entry function asm_do_IRQ can call these functions for further processing.
There are 5 types of common exceptions: undefined instruction exception, instruction prefetch abort exception, data access abort exception, interrupt exception, and swi exception.
2) Interrupt processing architecture and important data structures
The linux kernel numbers all interrupts uniformly, and uses a structure array to describe these interrupts: struct irq_desc {…}
Among them, the structure member handle_irq It is the entry point of the handler function for this or this group of interrupts.
3) Process of registering, processing, and unloading interrupt handlers
Initialize interrupt handler architecture function: init_IRQ (void);
User register interrupt handler function with kernel: request_irq (…);
C language general entry function for interrupt: asm_do_IRQ (…);
Function for user to log out of interrupt handler from kernel: free_irq (…);
4) Method of using interrupt in driver program
An example of key driver using interrupt mode.
3. Extended serial port driver porting
1) Hierarchical structure of serial port terminal device driver
Serial port driver The program is divided into 4 layers from top to bottom: terminal equipment layer, line procedures, serial port abstraction layer, serial port chip layer, (hardware).
2) Method of transplanting standard serial port driver (Page438)