⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 Fujitsu 16bit mcu downlaod flash in application.
💻 TXT
字号:
==========================================================================
                            FlashWrite Project                             
==========================================================================
                   FUJITSU MICROELECTRONIC EUROPE GMBH                       
                   Am Siebenstein 6-10, 63303 Dreieich                    
                    Tel.: ++49 (6103) 690-0, Fax -122                     
                                                            
 The following  software  is for  demonstration  purposes only.  It is not
 fully  tested, nor validated  in order  to fullfill  its task  under  all
 circumstances.  Therefore,  this software or  any part of it must only be
 used in an evaluation laboratory environment.                                    
 This software is subject to the rules of our standard DISCLAIMER, that is
 delivered with our  SW-tools on the CD  "Micros Documentation & Software"
 (V3.1 or highersee "\START.HTM") or see our Internet Page:
 http://www.fujitsu-fme.com/products/micro/disclaimer.html  
==========================================================================
               
History
Date      Ver   Author  Softune     Description
17.09.99  1.00   tka    V30L22      original version
04.05.00  1.01   tka    V30L24      declaration in flash.c changed to volatile 
                                    otherwise optimizer will remove it if speed
                                    optimisation is selected.
22.03.01  1.02   mst    V30L24R02	ReadReset function added, modified for
									MB90545 series
==========================================================================

This sample project demonstrates the flash programming. The routines itself 
are executed in RAM.
The code is permanently located in RAM during run-time.


To get I. Permanent RAMCODE working two mechanisms have to be used.

1. The linker has to link the program this way that addresses are resolved
   for RAM and the belonging code data are stored in ROM.
2. The start-up file has to copy the code from ROM to RAM
3. Placing code in RAMCODE sections
4. Jumping to RAM
   
1. Linking code for RAM and ROM
-------------------------------
The linker of the Softune Workbench provide a dedicated mechanism.
The linker is informed of a code section to be located in RAM:
     -sc RAMCODE/Code/BYTE=RAM (done by linker set section option)
     
By setting an "@" section with same name the linker will recognise the 
wish to store the initialisation data in ROM:
     -sc @RAMCODE/Code/BYTE=0xFF0000 (done by linker set section option)

With the current linker version the "@"-section has to be fixed to an
address. One cannot just select ROM.

The appropriate settings in the Workbench can be checked in this project.
See Project->SetupToolOption->Linker->Disposition->SetSection

In order to be able to handle these sections the linker provides generic
labels for the start addresses of the sections in RAM and ROM.
     _RAM_ + name
     _ROM_ + name

In this example the section is named "RAMCODE". Therefore, the following
lables are generated:
     _RAM_RAMCODE
     _ROM_RAMCODE
     
These labels have to be imported by the modules, which copy the files.


2. Copying code from ROM to RAM
-------------------------------
The start-up file has to copy the code from ROM to RAM.
The FMG-start-up file version 2.0 and higher provides an option, which
has to be enabled:
     #set      COPY_RAMCODE      ON      ; <<< enable RAMCODE section to
                                         ; be copied from ROM to RAM

This way the start-up file will add a descriptor of of the sections in
ROM and RAM and their size to the DTRANS section.
DTRANS is always processed during excuting the start-up file and the
code is copied from ROM to RAM.

Start-up file V2.0 is prepared to copy a section with name "RAMCODE".


3. Placing code in RAMCODE
--------------------------
This can be done in Assembly language modules via the statement:
     .SECTION RAMCODE, CODE
     
In C-language the following statement should be used:
     #pragma section FAR_CODE=RAMCODE
     #pragma section CODE=RAMCODE

These two lines force to locate all C-code of its module to RAMCODE.
First line is refering to __far declared functions. Second line is refering
to __near declared functions.

A separate module (file with extension 'C') should be used for RAMCODE
functions only.

4. Jumping to RAM
-----------------
It is mandatory that the RAMCODE functions are called via instructions,
which are able to change the code bank. Therefore, declare at least the 
RAMCODE entrance function as __far.

Functions, which are called by other RAMCODE-functions only, can be 
declared as __far or __near.


In this example the RAMCODE is called by
     Flash();
     
The functions
     Sector_Erase();
     Flash_Write();
are part of Flash() and are executed within RAM.


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -