Beruflich Dokumente
Kultur Dokumente
br
ss
Outline
Embedded System Basics Embedded HW/SW Development Processes Bootloader and Board Support Package
br
ss
Embedded system
Embedded systems are computing systems with tightly coupled hardware and software integration Are designed to perform a dedicated function The word embedded reflects the fact that these systems are usually an integral part of a larger system, known as the embedding system
Broadband Radio Access Software & System Lab.
br
ss
Network Devices
br
ss
Application specific
MMU, FPU, VM, cache,
Size
Pentium vs. ARM
Power consumption
Intel Pentium vs. ARM
Price
x386 vs. StrongARM
Broadband Radio Access Software & System Lab.
br
ss
S/W
br
ss
H/W H/W H/W Low level design implementation testing Product SW/HW High level design & Specification Partition Iteration Product release H/W & SW integration testing System & maintenance
br
ss
Hardware
Microprocessor-based vs. Microcontroller-based
Memory
Data storage
Memory
Data storage
I/O
I/O
Timer
I/O
Timer
I/O
br
ss
PC architecture
br
ss
Embedded Processor
br
ss
Embedded Processor
Embedded Processor
br
ss
Hardware
ARM example
br
ss
Hardware
ARM example
br
ss
Source : www.ti.com/omap2
br
ss
Embedded Processor
br
ss
Embedded Processor
br
ss
Embedded Processor
ASIC
Application-Specific Integrated Circuit a chip designed for a particular application (as opposed to the integrated circuits that control functions such as RAM in a PC). ASICs are built by connecting existing circuit building blocks in new ways. Since the building blocks already exist in a library, it is much easier to produce a new ASIC than to design a new chip from scratch.
Broadband Radio Access Software & System Lab.
br
ss
Embedded Processor
br
ss
Embedded Processor
br
ss
br
ss
Source : www.arm.com
Source : www.arm.com
br
ss
Network processor
br
ss
Network processor
br
ss
AMBA
br
ss
AMBA architecture
ARM core/CPU on-chip RAM test i/f ctrl
DMA controller
br
ss
master 2
slave 2
master 3
read data
slave 3
decoder
br
ss
br
ss
br
ss
JTAG
TMS TDI
TDO
br
ss
JTAG organization
I/O core logic
in enable
in
enable de vice ID reg bypass reg TMS TCK TRST TAP controller instruction reg
out
TDI
TDO
br
ss
TMS = 1
run test/idle
TMS = 0
select DR scan
TMS = 0
select IR scan
TMS = 0
TMS = 1
TMS = 1
capture DR
TMS = 0
capture IR
TMS = 0
shift DR
TMS = 1 TMS = 0 TMS = 1 TMS = 1
shift IR
TMS = 0 TMS = 1
exit1 DR
TMS = 0
exit1 IR
TMS = 0
pause DR
TMS = 1 TMS = 0 TMS = 1
pause IR
TMS = 0
TMS = 0
exit2 DR
TMS = 1
TMS = 0
exit2 IR
TMS = 1
up date DR
TMS = 1 TMS = 0
up date IR
TMS = 1 TMS = 0
br
ss
DRAM control
ARM macrocell
TAP
video macrocell
cu stom logic
br
ss
Put on target
program
br
ss
ICE/JTAG interface
Source : http://www.keil.com/ulink/
br
ss
ICE/JTAG interface
Source : www.arm.com
br
ss
ICE/JTAG interface
Source : www.arm.com
br
ss
br
ss
Embedded Software
Embedded Applications
Middleware Application
Broadband Radio Access Software & System Lab.
br
ss
Console mode
GNU toolchain
gcc : a cross-compiler binutils : a set of tools for manipulating binaries glibc : c-lib gdb : debugger (ICE is required)
IDE
ADS GNUPro
Broadband Radio Access Software & System Lab.
br
ss
Source : www.arm.com
br
ss
Source : www.arm.com
br
ss
Software
Boot loader, driver, OS, protocol stacks, applications are all programs
SW development and execution examples
Interpreter/ Compiler/ Assembler/ linker Executable code Source code H/D RAM Flash ROM I/O I/O I/O
CPU
memory
Libs.
br
ss
Embedded software
Drivers + control programs (8051 examples) O.S + drivers + applications (x86 examples) Bootloader + OS. + applications
br
ss
Make utility
br
ss
Flash
RAM
Flash
ROM RAM
ROM
loader Flash memory programmer
Flash
program
RAM
Put on target
program
br
ss
br
ss
From
br
ss
br
ss
br
ss
br ss execute from ROM while using RAM for data Broadband Radio Access Software & System Lab.
Source: Qing Li real-time concepts for embedded system
br
ss
br ss execute from RAM after being downloaded from a host system Broadband Radio Access Software & System Lab.
Source: Qing Li real-time concepts for embedded system
br
ss
br
ss
Bootloader
Bootstrap flow
br
ss
Bootloader
What is a bootloader ?
The first program being executed by the processor
Bootloaders functions
Initialize the hardware setting Basic monitor and debugger Pass the control to OS
br
ss
Bootloader
Bootloader
br
ss
Bootloader
Flash Memory/PROM
2. re-map the memory or move bootloader to RAM 4. Pass the control to the executable
CPU
RAM
3. Load executable image
br
ss
BIOS
Basic Input and Output System Firmware For Intel boot architecture
Old but backward compatible
Functions include
H/W initialization and parameter configurations Device drivers Debuggers/monitor Load OS/another bootloader
Broadband Radio Access Software & System Lab.
br
ss
BIOS
TSR/ISR
3. TSR/ISR 5. Pass control to OS
BIOS/PROM
CPU
RAM
Disk
br
ss
Loader
Normally a user level program Might use OS system services to access the storage and control the memory allocation Load and interpret executable files to memory and ask OS to run it
br
ss
Loader
OS loader
3. Load run time lib 4. Pass the control to the program or fork process
CPU
RAM
Program A
Disk
1. Locate the file in H/D or other storage 2. Parse the executable file
br
ss
bootloader
2. POST
BIOS
CPU
3. Select boot device
RAM
Disk
MBR
br
ss
2. POST
BIOS
CPU
3. Select boot device
0x90000
9. Pass control to setup.s
floppy
br
ss
iBoot
br
ss
iBoot
int c_main(void) { ~ //init all the devices we need. init_status(); //init_serial(SERIAL_BAUD_115200); init_serial(SERIAL_BAUD_38400); ~ itc_printf("\r\n" "**************************************************\r\n" "** Intrinsyc Bootloader (IBoot) **\r\n" ~ init_flash(); init_crc_table(); init_timer(); inc_led(); ~ if (!init_i2c ()) { itc_printf("ERROR: There is a problem initializing I2C Controller\r\n"); br ss } Broadband Radio Access Software & System Lab. ...
iBoot
... #ifdef SMSC91C111_ETHERNET if (!init_eeprom ()) { itc_printf("ERROR: There is a problem initializing the EEPROM\r\n"); } #endif ~ init_ethernet(status.macaddr); // Seed the random number generator with as much entropy as we have srand(get_time_timer() ^ ((status.macaddr[2] << 16) | status.macaddr[1])); //Bring up the user interface. This will return on a timeout or through user //direction. This will not return if the user tells us to boot. init_ui(UI_TIMEOUT, mode_default); inc_led(); init_os(); return 0; }
br
ss
Blob
br
ss
Blob (Cont.)
int main(void) { ~ led_on(); ~ SerialInit(baud9k6); TimerInit(); ~ SerialOutputString(PACKAGE " version " VERSION "\n" "Copyright (C) 1999 2000 2001 " ~ get_memory_map(); ~ Reload("blob"); Reload("kernel"); Reload("ramdisk"); ~ SerialOutputString("Running from "); if(RunningFromInternal()) SerialOutputString("internal"); else SerialOutputString("external"); ...
br
ss
Blob (Cont.)
... /* wait 10 seconds before starting autoboot */ SerialOutputString("Autoboot in progress, press any key to stop "); for(i = 0; i < 10; i++) { SerialOutputByte('.'); retval = SerialInputBlock(commandline, 1, 1); ~ if(retval == 0) { ~ boot_linux(commandline); } ~ for(;;) { ~ if(numRead > 0) { if(MyStrNCmp(commandline, "boot", 4) == 0) { boot_linux(commandline + 4); } else if(MyStrNCmp(commandline, "clock", 5) == 0) { SetClock(commandline + 5); } else if(MyStrNCmp(commandline, "download ", 9) == 0) { ~ return 0; } /* main */
br
ss
BSP
A collection of device initialization and control routines specific to a particular type of board or collection of boards The BSP (Board Support Package) is the set of files that can be customized to run operating system on specific board architectures The BSP contains the boot and the generic and processor specific drivers required for your board
Broadband Radio Access Software & System Lab.
br
ss
BSP
BSP components
BSP
OEM Adaptation Layer Bootloader INF files Device drivers Device drivers Device drivers
Evaluation Board br ss
BSP example
br
ss
BSP example
br
ss
BSP example
br
ss
BSP example
br
ss
br
ss
Kernel.o
Decompress
Initrd (ramdisk.gz)
br
ss
Kernel.o
Initrd (ramdisk.gz)
setup_arch() setup_processor() setup_architecture() init_bootmem_node() free_bootmem() paging_init(), trap_init() init_IRQ() sched_init() softirq_init() time_init(); console_init() init_modules() kmem_cache_init(), mem_init(), mount initrd (maybe) cpu_idle();
br
ss
Initrd (ramdisk.gz)
kernel
flash
br
ss
RAM
9. Clear up memory
Head.S Misc.o
Head.S Misc.o
8. Drive new device Or file system and Kernel.o Replace root FS 6. Execute /initrc
Initrd (ramdisk.gz)
kernel
flash
br
ss
RAM
Why Schedule
CPU
FS processing I/O request processing
read()
Issue I/O request to devic Wait for response Receive I/O response FS processing
My program
Broadband Radio Access Software & System Lab.
br
ss
read()
My program A
My program B
Broadband Radio Access Software & System Lab.
br
ss
CPU
read()
My program A
My program B
Broadband Radio Access Software & System Lab.
br
ss
CPU
2 TCB A
Context switch
3 1 read()
TCB B 4
My program A
My program B
Broadband Radio Access Software & System Lab.
br
ss
CPU
PC INT
Scheduler PCB Table Program A Kernel Space Program B Systemcall handler System Call Service Routine XXX
PCB For A PCB For B
Timer
br
ss
Mouse
Programmable IO Controller
Memory
br
ss
User program A
CPU
PC
0x01FF 0x02FF 0x0543 0x1234 ISR #0: for mouse RETI ISR #1
br
ss
Systemcall handler X1: 0x01FF Kernel Space X2: 0x02FF X3: 0x0543 X4: 0x1234
RETI
0x02FF
br
ss
H/D
INT
CPU
PC INT
Scheduler PCB Table Program A Kernel Space Program B Interrupt handler ISR XXX
PCB For A PCB For B
Timer
Request queue
Broadband Radio Access Software & System Lab.
br
ss
INT
CPU
PC INT
Scheduler PCB Table Program A Kernel Space Program B File System ISR XXX
PCB For A PCB For B
Timer
Request queue
Request queue
Broadband Radio Access Software & System Lab.
br
ss
Configurability Customization Size Power consumption Real-time characteristics I/O intensive Special purpose
Broadband Radio Access Software & System Lab.
br
ss
Questions ?
br
ss