The%20GreenHills%20Tool%20Chain - PowerPoint PPT Presentation

About This Presentation
Title:

The%20GreenHills%20Tool%20Chain

Description:

decompress.c. C. reset.s. assembly. na1.lib. library. na2.lib. library. bsp.a. library. tcpip.a ... decompress.c. Summary. Develop & debug with ramimagezip.bld ... – PowerPoint PPT presentation

Number of Views:197
Avg rating:3.0/5.0
Slides: 77
Provided by: FArc9
Category:

less

Transcript and Presenter's Notes

Title: The%20GreenHills%20Tool%20Chain


1
The GreenHills Tool Chain
Multi 2.1/3.5 Differences Build Environment
Overview Build Through Debug Review Linking
Files ROM and RAM Execution Multi 2000
Configuration
2
Multi 2.1/3.5 - Directory Structure
Multi v2.1 C\green \libsrc
\armtsf \armtsfb
Multi v3.5 C\ghs \libsys
\arm4 \arm4b
3
Multi 2.1/3.5 - System Library
  • System related functions
  • libsys.a
  • Contains customized IO stubs
  • ind_io.c
  • No longer replace system library in GHS directory
  • /ghs/arm4b/libsys.a
  • New custom GHS library
  • ghs.o
  • Replaced io file during final link
  • na2.bld

4
Multi 2.1/3.5 - Build File
  • Compatible with multi2000 v3.5
  • na1.bld, na2.bld, bsp.bld,
  • Automatically upgraded format when modified
  • Insert additional files
  • Options are added or removed
  • byteorder
  • bigendian
  • c_options
  • New format not compatible with v2.1
  • Using an editor to avoid format change
  • Wordpad
  • ultraedit

5
Multi 2.1/3.5 new Compiler
  • Stricter compliance to C standard
  • Casting variable types
  • Additional warnings generated
  • No line feed
  • Variable used when not initialized
  • Variable not used
  • NETOS files cleaned
  • bsp, header files, examples

6
Overview of Multi 2000 Build Environment
7
Major Components
  • By Green Hills Software
  • Integrated Development Environment (IDE) Includes
  • Builder
  • Compiler
  • Linker
  • Editor
  • Source Debugger
  • Version Control
  • Run-Time Error Checking

8
Builder Window
  • This is the main builder window

9
Graphical User Interface
  • Multi-2000 provides a color-assisted text editor

10
Adding files to the project
  • C files and libraries are added to the project
    simply by a multi-selectable dialog window

11
Build Through Debug Review
12
Building the project
  • Once all files are present in project workspace,
    building is readily done

13
Connecting to Target (1of 3)
  • In the Builder, choose Remote gt Connect to
    Target.

14
Connecting to Target (2 of 3)
  • Enter OCDSERV command line.

15
Connecting to Target (3 of 3)
  • Two new windows
  • IN/OUT Displays Printfs
  • TARGETcan read/write to Memory/CPU

16
Starting Debugger
  • In the Builder select Debug gt debug

17
Debugger Features
  • Set Break Points-Software and Hardware
  • Step through code
  • Examine C-code
  • Examine Interlaced Assembly
  • Examine values of variables, registers, memory

18
Debugger Windows
  • Interlaced Assembler displayed
  • Color enhanced buttons

19
Download code to Target
  • Click play button or (F5)

20
Run Program
  • Program is Running
  • Use breakpoints or step through code

21
Breakpoints
  • NETOS supports both software and hardware
    breakpoints.
  • Software breakpoints (instruction fetches) are
    only possible while debugging from RAM
  • Actual instruction is replaced with a special bit
    pattern that forces the ARM into debug mode.
  • Unlimited number of software breakpoints
    available.
  • Hardware breakpoints (data accesses) are possible
    while debugging from RAM or ROM.
  • Triggered by particular address access.
  • Maximum of one hardware breakpoint at a time.
    (Green Hills Limitation)

22
Software Breakpoints
  • Adding a software breakpoint takes one click!

23
Hardware Breakpoints
  • Hardware breakpoints installed via entering
    address or symbol name, r/w/x.

24
Debugging in a multi threaded operating
environment ThreadX Tools
  • Multi-2000 has a number of specific tools for
    debugging and analyzing ThreadX.

25
ThreadX Tools
26
ThreadX Tools
27
Linking Files
28
Introduction
  • The linker places text data into the
    appropriate sections of memory, as defined by the
  • User-supplied section map, or
  • Default linker section map
  • Application can benefit by splitting the program
    into sections such that it will more readily
    support different types of memories. Factors
    include
  • Speed of parts (performance requirements)
  • Cost availability

29
Linker Directives File
  • Major GHS supplied linker directives

.picbase Base of text sections
.text Program text
.rodata Read-only data
.rosdata Small, read-only data
.secinfo Information on section layout of the program
.data Initialized variables
.bss Zero-initialized variables
.heap Size and location of runtime heap
.stack Size and location of runtime stack
30
Linker Directives File (cont.)
  • NETSilicon provided linker directives
  • Common linker attributes
  • align(expr) - Section will start on first
    expr-byte aligned address following previous
    section
  • pad(expr) - Linker will reserve expr bytes for
    this section in memory
  • ROM(expr) - Section becomes a ROMmable copy of
    expr. Section inherits the attributes and data
    of expr, while expr is modified to reserve
    address space only (as if it were all padding
    with no data)

.netosstack Stack for each processing mode, grows downward. Please refer to init.s
.free_mem Area of memory used by the THREADX kernel to create timer and root threads. This should not be used for any other purpose
31
ROM and RAM Execution
32
Basic RAM ROM requirements for NETOS
  • 512KB 1MB Flash Recommended
  • Primarily for code storage
  • Code execution for low-end applications
  • 2MB 8MB RAM Recommended
  • Data buffering for DMA channels
  • Thread stacks
  • Heap
  • Place holder for new image download
  • Code execution for higher-end applications

33
System Memory Map
Memory Range Memory Device Cache Option
0x00000000 - 0x00FFFFFF RAM CACHE
0x02000000 - 0x000FFFFF ROM SAFE
0x03000000 - 0x03001FFF NVRAM
0x04000000 - 0x04FFFFFF RAM DATA
0x06000000 - 0x060FFFFF ROM CACHE
0x08000000 - 0x08FFFFFF RAM INSTRUCTION
0x0A000000 - 0x0A0FFFFF ROM CACHE
0x0C000000 - 0x0CFFFFFF RAM NOT
0x0E000000 0x0E0FFFFF ROM CACHED
34
System Memory Map
  • BSP provided memory map is designed with cache in
    mind.
  • Same map will work with or without cache.
  • Entire memory map configured using 2 control
    registers per chip select.
  • Address bit masking allows for multiple memory
    images ideal for setting up cacheable regions.

35
Relative application speed
  • FLASH memory typically 90-120ns read access time.
  • Can decrease access time to 35-50ns by leaving
    flash chip on all the time.
  • SDRAM typically 7-10ns access time.
  • Running from RAM is typically faster.

36
Supporting FTP FLASH upgrade
  • FTP server must be running out of either Flash or
    RAM.
  • FLASH update is invoked by an FTP client
    requesting to put file of special keyword
    filename.
  • File is transferred to NetARM system memory
    buffer (RAM).
  • A subsequent procedure, running in RAM, burns
    Flash with this new image.
  • Running in RAM is the key to this step.

37
Project Structure
Note ramimagezip.bld is main project, including
only subproject, linker. -gt Also includes
project options. -gt Inherits additional options
from a parent project.
38
ramimagezip.bld - what it looks like
!build default program elxr_map_optionmap
elxr_map_optionnumeric_sort postexecgmemfile
-s ramimagezip -o ram.bin postexeccompress
ram.bin ramimagezip.bin postexecbin2obj
ramimagezip.bin .\zobjs\ramimagezip.o project.bld
subproject ramimagezip.lx linker_file
39
project.bld - contents
Note the hierarchy - project.bld includes only
source files and libraries. Conclusion - the
same project.bld can be used with several
programs.
40
project.bld - what it looks like
na1.lib library na2.lib library bsp.a library
tcpip.a library tx.a library appconf.h include_
file
!build default subproject root.c C bsproot.c
C dialog.c C decompress.c C reset.s assembly
cont
41
3 Ways to Run
ramimagezip
rom
romzip
Boot Execution
RAM
ROM
ROM
Application Execution
RAM
ROM
RAM
Note - Executable downloaded with Debugger
42
Run-time Physical Memory Mapping
0xFFFF FFFF
Device Physical Address
IGNORE FOR NOW
32-bit Internal Address Space
0x001F FFFF
0x021F FFFF
CS0 (Flash)
0x0000 0000
0x0200 0000
Unmapped
0x00FF FFFF
0x00FF FFFF
CS1 (RAM)
0x0000 0000
0x0000 0000
43
ramimagezip Executable Location
0xFFFF FFFF
IGNORE FOR NOW
32-bit Internal Address Space
CS0 (Flash)
Unmapped
0x00FF FFFF
CS1 (RAM)
Executable Location
0x0000 0000
44
Memory Map - ramimagezip
CS1(RAM)
Top of Physical RAM
Unused
unknown until link
Initialized r/w Data
Constant Data
Text (instructions)
0x0080 0000
.picbase
Unused
stack heap bss data
Explicitly defined in linker file (ramimagezip.lx)
unknown until link
Data Section
0x0000 1000
.sdabase
Vector Table
0x0000 0000
.pidbase
45
rom.bld Executable Location
IGNORE FOR NOW
32-bit Internal Address Space
0x02FF FFFF
CS0 (Flash)
0x0200 0000
Unmapped
Executable Location
0x00FF FFFF
CS1 (RAM)
0x0000 0000
46
Rom-based Memory Map - rom.bld
Top of Physical Flash
Unused
CS0 (Flash)
Initialized r/w Data
Constant Data
Text (instructions)
0x0200 0000
.picbase
Top of Physical RAM
Unused
stack heap bss data
CS1 (RAM)
Data Section
.sdabase
Vector Table
0x0000 0000
.pidbase
47
ROM Compression - romzip.bld
romzip is the small bootloader that will reside
at beginning of Flash, uncompressed. -gt It is
also the parent project of ramimagezip.bld.
48
romzip.bld - what it looks like
!build default program c_optionnoasmwarn e
lxr_map_optionnumeric_sort arm_optionbigendian
arm_cputypearm7tm object_dir.\zobjs drive
r_opts-map entryReset_Handler_ROM sourcedirs.
\..\..\..\bsp sysincdirs.\..\..\..\..\h sysin
cdirs.\..\..\..\..\h\threadx definesNET_OS d
efinesENABLE_FLASH_COMPRESSION postexecgmemfil
e -s romzip -o romzip.bin
reset.s assembly decompress.c C .\..\loader.c C
.\zobjs\ramimagezip.o object_file bsp.a library
.\..\romzip.lx linker_file .\..\ramimagezip.bld
program romzip.map Custom
49
romzip.bld Executable Location
Same as rom.bld
IGNORE FOR NOW
32-bit Internal Address Space
0x02FF FFFF
CS0 (Flash)
0x0200 0000
Unmapped
Executable Location
0x00FF FFFF
CS1 (RAM)
0x0000 0000
50
Memory Map - romzip.bld
Top of Physical Flash
Unused
CS0 (Flash)
Initialized r/w Data
Constant Data
Text (instructions)
Same as rom.bld
0x0200 0000
.picbase
Top of Physical RAM
Unused
stack heap bss data
CS1 (RAM)
Data Section
.sdabase
Vector Table
0x0000 0000
.pidbase
51
ramimage.o location, pre-decompression
CS0 (Flash)
Unused
  • ramimage.o
  • Compressed ramimage
  • Linked with ramimage.lx
  • Symbol name ram_buffer_0

Initialized r/w Data
Constant Data
Text (instructions)
0x0200 0000
.picbase
52
Decompression and Relocation
CS1 (RAM)
CS0 (Flash)
Unused
Unused
Initialized r/w Data
decompress.c
Constant Data
Initialized r/w Data
Text (instructions)
Constant Data
RAMIMAGE_START
.picbase
Text (instructions)
Unused
0x0200 0000
stack heap bss data
RAMIMAGE_START must match .picbase as defined in
ramimagezip.lx !!! After relocation, flash is no
longer used, and execution starts at .picbase -
Final memory map same as ramimagezip !
Data Section
Vector Table
0x0000 0000
53
Summary
  • Develop debug with ramimagezip.bld
  • Must Open romzip.bld, to inherit proper include
    directories, etc.
  • double-click ramimagezip.bld from within
    romzip.bld
  • Once desired functionality reached, simply
    compile romzip.bld
  • romzip.bin will be generated
  • Download to flash
  • Power cycle will invoke romzip to run from Flash
  • After about 15 seconds, ramimagezip will be
    running
  • From RAM
  • Flash no longer used at this point
  • Original ramimagezip memory map now in effect

54
Multi 2000 Configuration
55
Introduction
  • MULTI-2000 is a user configurable IDE
  • Users can control
  • Compiler options
  • Linker options
  • Visual look and feel

56
Project Options
57
General Tab
58
Optimization Tab
59
Run-time Error Tab
60
Configuration Tab
61
Action Tab
62
Advanced Tab
63
Project Language Options
64
C Tab
65
Project CPU Options
66
ARM Options
67
Project Toolchain Options
68
Linker Tab
69
Assembler Tab
70
Config Options
71
General Tab
72
Debugger Tab
73
Editor Tab
74
Version Control Tab
75
Colors Tab
76
Summary
  • For further reading consult Building and Editing
    with Multi2000, Green Hills Software(M32W89NG)
Write a Comment
User Comments (0)
About PowerShow.com