Getting Started with ERC32 Ada

Ada 95 Compilation System for Spacecraft Microprocessors


ERC32 Ada is based on Ada compiler technology developed by the GNAT team at New York University and includes software from the GNU C compiler, debugger and binary utilities developed by and on behalf of the Free Software Foundation, Inc., Cambridge, Massachusetts. Development of the mission-critical capability was funded by TRW Aerospace and the Ministry of Defence. Customization for the ERC32 was done under contract with the European Space Agency.

Table of Contents
About this Guide
1. Audience
2. Related Documents
3. Reader's Comments
4. Documentation Conventions
1. Basic Techniques
1.1. Hello World
1.1.1. How to Prepare an Ada Program
1.1.2. How to Compile
1.1.3. How to Run a Program on the Simulator
1.2. How to Recompile a Program
1.3. The Generated Code
1.4. What's in My Program?
1.5. Restrictions
2. Advanced Techniques
2.1. How to Customze the Start File
2.2. How to Customize the Linker Script File
2.3. How to Get a Map File
2.4. Checking for Stack Overflow
2.5. Generating PROM Programming Files
2.6. Using the Debugger
2.7. Using Optimizations
2.8. Working with the Target
2.8.1. How to Down-load the Debug Monitor
2.8.2. Preparing a Program to Run under the Monitor
2.9. The Boot PROM
2.10. Working with the EDAC
2.11. Working with Temic Revisions CBA and CCA
2.12. System Calls
2.12.1. How to Use Text_IO Without System Calls
3. Real-Time Programs
3.1. The Ravenscar Profile
3.1.1. The Main Task
3.1.2. Time Types
3.1.3. Form of a Periodic Task
3.1.4. Aperiodic Tasks
3.2. Additional Predefined Packages
3.3. Interrupts without Tasks
A. ERC32 Compiler Options
B. ERC32 Assembler Options and Directives
B.1. ERC32 Options
B.2. Enforcing aligned data
B.3. Floating Point
B.4. ERC32 Machine Directives
B.5. Synthetic Instructions
C. ERC32 Simulator Options
C.1. The Command Line
C.2. Simulator Options
C.3. Examples of Simulator Use
D. The package Ada.Interrupts.Names
E. The Host-Target Link
E.1. How to Change the UART Speed
E.2. RS-232 Information
F. Questions and Answers
List of Tables
B-1. Mapping of Synthetic Instructions to ERC32 Instructions
D-1. Mapping of Interrupt Names to Priorities
E-1. Pre-Computed Values for the UART Scaler (For ubr = 1)
E-2. Errors in bit rate (For ubr = 1)
E-3. Null Modem Wiring and Pin Connection
E-4. The RS-232 Standard
List of Examples
1-1. The Source File
1-2. The Compile Command
1-3. Binding and Linking
1-4. Using gnatmake
1-5. Running on the Simulator
1-6. Generating a Machine Code Listing
1-7. Output from objdump
1-8. Using the Size Command
1-9. Using the Object Code Dump Program
2-1. Creating a Custom Start File
2-2. Recompiling art0.S
2-3. Rebuilding with a Custom art0.S
2-4. Editing the Linker Script File
2-5. Using a Custom Linker Script File
2-6. How to Get a Map File
2-7. The Map File
2-8. Stack Overflow Check
2-9. Converting to Intel Hex
2-10. Generating a HEX File
2-11. Running an Intel Hex File
2-12. Running an S-Record File
2-13. Recompiling with the Debug Option
2-14. Running under the Debugger
2-15. Dump of Debug Information
2-16. Remote Configuration File
2-17. Output from the SPARC Monitor
2-18. Output from the Debug Monitor
2-19. Remote Debugging
2-20. Building to Run with the XGC Monitor
2-21. Running the simulator with the EDAC
2-22. Program that Requires CBA Workarounds
2-23. SPARC V7 Generated Code
2-24. Code Generated for Revision CBA
2-25. Code to Support Write
3-1. Main Subprogram with Idle Loop
3-2. Idle Loop with Power-Down
3-3. A Periodic Task
3-4. An Interrupt-Driven Task
3-5. Example Interrupt Level Protected Object