Net+OS Initialization Initialization Sequence Initialization Routine Roles ROM Image Compression/Decompression.

Slides:



Advertisements
Similar presentations
1/1/ / faculty of Electrical Engineering eindhoven university of technology Memory Management and Protection Part 3:Virtual memory, mode switching,
Advertisements

Lab III Real-Time Embedded Operating System for a SoC System.
Exceptions. Exception Types Exception Handling Vectoring Interrupts Interrupt Handlers Interrupt Priorities Interrupt applications 6-2.
MC68HC11 System Overview. System block diagram (A8 version)
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
External Interrupt Module MTT EXTERNAL INTERRUPT REQUEST MODULE (IRQ)
68HC11 Polling and Interrupts
SAM9263-EK RevB WinCE 6.0 DEMO (All-in-NAND) AT91 SAM9 Product Group. Version 1.1 May 2008.
ECE 372 – Microcontroller Design Parallel IO Ports - Interrupts
Interrupts What is an interrupt? What does an interrupt do to the “flow of control” Interrupts used to overlap computation & I/O – Examples would be console.
6-1 I/O Methods I/O – Transfer of data between memory of the system and the I/O device Most devices operate asynchronously from the CPU Most methods involve.
EET 450 Chapter 2 – How hardware and Software Work Together.
System initialisation
University College Cork IRELAND Hardware Concepts An understanding of computer hardware is a vital prerequisite for the study of operating systems.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
Coordinate Based Tracking System
Dr. Kimberly E. Newman Hybrid Embedded wk3 Fall 2009.
Software Development and Software Loading in Embedded Systems.
1-1 SYS Module System Clocks FXTAL BCLK Reset Circuit Reset Conditions Bootstrap Initialization.
NS Training Hardware. System Controller Module.
The ARM Programmer’s Model
3-1 System peripherals & Bus Structure Memory map of the LPC2300 device is one contiguous 32-bit address range. However, the device itself is made up of.
© 2004 Cisco Systems, Inc. All rights reserved. Managing Your Network Environment Managing Router Startup and Configuration INTRO v2.0—9-1.
ECE 265 – LECTURE 12 The Hardware Interface 8/22/ ECE265.
NET+OS 6.1 Training. BSP NET+OS 6.1 BSP Initialization Memory map New features Debugging Porting Issues.
The GreenHills Tool Chain
Exceptions and Interrupts 2
COMP201 Computer Systems Exceptions and Interrupts.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware.
LPC2148 Programming Using BLUEBOARD
AT91SAM9261-EK WinCE 5.0 DEMO ATMEL AT91 Application & Support Group Version 1.O February 2007.
MICROPROCESSOR INPUT/OUTPUT
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
NETOS5.1 Training NS7520 Overview NETOS5.1 Overview BSP Changes BSP & Board Configurations Build File Changes for GHS Makefile Changes for GNU Linker Files.
Debugging an Application Lab. Build/Debug Process A start Load Closest Sample “debug” into MULTI editor Cut and Paste Changes into Sample Build Modified.
Interrupts and reset operations. Overview  Introduction to interrupts – What are they – How are they used  68HC11 interrupt mechanisms – Types of interrupts.
Virtual Memory Review Goal: give illusion of a large memory Allow many processes to share single memory Strategy Break physical memory up into blocks (pages)
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This training course provides an overview of the CPU architecture.
CSNB374: Microprocessor Systems Chapter 5: Procedures and Interrupts.
SAM9260-EK WinCE DEMO AT91 SAM9 Product Group. Version 1.0 October 2006.
SAM9260-EK WinCE DEMO AT91 SAM9 Product Group. Version 1.0 October 2006.
AT91 Interrupt Handling. 2 Stops the execution of main software Redirects the program flow, based on an event, to execute a different software subroutine.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
System Integration Module MTT Motoola SYSTEM INTEGRATION MODULE (SIM)
AT91 C-startup. 2 For reasons of modularity and portability most application code for an embedded application is written in C The application entry point.
Execution Architecture MTT CPU08 Core M CPU08 INTRODUCTION.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Lesson 2 Component Overview Core Hardware Fundamentals.
The World Leader in High Performance Signal Processing Solutions Das U-Boot: Blackfin Guts.
DATE S. S.. Sandstone The sandstone carries out the following tasks: 1. Set up target platform environment, 2. Load a bootable image into memory, 3. Relinquish.
Chap. 4 ARM Boot Loader Internals. 2 S3C2500 ARM940T Core module ARM9TDMI CoreIC.
CCNA 2 v3.1 Module 2 Introduction to Routers
Interrupts and signals
EMBEDDED LINUX #2.
Timer and Interrupts.
MCF5249 Software Examples Bootable example code for the MCF5249
Arithmetic using a stack
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
AT91 C-startup This training module describes the C-Startup sequence, which performs initialization of the microcontroller from the reset up to the calling.
Architectural Support for OS
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
Chapter 9 Bootloader.
Lecture 3 - Instruction Set - Al
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Computer System Laboratory
Architectural Support for OS
Presentation transcript:

Net+OS Initialization Initialization Sequence Initialization Routine Roles ROM Image Compression/Decompression

Initialization Flow Start Reset.s Init.s ncc_init.c romstart.c bsproot.c [main()] tx_kernel_enter tx_application_ define netosStartup root.c [applicationStart()] Your application code

Reset.s – The first code executed Assembly only –No stacks –No variables, other than scratch registers –Very low level ARM code First code executed in Flash is a patch! –Special code for the development board –Vector table is restored later in the code

Reset.s (continued) __entry: LDR R0, =MEM_MMCR LDR R2, [R0] LDR R1, =MEM_MMCR_m2 AND R2, R2, R1 STR R2, [R0] LDR pc, NA_MAIN # Jump to NET+ARM startup.data.w __vectors.data.w 0 This code resides in ROM at address zero It runs and then jumps to NA_MAIN, the real reset vector

Init.s The real initialization code Start at Reset_Handler_Rom –Jump to Reset_Handler if debugger is detected CS0 valid bit is ‘off’ (set to zero) REFCNT has been set in MMCR (for DRAM) ROM already mapped to higher address –If no debugger, then remap ROM & RAM ROM mapped to 0x RAM mapped to 0x0

Init.s (continued) A Software reset is performed –Only resets EFE, DMA, GEN, SER modules Except BSPEED, BCLKD, & PORT A,B,C Then configure Chip Select Zero –Set base address register –Set option register –Values are OR-ed in to preserve bits already set

Init.s (continued) Then auto-configure CS1 for RAM –Same debugger check is made (again) –SDRAM is assumed and checked –Eventually get to cs1_configured Much of this auto-detect logic can be removed Set up an 8K temporary stack at location 8K –Now we can call our first C routine –Branch with Link so we can return

Ncc_init.c First C routine –Still linear main() style C (pre ThreadX) One line at a time, no multi-tasking First Step, Configure the GEN module –Set System Configuration Register (SCR) Set BSPEED to full speed Turn on Bus Monitor Timer Enable access to NET+ARM internal registers when in USER mode –OR in these settings to preserve earlier settings

Ncc_init.c (continued) Disable Interrupts –(*NCC_GEN).i_er.reg = 0; Use the Interrupt Enable Register Mask Set PLLCNT in PLL Config Register –(*NCC_GEN).pllcr.bits.pllcnt = 6; This value is critical to generate Fsysclk & Fxtal regardless of crystal or oscillator clock input Note that SW does not care about PLL, only about Fsysclk and Fxtal

Ncc_init.c (continued) Initialize the PORT A, B, and C registers –Sets up Serial ports, DMA handshake special signals, and GPIO pins for LEDs on dev board –Port C config leaves the Green LED ‘on’ LED assertions are negative ( 0 == ‘on’) Configure Chip Select 1 for RAM –Being careful to check for a debugger before overwriting settings

Ncc_init.c (continued) Configure Chip Select 3 for NVRAM –Dev Board has 8K parallel EE on CS3 *Very* useful for configuration parameters et. al. Warning, if APP_USE_NVRAM is not set in appconf.h, then CS3 is shut off! –This may cause trouble when integrating new prototype hardware

Ncc_init.c (continued) CS4 is disabled (unused on dev board) –This may cause trouble when integrating new prototype hardware Any memory registers are volatile as long as the USER bit is set in the SCR –You can reconfigure CS4 later in the code! Final Step – a complete RAM test is done –This is what takes 40 seconds to finish bootup Then return right where we left off in init.s

Back to init.s RAM (and other chip selects) are done Setup real running stacks for each operating mode of the ARM7 –ABT, IRQ, FIQ, UND, SVC, USER –Continue running in SYS mode Now use real stacks and jump to romstart

Romstart.c Step one – copy the vector table from ROM to RAM Step Two – copy initialized data from ROM to RAM (.data segment) Step Three – copy uninitialized data from ROM to RAM and set it to zero (.BSS segment)

Romstart.c (cont.) Initialize IRQ tables Reset MII (if used) Perform POST tests (if called out in appconf.h) Re-initialize the IRQ tables –Primarily to restore any changes made during POST tests Return to init.s

Back to init.s (again) Load Stack pointer and PC for ThreadX launch and GO LDR sp, STACK LDR pc, START START is beginning of GHS initialization GHS routine returns after it initializes and calls main() from bsproot.c

main() Everyone’s favorite function, it calls… –setupVectorTable() which writes the real vector table to RAM –NABoardInit() which finishes the specific development board initialization –First level Device Driver Initialization –Finally calls tx_kernel_enter which then turns control over to the ThreadX kernel and automatically calls tx_application_define

The Root Thread In tx_application_define ccode = tx_thread_create (&rootThread, "Root Thread", netosStartup, 0, first_unused_memory, APP_ROOT_STACK_SIZE, APP_ROOT_PRIORITY, 1, TX_AUTO_START);

netosStartup Loads Device Drivers Runs the serial console dialog menu Redirects stdio if so configured Loads and starts the TCP/IP stack Calls applicationStart() to start the user’s program.

BSP Init Summary Init.s – contains most all initialization code ncc_init() – called from init.s romstart() – called from init.s START calls GHS initialization routines tx_application_define – starts ThreadX kernel See BSP Porting Guide for more details.