36
1 (36) Generating tokliBIOS.lib for DSP Gateway 3.3.1 Revision History Date Author Revision Description 30.06.2005 Toshihiro Kobayashi 1.0 Document created 01.11.2005 Toshihiro Kobayashi 1.1 Added missing SEM_fb instance 13.09.2006 Toshihiro Kobayashi Tetsuo Yamabe 1.2 Added CCS and dsptools instruction for OMAP2 architecture according to DSP Gateway 3.3.1 changes Copyright (c) 2005 - 2006 Nokia Corporation

Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

1 (36)

Generating tokliBIOS.lib for DSP Gateway 3.3.1 Revision History

Date Author Revision Description

30.06.2005 Toshihiro Kobayashi 1.0 Document created

01.11.2005 Toshihiro Kobayashi 1.1 Added missing SEM_fb instance

13.09.2006 Toshihiro Kobayashi

Tetsuo Yamabe

1.2 Added CCS and dsptools instruction for OMAP2 architecture according to DSP Gateway 3.3.1 changes

Copyright (c) 2005 - 2006 Nokia Corporation

Page 2: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

2 (36)

TABLE OF CONTENTS

1. PREFACE ...................................................................................................................................... 3 2. Instructions for linux dsp tools........................................................................................................ 4

2.1. DSP/BIOS Configuration with tconf ......................................................................................... 4 2.2. Makefile ................................................................................................................................... 6

3. Instructions for CCS..................................................................................................................... 10 3.1. Create tokliBIOS.lib for OMAP1 ............................................................................................ 10 3.1.1. Create a New CCS Project for Library ............................................................................... 10 3.1.2. DSP/BIOS Configuration.................................................................................................... 10

3.1.2.2. Create a New DSP/BIOS Configuration ..................................................................... 12 3.1.2.3. DSP/BIOS Configuration ............................................................................................ 13 3.1.2.4. Save............................................................................................................................ 23

3.1.3. Build tokliBIOS Library ....................................................................................................... 24 3.1.3.1. Project Build Option .................................................................................................... 24 3.1.3.2. Add Configuration File and Source Codes to the Project ........................................... 25 3.1.3.3. Build............................................................................................................................ 25

3.2. Create tokliBIOS.lib for OMAP2 ............................................................................................ 26 3.2.1. DSP/BIOS Configuration.................................................................................................... 29

3.2.1.1. Add/Create New DSP/BIOS Configuration File to the Project .................................... 29 3.2.1.2. DSP/BIOS Configuration ............................................................................................ 30

3.2.2. Build tokliBIOS Library ....................................................................................................... 31 3.2.2.1. Project Build Option .................................................................................................... 31 3.2.2.2. Add Configuration File and Source Codes to the Project ........................................... 32 3.2.2.3. Build............................................................................................................................ 32

REFERENCES .................................................................................................................................... 33 APPENDIX: how to build a dsp application.......................................................................................... 34

A.1. Create a New CCS Project for Library................................................................................... 34 A.2. Project Build Option............................................................................................................... 34 A.3. Add Source Files to the Project ............................................................................................. 35

Page 3: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

3 (36) 1. PREFACE

This document instructs DSP Gateway 3.3.1 users how to generate DSP-side library - tokliBIOS.lib for OMAP1 and OMAP2. Currently, there are two possible ways to build tokliBIOS.lib in DSP Gateway, one is the linux dsp tools for Linux OS [ 1] and another is the Code Composer Studio (CCS) for Windows OS. In this document, the building procedure using linux dsp tools is described in Chapter 2 and using CCS is described in Chapter 3. Tools and Restrictions From this version 3.3.1, DSP Gateway supports OMAP2 architecture in addition to existing OMAP1 support. Therefore, appropriate building tools and their versions should be selected according to the target (OMAP1 or OMAP2). On the other hand, DSP Gateway 3.3.1 has some restrictions related to tool version. In linux dsp tools and CCS, there are two main tools named Code Generation Tools (cgtools) and tools for Target Content (DSP/BIOS). Each tool version could be managed separately and should be selected with regarding these restrictions. (In case of using CCS, you can find available version from CCS Component Manager and select the version to be used) Tools’ availability and restrictions for each target are described as bellow.

OMAP1: You can use published linux dsp tools for OMAP1 as heretofore. (Its tools version are cgtools ver 2.56 and DSP/BIOS ver 5.03) However, if a DSP binary is built by other version DSP/BIOS tools, power management functionality doesn’t work correctly. Therefore, default tool settings of CCS (e.g. v2.2 or v3.1) could be a cause of this problem. When you use these other version tools, power management have to be disabled by icrmask. (See Chapter 3.7.4 in [ 3] to set mask value to icrmask)

OMAP2: Currently the linux dsp tools for OMAP2 is NOT available in public and CCS is the only choice. See Chapter 3.2 for more detail.

Also, Dynamic Loader Daemon can NOT perform dynamic loading for DSP modules which are built by cgtools version 3.0.0 or later. In this sense, you can load DSP tasks which are statically linked to tokliBIOS and use them.

Page 4: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

4 (36) 2. INSTRUCTIONS FOR LINUX DSP TOOLS

2.1. DSP/BIOS Configuration with tconf

NOTE: Linux dsp tools only supports OMAP1 and this instruction describes only about it. The linux dsp tools contains tconf (Textual Configuration) program (See [ 2]), which generates DSP/BIOS cfg files from tcf (text configuration file). The DSP-side library can be created based on tokliBIOS-omap1.cfg config file, which is shown In List 2-1.

List 2-1: tokliBIOScfg-omap1.tcf /* * Text configuration file (tcf) for tokliBIOS */ /* loading the generic platform */ var params = new Object(); params.clockRate = 192.000000; params.deviceName = "1510"; params.catalogName = "ti.catalog.c5500"; utils.loadPlatform("ti.platforms.generic", params); /* * DSP/BIOS configurations */ /* Disable RTDX */ bios.RTDX.ENABLERTDX = false; /* Disable RTA */ bios.GBL.ENABLEINST = false; /* Disalbe DSP/BIOS trace */ bios.GBL.ENABLEALLTRC = false; bios.GBL.MEMORYMODEL = "LARGE"; bios.MEM.ENABLELOADADDR = false; /* * MEM */ bios.MEM.ARGSSIZE = 0x8; bios.MEM.NOMEMORYHEAPS = false; /* bios.PDROM.destroy(); */ bios.DARAM.base = 0x80; bios.DARAM.len = 0x7f80; bios.DARAM.createHeap = true; bios.DARAM.heapSize = 0x3f80; bios.SARAM.base = 0x8000; bios.SARAM.len = 0xc000; /* FIXME */ bios.SARAM.createHeap = true; bios.SARAM.heapSize = 0x8; // minimum, dummy bios.VECT.base = 0x7fff80; /* bios.VECT.len = 0x80; */ bios.MEM.MALLOCSEG = prog.get("DARAM"); bios.MEM.BIOSOBJSEG = prog.get("DARAM"); /*

Page 5: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

5 (36)

* CLK */ /* don't use hi-resolution timer */ bios.CLK.HIRESTIME = false; bios.CLK.MICROSECONDS = 10000.0000; /* bios.PRD_clock.order = 1; */ bios.PRD0 = bios.PRD.create("PRD0"); bios.PRD0.period = 1; bios.PRD0.fxn = prog.extern("prd_10ms"); bios.PRD1 = bios.PRD.create("PRD1"); bios.PRD1.period = 100; bios.PRD1.fxn = prog.extern("prd_1s"); /* * HWI */ bios.HWI.STACKMODE = "USE_RETA"; bios.HWI_INT5.fxn = prog.extern("mailbox_interrupt"); bios.HWI_INT5.useDispatcher = 1; bios.HWI_INT13.fxn = prog.extern("wdt_handle"); bios.HWI_INT13.useDispatcher = 1; /* * SWI */ bios.SWI_newmsg = bios.SWI.create("SWI_newmsg"); bios.SWI_newmsg.fxn = prog.extern("mbx_newmsg"); bios.SWI_newmsg.arg0 = 0; bios.SWI_newmsg.arg1 = 0; bios.SWI_newmsg.priority = 1; bios.SWI_newmsg.mailbox = 0; /* * TSK */ bios.TSK.ENABLETSK = true; bios.TSK.STACKSEG = prog.get("DARAM"); bios.TSK.CALLSWITCHFXN = 1; bios.TSK.SWITCHFXN = prog.extern("tok_TSK_switch"); bios.TSK.CALLREADYFXN = 1; bios.TSK.READYFXN = prog.extern("tok_TSK_ready"); bios.TSK_sleep = bios.TSK.create("TSK_sleep"); bios.TSK_sleep.fxn = prog.extern("sleep_dsp"); bios.TSK_sleep.priority = 1; bios.TSK_sleep.exitFlag = 0; bios.TSK_sleep.allocateTaskName = 1; bios.TSK_super = bios.TSK.create("TSK_super"); bios.TSK_super.fxn = prog.extern("supertask"); bios.TSK_super.priority = 15; bios.TSK_super.exitFlag = 0; bios.TSK_super.allocateTaskName = 1; /* * SEM */ bios.SEM_super = bios.SEM.create("SEM_super"); bios.SEM_super.count = 0; bios.SEM_ipbuf_sys_da = bios.SEM.create("SEM_ipbuf_sys_da"); bios.SEM_ipbuf_sys_da.count = 1;

Page 6: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

6 (36)

bios.SEM_fb = bios.SEM.create("SEM_fb"); bios.SEM_fb.count = 1; /* * HST */ bios.HST.HOSTLINKTYPE = "NONE"; if (config.hasReportedError == false) { prog.gen("tokliBIOS"); }

2.2. Makefile

List 2-2 shows the Makefile for tokliBIOS.lib, which is located under /dspgw-3.3.1-dsp/src/tokliBIOS/. You have to specify the target (OMAP1) and generate tokliBIOS.lib by typing as follows.

$ make omap1

List 2-2: Makefile for tokliBIOS.lib .PHONY: none omap1 omap2 install uninstall .all .mailbox ifeq ($(ARCH),omap1) all: .all endif ifeq ($(ARCH),omap2) all: .all endif none: @echo "please specify any target. valid targets are:" @echo " omap1" @echo " omap2" omap1: make all ARCH=omap1 omap2: make all ARCH=omap2 install: cp tokliBIOS.lib tokliBIOScfg.cmd tokliBIOS.cmd ../../lib/ uninstall: rm -f ../../lib/tokliBIOS.lib ../../lib/tokliBIOScfg.cmd ../../lib/tokliBIOS.cmd include Makefile.inc MAILBOX_DIR = mailbox MAILBOX_OBJS = $(MAILBOX_DIR)/mailbox.obj

Page 7: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

7 (36)

DEBUG = #DEBUG += -DDEBUG_WAKEUP_CNT #DEBUG += -DDEBUG_TSK INCD += -i$(MAILBOX_DIR) CFLAGS += $(DEBUG) $(INCD) TRGT = tokliBIOS.lib .all: .mailbox $(TRGT) .mailbox: make all -C $(MAILBOX_DIR) ARCH=$(ARCH) LIB_OBJS = \ tokliBIOScfg.obj \ tokliBIOScfg_c.obj \ tokliBIOS.obj \ supertask.obj \ usertask.obj \ idle.obj \ suspend.obj \ wdt.obj \ timer.obj \ $(MAILBOX_OBJS) tokliBIOS.lib: $(LIB_OBJS) $(AR) -r $@ $(LIB_OBJS) ifeq ($(ARCH),omap1) TCF = tokliBIOScfg-omap1.tcf ARCH_HEADERS = hardware.h omap1.h endif ifeq ($(ARCH),omap2) TCF = tokliBIOScfg-omap2.tcf ARCH_HEADERS = hardware.h omap2.h ioma.h endif tokliBIOScfg.s55: $(TCF) $(TCONF) -Dconfig.importPath=$(TCONF_IMPORTPATH) $< tokliBIOScfg.obj: tokliBIOScfg.s55 tokliBIOScfg.h55 tokliBIOScfg_c.obj: tokliBIOScfg_c.c tokliBIOScfg.h tokliBIOS.obj: tokliBIOS.c tokliBIOS.h tokliBIOSlib.h tokliBIOScfg.h $(ARCH_HEADERS) mbx_dspgw.h supertask.obj: supertask.c tokliBIOS.h tokliBIOSlib.h tokliBIOScfg.h $(ARCH_HEADERS) mbx_dspgw.h timer.h usertask.obj: usertask.c tokliBIOS.h tokliBIOSlib.h tokliBIOScfg.h mbx_dspgw.h idle.obj: idle.c tokliBIOSlib.h $(ARCH_HEADERS) timer.h suspend.obj: suspend.s wdt.obj: wdt.c tokliBIOSlib.h $(ARCH_HEADERS) mbx_dspgw.h timer.h timer.obj: timer.c tokliBIOSlib.h $(ARCH_HEADERS) mbx_dspgw.h queue.h timer.h sysinfo.obj: sysinfo.c tokliBIOS.h clean: -rm -f \

Page 8: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

8 (36)

tokliBIOS.lib \ *.obj \ tokliBIOScfg.s55 \ tokliBIOScfg.h55 \ tokliBIOScfg_c.c \ tokliBIOScfg.h \ tokliBIOScfg.cmd \ tokliBIOS.cdb make clean -C $(MAILBOX_DIR)

Makefile.inc in the same directory is included in this Makefile; and locations of version specified dsptools are set in it. Makefile.inc is shown in List 2-3.

List 2-3: Makefile.inc for tokliBIOS.lib # Compiler Options # -g Full Symbolic Debug # -q No Banner # -v processor version # -ml Large memory model # -pdr Issue Nonserious Warnings # -pden Display Diagnostic Identifiers # -pds Suppress Diagnostic <n> # -i Include Search Path CFLAGS = -q -ml #CFLAGS += -g # symbol debugging # Linker Options # -z Linker indication # -q Suppress Banner # -c ROM initialization # -cr RAM initialization # -x Exhaustively Read Libraries # -i Library Search Path # -l Library Name # -o Output File Name # defined in ARCH dependent part #LDFLAGS = -z -q -cr -x #----------------------------------------------------------- ifeq ($(ARCH),omap1) TOOLS_DIR = /usr/local/ti_dsptools CC = $(TOOLS_DIR)/cgtools-c5500-v2.56/bin/cl55 AR = $(TOOLS_DIR)/cgtools-c5500-v2.56/bin/ar55 AS = $(CC) LD = $(CC) TCONF = $(TOOLS_DIR)/bios_5_03/tconf/tconf TCONF_IMPORTPATH = $(TOOLS_DIR)/bios_5_03 INCD += -i$(TOOLS_DIR)/cgtools-c5500-v2.56/include \ -i$(TOOLS_DIR)/bios_5_03/ti/bios/include

Page 9: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

9 (36)

LIBD += -i$(TOOLS_DIR)/cgtools-c5500-v2.56/lib \ -i$(TOOLS_DIR)/bios_5_03/ti/bios/lib \ -i$(TOOLS_DIR)/ccs221_content/c5500/rtdx/lib CFLAGS += -DCONFIG_ARCH_OMAP1 #CFLAGS += -vomap5910 # test2 doesn't seem to work #CFLAGS += -v5510:0 -pdr -pden -pds238 -pds878 -pds452 LDFLAGS = -z -q -cr -x endif # ARCH = omap1 #----------------------------------------------------------- ifeq ($(ARCH),omap2) TOOLS_DIR = /usr/local/ti_dsptools-2420 CC = $(TOOLS_DIR)/cgtools/bin/cl55 AR = $(TOOLS_DIR)/cgtools/bin/ar55 AS = $(CC) LD = $(CC) TCONF = $(TOOLS_DIR)/bios_5_10/xdctools/tconf TCONF_IMPORTPATH = $(TOOLS_DIR)/bios_5_10 INCD += -i$(TOOLS_DIR)/cgtools/include \ -i$(TOOLS_DIR)/bios_5_10/packages/ti/bios/include LIBD += -i$(TOOLS_DIR)/cgtools/lib \ -i$(TOOLS_DIR)/bios_5_10/packages/ti/bios/lib CFLAGS += -d_2420_ -vcore:3.0 -DCONFIG_ARCH_OMAP2 LDFLAGS = -z -q -c -x endif # ARCH = omap2 #----------------------------------------------------------- .SUFFIXES: .obj .s55 .c.obj: $(CC) $(CFLAGS) $< .s.obj: $(AS) $(CFLAGS) $< .s55.obj: $(AS) $(CFLAGS) $<

Page 10: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

10 (36) 3. INSTRUCTIONS FOR CCS

Note: This section assumes using CCS version 3.10. If you have another version, details of the procedure could be different. 3.1. Create tokliBIOS.lib for OMAP1

3.1.1. Create a New CCS Project for Library

• Project Name --> ‘tokliBIOS’ • Project Type --> Library (lib)

Press ``Finish’’ and then you will find a new project named ``tokliBIOS’’ is added in the file view window 3.1.2. DSP/BIOS Configuration

3.1.2.1. Import DSP/BIOS configuration from tconf script

If your DSP/BIOS supports tconf script, you can import src/tokliBIOS/tokliBIOScfg-omap1.tcf to your project and generate CDB (Configuration Data Base) file from it. Otherwise, you have to create a new DSP/BIOS configuration manually (See Chapter 3.1.2.2). To import tokliBIOScfg-omap1.tcf, a small modification is needed as shown in List 3-1.

List 3-1: Change in tokliBIOScfg-1.tcf for CCS /* * Text configuration file (tcf) for tokliBIOS */ /* loading the generic platform */ var params = new Object(); : if (config.hasReportedError == false) { prog.gen("tokliBIOS"); } prog.gen(); /* have to be added for build on CCS */

Page 11: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

11 (36) After modify it, you can import the file from ``Project’’ tab --> ``Add Files to Project’’.

By double-clicking the imported fine name in your project window, you can see a dialog as bellow.

Also, CDB file will be generated by right-clicking the file name and running `Compile File’.

Page 12: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

12 (36) 3.1.2.2. Create a New DSP/BIOS Configuration

This section shows how to create a new DSP/BIOS configuration manually according to tokliBIOScfg-omap1.cfg settings. Please refer List 2-1 for value set in each field. You can create a new DSP/BIOS configuration file (.cdb) from `New’ in File tab -> `DSP/BIOS Configuration’.

This instruction selects omap1510.cdb as a base configuration and modifies it as shown in Chapter 3.1.2.3.

Page 13: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

13 (36) 3.1.2.3. DSP/BIOS Configuration

Global Settings

• DSP Speed In MHz --> Adapt to your environment • Memory Model --> LARGE • Enable Real Time Analysis --> False • Enable All TRC Trace Event Classes --> False

Page 14: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

14 (36)

MEM

MEM – Memory Section Manager / ‘PDROM’

• Delete

MEM – Memory Section Manager / ‘DARAM’

• base --> 0x80 • len --> 0x7f80 • create a heap in this memory --> True • heap size --> 0x3f80

MEM – Memory Section Manager / ‘SARAM’

• base --> 0x8000 • len --> 0xc000 • create a heap in this memory --> True • heap size --> 0x0008

MEM – Memory Section Manager / ‘VECT’

• base --> 0x7fff80 • len --> 0x80

Page 15: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

15 (36)

CLK

Clock Manager

• Timer Selection --> Timer 0 • Use high resolution time for internal timings -> false • Microseconds/Int --> 10000.0000 (10ms)

Page 16: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

16 (36)

PRD

PRD0 (Insert new one)

• period (ticks) --> 1 (10ms) • mode --> continuous • function --> _prd_10ms

PRD1 (Insert new one)

• period (ticks) --> 100 (1s) • mode --> continuous • function --> _prd_1s

Page 17: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

17 (36)

HWI

Hardware Interrupt Service Routine Manager

• Stack Mode --> USE_RETA

HWI_INT5 (mailbox interrupt)

• function --> _mailbox_interrupt • Use Dispatcher --> True

Page 18: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

18 (36)

HWI_INT13 (watchdog timer interrupt)

• function --> _wdt_handle • Use Dispatcher --> True

Page 19: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

19 (36)

SWI

SWI_newmsg (Insert new one)

• function --> _mbx_newmsg • priority --> 1 • mailbox --> 0 • arg0 --> 0 • arg1 --> 0

Page 20: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

20 (36)

TSK

Task Manager

• Check ‘Call switch function’ and set Switch function to ‘_tok_TSK_switch’. • Check ‘Call ready function’ and set Ready function to ‘_tok_TSK_ready’.

TSK_sleep (Insert new one)

• Task function --> _sleep_dsp • Priority --> 1 • Allocate Task Name on Target --> True

Page 21: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

21 (36)

TSK_super (Insert new one)

• Task function --> _supertask • Priority --> 15 • Allocate Task Name on Target --> True

SEM

SEM_fb (Insert new one)

• Initial semaphore count --> 1 SEM_ipbuf_sys_da (Insert new one)

• Initial semaphore count --> 1 SEM_super (Insert new one)

• Initial semaphore count --> 0

Page 22: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

22 (36)

RTDX

RTDX

• Enable Real-Time Data Exchange --> False

NOTE: This option should be changed after setting `NONE’ to Host Link Type in HST setting.

Page 23: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

23 (36)

HST

HST

• Host Link Type --> NONE

3.1.2.4. Save

Save the configuration as ‘tokliBIOS.cdb’ (or `tokliBIOS.tcf’ if tconf is supported) and add it to your project.

Page 24: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

24 (36) 3.1.3. Build tokliBIOS Library

3.1.3.1. Project Build Option

• `Advanced’ -> `Memory Model’ -> ‘Large (-ml)’ • `Preprocessor’ -> `Include Search Path (-i)’ -> <HEADER_INCLUDE_PATH> • `Preprocessor’ -> `Pre-Define Symbol (-d)’ -> CONFIG_ARCH_OMAP1

NOTE: Location of header files have to be specified in HEADER_INCLUDE_PATH. Please remember to specify mailbox directory in Include Search Path to include mailbox.h.

Page 25: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

25 (36) 3.1.3.2. Add Configuration File and Source Codes to the Project

Place all files in ‘tokliBIOS’ directory in the ‘dspgw-3.3.1-dsp.tar.bz2’ package to the tokliBIOS project folder.

Add *.c and *.s files to the project.

Now you can find added source file names in the project window as bellow.

3.1.3.3. Build

Build the project with clicking ``Project’’ -> ``Build’’ (or F7). Then you will have ‘tokliBIOS.lib’ in ‘Debug’ (or ‘Release’) folder. You can link this library with your DSP application.

Page 26: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

26 (36) 3.2. Create tokliBIOS.lib for OMAP2

Note: To build tokliBIOS.lib for OMAP2 architecture, DSP/BIOS must support it. In this instruction, we use CCS version 3.1 and update DSP/BIOS version from 4.90 to 5.20. The way to create a new CCS project is shown in Chapter 3.1.1. Also, you can import tokliBIOScfg-omap2.tcf in the same way for tokliBIOScfg-omap1.tcf described in Chapter 3.1.2.1. List 3-2 shows tokliBIOScfg-omap2.tcf.

List 3-2: tokliBIOScfg-omap2.tcf /* * Text configuration file (tcf) for tokliBIOS */ /* loading the generic platform */ var params = new Object(); params.clockRate = 220.000000; params.deviceName = "2420"; params.catalogName = "ti.catalog.c5500"; utils.loadPlatform("ti.platforms.generic", params); /* * DSP/BIOS configurations */ /* Disable RTDX */ bios.RTDX.ENABLERTDX = false; /* Disable RTA */ bios.GBL.ENABLEINST = false; /* Disalbe DSP/BIOS trace */ bios.GBL.ENABLEALLTRC = false; bios.GBL.MEMORYMODEL = "LARGE"; bios.MEM.ENABLELOADADDR = false; /* * MEM */ bios.MEM.ARGSSIZE = 0x8; bios.MEM.NOMEMORYHEAPS = false; /* bios.PDROM.destroy(); */ bios.DARAM.base = 0x80; bios.DARAM.len = 0x7f80; bios.DARAM.createHeap = true; bios.DARAM.heapSize = 0x3f80; bios.SARAM.base = 0x8000; bios.SARAM.len = 0xc000; /* FIXME */ bios.SARAM.createHeap = true; bios.SARAM.heapSize = 0x8; // minimum, dummy bios.VECT.base = 0x7fff80; /* bios.VECT.len = 0x80; */ bios.MEM.MALLOCSEG = prog.get("DARAM"); bios.MEM.BIOSOBJSEG = prog.get("DARAM"); /* * CLK

Page 27: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

27 (36)

*/ /* don't use hi-resolution timer */ bios.CLK.HIRESTIME = false; bios.CLK.MICROSECONDS = 10000.0000; /* bios.PRD_clock.order = 1; */ bios.PRD0 = bios.PRD.create("PRD0"); bios.PRD0.period = 1; bios.PRD0.fxn = prog.extern("prd_10ms"); bios.PRD1 = bios.PRD.create("PRD1"); bios.PRD1.period = 100; bios.PRD1.fxn = prog.extern("prd_1s"); /* * HWI */ bios.HWI.STACKMODE = "USE_RETA"; bios.HWI_INT5.fxn = prog.extern("mailbox_interrupt"); bios.HWI_INT5.useDispatcher = 1; /* * SWI */ bios.SWI_newmsg = bios.SWI.create("SWI_newmsg"); bios.SWI_newmsg.fxn = prog.extern("mbx_newmsg"); bios.SWI_newmsg.arg0 = 0; bios.SWI_newmsg.arg1 = 0; bios.SWI_newmsg.priority = 1; bios.SWI_newmsg.mailbox = 0; bios.SWI_notfull = bios.SWI.create("SWI_notfull"); bios.SWI_notfull.fxn = prog.extern("mbx_notfull"); bios.SWI_notfull.arg0 = 0; bios.SWI_notfull.arg1 = 0; bios.SWI_notfull.priority = 1; bios.SWI_notfull.mailbox = 0; /* * TSK */ bios.TSK.ENABLETSK = true; bios.TSK.STACKSEG = prog.get("DARAM"); bios.TSK.CALLSWITCHFXN = 1; bios.TSK.SWITCHFXN = prog.extern("tok_TSK_switch"); bios.TSK.CALLREADYFXN = 1; bios.TSK.READYFXN = prog.extern("tok_TSK_ready"); bios.TSK_sleep = bios.TSK.create("TSK_sleep"); bios.TSK_sleep.fxn = prog.extern("sleep_dsp"); bios.TSK_sleep.priority = 1; bios.TSK_sleep.exitFlag = 0; bios.TSK_sleep.allocateTaskName = 1; bios.TSK_super = bios.TSK.create("TSK_super"); bios.TSK_super.fxn = prog.extern("supertask"); bios.TSK_super.priority = 15; bios.TSK_super.exitFlag = 0; bios.TSK_super.allocateTaskName = 1; /* * SEM */ bios.SEM_super = bios.SEM.create("SEM_super"); bios.SEM_super.count = 0;

Page 28: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

28 (36)

bios.SEM_ipbuf_sys_da = bios.SEM.create("SEM_ipbuf_sys_da"); bios.SEM_ipbuf_sys_da.count = 1; bios.SEM_fb = bios.SEM.create("SEM_fb"); bios.SEM_fb.count = 1; bios.SEM_mb_full = bios.SEM.create("SEM_mb_full"); bios.SEM_mb_full.count = 0; /* * HST */ bios.HST.HOSTLINKTYPE = "NONE"; if (config.hasReportedError == false) { prog.gen("tokliBIOS"); }

You need a small modification to import tokliBIOScfg-2.tcf shown in List 3-3.

List 3-3: Change in tokliBIOScfg-2.tcf for CCS /* * Text configuration file (tcf) for tokliBIOS */ /* loading the generic platform */ var params = new Object(); : if (config.hasReportedError == false) { prog.gen("tokliBIOS"); } prog.gen(); /* have to be added for build on CCS */

In the Section 3.2.1, differences in manual configuration between OMAP2 and OMAP1 are explained.

Page 29: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

29 (36) 3.2.1. DSP/BIOS Configuration

This section shows how to create a new DSP/BIOS configuration according to settings in tokliBIOScfg-omap2.tcf. Basically same procedure explained in Chapter 3.1 could be applied for this manual configuration. 3.2.1.1. Add/Create New DSP/BIOS Configuration File to the Project

In this case, h4omap2420 configuration is selected as a base configuration.

Page 30: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

30 (36)

3.2.1.2. DSP/BIOS Configuration

In addition to OMAP1 settings described in Chapter 3.1.2.3, two more configurations are required as bellow.

SWI

SWI_notfull (Insert new one)

• function --> _mbx_notfull • priority --> 1 • mailbox --> 0 • arg0 --> 0 • arg1 --> 0

SEM

SEM_mb_full (Insert new one)

• function --> _SEM_mb_full • count --> 0

Page 31: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

31 (36) 3.2.2. Build tokliBIOS Library

3.2.2.1. Project Build Option

Open ``Project’’ tab and click ``Build Options’’ to add options to build the project. Then, configure settings as bellow.

• `Basic’ -> `Custom Target (-v)’ -> core:3.0 • `Advanced’ -> `Memory Model’ -> `Large (-ml)’ • `Preprocessor’ -> `Include Search Path (-i)’ -> <YOUR_HEADER_INCLUDE_PATH> • `Preprocessor’ -> `Pre-Define Symbol (-u)’ -> CONFIG_ARCH_OMAP2; _2420_

Then, you can see the compiler option is set as bellow.

Page 32: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

32 (36) 3.2.2.2. Add Configuration File and Source Codes to the Project

Place all files in ‘tokliBIOS’ directory in the ‘dspgw-3.3.1-dsp.tar.bz2’ package to the tokliBIOS project folder.

Add *.c and *.s files to the project.

Now you can find added source file names in the project window as bellow.

3.2.2.3. Build

Build the project with clicking ``Project’’ -> ``Build’’ (or F7). Then you will have ‘tokliBIOS.lib’ in ‘Debug’ (or ‘Release’) folder. You can link this library with your DSP application.

Page 33: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

33 (36) REFERENCES

1. https://www-a.ti.com/downloads/sds_support/targetcontent/LinuxDspTools/index.html

2. SPRU007, DSP/BIOS Textual Configuration (Tconf) User’s Guide, Texas Instruments

3. Linux DSP Gateway Specification Rev 3.3.1

Page 34: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

34 (36) APPENDIX: HOW TO BUILD A DSP APPLICATION

DSP applications, which are statically linked to tokliBIOS.lib (.out files), could be generated by CCS. In this chapter, a procedure to build a DSP application (demo_console.out as an example) is explained. A.1. Create a New CCS Project for Library

• Project Name --> ‘demo_console’ • Project Type --> Executable (.out)

A.2. Project Build Option

Options for compiler are as bellow.

• `Basic’ -> `Custom Target (-v)’ -> core:3.0 (for OMAP2) • `Advanced’ -> `Memory Model’ -> ‘Large (-ml)’ • `Preprocessor’ -> `Include Search Path (-i)’ -> <HEADER_INCLUDE_PATH> • `Preprocessor’ -> `Pre-Define Symbol (-u)’ -> _2420_ (for OMAP2)

Page 35: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

35 (36) Options for linker are as bellow.

• `Library Search Path’ -> <the directory where tokliBIOS.lib is located> • `Include Libraries’ -> tokliBIOS.lib

A.3. Add Source Files to the Project

Copy bellow files to your project directory.

• demo_console.c and sysinfo_con.c from src/apps/demo directory • demo.cmd from src/apps/demo directory • tokliBIOS.h from include directory • tokliBIOS.cmd and tokliBIOScfg.cmd from your tokliBIOS project directory

Then, add demo_console.c, sysinfo_con.c, demo.cmd to the project. Now you will see source files are added as bellow.

Page 36: Generating tokliBIOS.lib for DSP Gateway 3.3dspgateway.sourceforge.net/pub/3.3.1/DSPGW331-tokliBIOS-gen10.pdf · 3 (36) 1. PREFACE This document instructs DSP Gateway 3.3.1 users

36 (36)

If build process is successfully performed, you will have demo_console.out in Debug (or Release) directory in the project.