Visible to Intel only — GUID: lro1448909845474
Ixiasoft
1.1. Introduction
1.2. Bare Metal Overview
1.3. Prerequisites for the Bare Metal Development Environment
1.4. Bare Metal Compiler
1.5. Bare Metal Development Flow
1.6. Using DS-5 AE to Create and Manage Bare Metal Projects
1.7. Importing, Building and Debugging in a Make-Based Example
1.8. DS-5 ARM HWLIBs Project Derived from Make-Based Project
1.9. Minimal Preloader
1.10. Appendix: Troubleshooting
Visible to Intel only — GUID: lro1448909845474
Ixiasoft
1.6.1.2. Create New Scatter File to Locate the Bare Metal Application in the OCRAM
- Create a scatter file. Right click on the project, and select "New > Other...", then "Scatter File Editor > Scatter File".
The scatter file enables you to specify the memory map of an image to the linker using a description in a text file. It is used by the ARM compiler linker to determine the placement of the program in the target memory.Figure 8. Creating Scatter File
- Select the project name, bare-metal-hello-world-01, and enter the scatter file name, like scatter_OCRAM.scat
Figure 9. Scatter File Setting
- Select Finish.
The new file automatically appears in the Project Explorer view.
- In the scatter_OCRAM.scat editor view, enter the following when targeting a Cyclone V or Arria V device:
OCRAM 0xFFFF0000 0x10000 { APP_CODE + 0 { * (+ RO , + RW , + ZI ) } ARM_LIB_STACKHEAP 0xFFFF8000 EMPTY 0x8000 ; Application heap and stack { } }
The view looks similar to the following:Figure 10. Scatter OCRAM Code SnippetNote: The linker script instructs the linker on how to link the application:- Defines OCRAM base address (0xFFFF0000) and size (0x10000)
- Loads all application sections in the OCRAM
- Allocates a maximum of 32 KB (0x8000) for stack and heap starting from address 0xFFFF8000
- Select the Regions/Sections tab, located just below the scatter file to show what the memory map looks like.
Figure 11. Scatter File Regions
- Select File > Save to save the modifications.
- After the scatter file has been created in the project, it needs to be associated with the project properties. Select the project name in the Project Explorer view and right-click to select Properties.
- Go to C/C++ Build > Settings > Tool Settings > ARM Linker 5 > Image Layout.
- In the Scatter file (--scatter) text field, browse to the newly created scatter file which should now be in the project folder.
- Select Apply and then OK.
Figure 12. Scatter File Location Setting