Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

7.5.7. Run the Tightly Coupled Memories Examples from the Nios® II Command

To run the tightly coupled memories example from the Nios® II command shell, perform the following steps:

  1. To open a Nios® II command shell under Windows, in the Start menu, point to Programs > Intel FPGA > Nios® II EDS <version number>, and click Nios II <version number> Command Shell.
  2. Navigate to the working directory for your project. The following steps refer to this directory as <project_directory>.
  3. Ensure that the working directory and all subdirectories are writable by typing the following command:
    chmod -R +w . 
  4. Download the tcm.zip file and unzip it into the <project_directory> directory. The figure below shows the directory structure for the unzipped files.
    Figure 283. Project Directory after Unzipping the Files
  5. Change to the software_examples/app/tcm_isr subdirectory of your <project_directory> by typing the following command:
    cd software_examples/app/tcm_isr
  6. Create and build the application by typing the following command:
    ./create-this-app
  7. The linker script file, linker.x in the bsp/timer_hal directory includes a new isrs_region located in tightly coupled instruction memory which is adjacent to the tightly_coupled_instruction_memory region. isrs_region Listing in linker.x File shows the new region.
  8. The tcmisr.objdump in the app/tcm_isr directory defines the .isrs section located in the tightly coupled instruction memory. isrs Section Listing in tcm_isr.objdump File part of this file.

isrs_region Listing in linker.x File

MEMORY
{
:
:
tightly_coupled_instruction_memory : ORIGIN = 0x20000120, LENGTH = 1664
timer_isrs_region : ORIGIN = 0x200007a0, LENGTH = 2048
:
:
}

isrs Section Listing in tcm_isr.objdump File

Sections:
Idx Name 	Size 	VMA 	 LMA 	File off	Algn
0 .entry 	00000000  00000000  00000000 00001000    2**5
		    CONTENTS, ALLOC, LOAD, READONLY, CODE

1 .exceptions 000001a0  20000120  20000120 00013120    2**2
              CONTENTS, ALLOC, LOAD, READONLY, CODE

2 .isrs       000000c4  200007a0  200007a0 000137a0    2**2
              CONTENTS, ALLOC, LOAD, READONLY, CODE

3 .text       0000fea4  10000000  10000000 00001000    2**2
              CONTENTS, ALLOC, LOAD, READONLY, CODE

4 .rodata     00000650  1000fea4  1000fea4 00010ea4    2**2
              CONTENTS, ALLOC, LOAD, READONLY, DATA

5 .rwdata     00001ba0  100104f4  100104f4 000114f4    2**2
              CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA

6 .bss        00000154  10012094  10012094 00013094    2**2
              ALLOC, SMALL_DATA