FSA Library Object Link Manual Rev.1.0
Evaluation board/kit and Development tool important notice 1. This evaluation board/kit or development tool is designed for use for engineering evaluation, demonstration, or development purposes only. Do not use it for other purposes. It is not intended to meet the requirements of design for finished products. 2. This evaluation board/kit or development tool is intended for use by an electronics engineer and is not a consumer product. The user should use it properly and in a safe manner. Seiko Epson dose not assume any responsibility or liability of any kind of damage and/or fire coursed by the use of it. The user should cease to use it when any abnormal issue occurs even during proper and safe use. 3. The part used for this evaluation board/kit or development tool may be changed without any notice. NOTICE No part of this material may be reproduced or duplicated in any form or by any means without the written permission of Seiko Epson. Seiko Epson reserves the right to make changes to this material without notice. Seiko Epson does not assume any liability of any kind arising out of any inaccuracies contained in this material or due to its application or use in any product or circuit and, further, there is no representation that this material is applicable to products requiring high level reliability, such as, medical products. Moreover, no license to any intellectual property rights is granted by implication or otherwise, and there is no representation or warranty that anything made in accordance with this material will be free from any patent or copyright infringement of a third party. When exporting the products or technology described in this material, you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations. You are requested not to use, to resell, to export and/or to otherwise dispose of the products (and any technical information furnished, if any) for the development and/or manufacture of weapon of mass destruction or for other military purposes. All brands or product names mentioned herein are trademarks and/or registered trademarks of their respective companies. SEIKO EPSON CORPORATION 2015, All rights reserved.
Table of Contents 1. Overview... 1 2. Environment... 1 3. FSA Library Files... 1 4. Link Procedures... 2 Step-1 Setting Symbol Information... 2 Step-2 Setting Include Path... 3 Step-3 Adding FSA Library Object... 4 Step-4 Setting FSA Relevant Section... 5 Adding.fsacons Section... 5 Adding.fsacode Section... 6 Adding.fsawork Section... 7 Step-5 Adding Boot Process... 9 Step-6 Building Project... 9 5. Confirming FSA Stack Memory Area... 10 Revision History... 11 FSA Library Object Link Manual Seiko Epson Corporation i
1. Overview 1. Overview This document is intended to describe procedures to link FSA objects in the C17 integrated development environment (Eclipse). 2. Environment C17 integrated development environment (Eclipse) and PC FSA 2.0 SDK is installed 3. FSA Library Files In general, the FSA library is composed of files listed in Table 3.1. The symbol XXXX in the table represents an FSA library name. Table 3.1 FSA Library File List File XXXX.o XXXX_fsa.o fsa_symbols_xxxx.def XXXX.h Description Object file for C17 program codes and constant arrays Object file for FSA program codes Symbol definition file for the linker to resolve symbols in FSA programs Library function declaration and parameter definition FSA Library Object Link Manual Seiko Epson Corporation 1
4. Link Procedures 4. Link Procedures This section describes example procedures to link the FFT library shown below when thee library configuration file below is located at the fsalib folder immediately below the GNU17 project folder. fsafft fsa.o fsafft.o fsa_symbols_fsafft.def fsafft.h Step-1 Setting Symbol Information In the Properties screen of target project, select Build Options, Linker, and General in order. Add -R fsasymbols_fsafft.def to thee Linker flags field shown at the right. (-R filename: Reads symbol names and their addresses from the file filename.) 2 Seiko Epson Corporation FSA Library Object Link Manual
4.. Link Procedures Step-2 Setting Include Path In the Properties screen of target project, select Build Options, Compiler, and Directories in order. Add $(FSA_DIR)/include to the Include Paths fieldd shown at the right. (FSA_DIR is automatically added to environment variables when installing FSA2.0-SDK.) Also, add the FSA library folder (./fsalib) here. FSA Library Object Link Manual Seiko Epson Corporation 3
4. Link Procedures Step-3 Adding FSA Library Object In the Properties screen of target project, select Build Options, Linker, and Libraries in order. Add the FSA library objects (fsalib/fsafft.o, fsakib/fsafft_fsa.o) to the Libraries field shown at the right. 4 Seiko Epson Corporation FSA Library Object Link Manual
4.. Link Procedures Step-4 Setting FSA Relevant Section In the Properties screen of target project, select Linker Script Settings shown at the left. Add the.fsacons,.fsacode, and.fsawork sections in the Linker Script Settings shown at the right. r (*1) Place FSA objects in these three sections. (*1) :.fsacons,.fsacode, and.fsawork are predetermined section names. Do not change them. Place three FSA sectionss in the area accessible a from FSA. However, to holdd the FSA programs and constant arrays in nonvolatile memory, set these sections above as VMA and set nonvolatile memory area as LMA. Adding.fsacons Section In the Linker Script Settings screen, click the [Add] button and add fsacons section as shown below. In the example below, Virtual map address (VMA)( is set t to 0x0C0000, the [LMA VMA] checkbox is selected, and the Load map address (LMA) is set to data section. Change thesee settings, if needed. n Select.rodata as File Attributes. Note that there is no need to add objects to Allocated files fieldd especially. FSA Library Object Link Manual Seiko Epson Corporation 5
4. Link Procedures Adding.fsacode Section In the Linker Script Settings screen, click the [Add] button and add fsacods as shownn below. In the example below, Virtual map address (VMA) iss set to 0x0C1000, the [LMA VMA] checkbox is selected, and the t Load map addresss (LMA) is set to fsacons section. Change these settings, if needed. Select.text as File Attributes. Note that there is no need to add objects to Allocated files field especially. 6 Seiko Epson Corporation FSA Library Object Link Manual
4.. Link Procedures Adding.fsawork Section Since the variable.fsawork does not have initiall value, there is nothing wrong when the variable is directly laid out on RAM. Therefore, add it as follows. In the example below, Virtual map address is set to 0x0C2000. Change this setting, if needed. Note that theree is no need too add objects to Allocatedd files field especially. FSA Library Object Link Manual Seiko Epson Corporation 7
4. Link Procedures When the.fsacons,.fsacode, and.fsawork sections are added as mentioned above,, the Linker Script Settings screen becomes as follows. Tip Since FSA-RAM for MCU equipped with FSA is composed of multiple RAM banks, place each section in different RAM bank, by all possible means. It can reduce the memory access conflict andd improve performance to place each section in different RAM bank. Especially, it is recommended to allocate the.fsacode section where the FSA program is placed to independent RAM bank. 8 Seiko Epson Corporation FSA Library Object Link Manual
4. Link Procedures Step-5 Adding Boot Process The FSA programs and constant arrays will be copied from LMA to VMA at system boot time. In general, add the lines below to the boot process. extern unsigned long START_fsacode; extern unsigned long START_fsacode_lma; extern unsigned long END_fsacode; extern unsigned long START_fsacons; extern unsigned long START_fsacons_lma; extern unsigned long END_fsacons; memcpy(& START_fsacode, & START_fsacode_lma, & END_fsacode - & START_fsacode); memcpy(& START_fsacons, & START_fsacons_lma, & END_fsacons - & START_fsacons); Step-6 Building Project When the settings above are finished, build the target project. After the building, check whether there is anything wrong with the link based on the mapped file, etc. FSA Library Object Link Manual Seiko Epson Corporation 9
5. Confirming FSA Stack Memory Area 5. Confirming FSA Stack Memory Area FSA uses the uppermost accessible memory area as temporary working space. This area is called an FSA stack memory and its size to use is defined for each FSA library. In particular, the largest size of area must be ensured of all FSA stack memories to be used by the FSA library functions implemented. It is impossible to place the section data, such as.fsacons,.fsacode, and.fsawork, in this FSA stack memory. The FSA stack memory size is described in the requirement memory section of each library specifications. Upper address The area below the upper bound address is used as a stack. Memory area accessible by FSA (FSA-RAM) Lower address Figure 5.1 FSA Stack Memory 10 Seiko Epson Corporation FSA Library Object Link Manual
Revision History Revision History Rev. No. Date Page Category Contents Rev 1.0 2015/01/09 All new Attachment-1 FSA Library Object Link Manual Seiko Epson Corporation 11
International Sales Operations AMERICA EPSON ELECTRONICS AMERICA, INC. 214 Devcon Drive, San Jose, CA 95112, USA Phone: +1-800-228-3964 FAX: +1-408-922-0238 EUROPE EPSON EUROPE ELECTRONICS GmbH Riesstrasse 15, 80992 Munich, GERMANY Phone: +49-89-14005-0 FAX: +49-89-14005-110 ASIA EPSON (CHINA) CO., LTD. 7F, Jinbao Bldg., No.89 Jinbao St., Dongcheng District, Beijing 100005, CHINA Phone: +86-10-8522-1199 FAX: +86-10-8522-1125 SHANGHAI BRANCH 7F, Block B, Hi-Techh Bldg., 900 Yishan Road, Shanghai 200233, CHINA C Phone: +86-21-5423-5577 FAX: +86-21-5423-4677 SHENZHEN BRANCH 12F, Dawning Mansion, Keji South 12th Road, Hi-Tech Park, Shenzhen 518057, CHINA Phone: +86-755-2699-3828 FAX: +86-755-2699-3838 EPSON HONG KONG K LTD. Unit 715-723, 7/F Trade Square, 681 Cheung Sha Wann Road, Kowloon, Hong Kong. Phone: +852-2585-4600 FAX: +852-2827-4346 EPSON TAIWAN TECHNOLOGYY & TRADING LTD. 14F, No. 7, Song Ren Road, Taipei 110, TAIWAN Phone: +886-2-8786-6688 FAX: +886-2-8786-6660 EPSON SINGAPORE PTE., LTD. 1 HarbourFront Place, #03-02 HarbourFront Tower One, Singapore 098633 Phone: +65-6586-5500 FAX: +65-6271-3182 SEIKO EPSON CORP. C KOREA OFFICE 5F, KLI 63 Bldg., 60 Yoido-dong, Youngdeungpo-Ku, Seoul 150-763, KOREA Phone: +82-2-784-6027 FAX: +82-2-767-3677 SEIKO EPSON CORP. C MICRODEVICESS OPERATIONSS DIVISION Device Sales & Marketing M Department 421-8, Hino, Hino-shi, Tokyo 191-8501, JAPAN Phone: +81-42-587-5814 FAX: +81-42-587-5117 Document Code: 412863500 First Issue January 20152 in JAPAN