1. 程式人生 > >KEIL下自定義程式設計flash演算法

KEIL下自定義程式設計flash演算法

對keil裡沒有的FLASH,還可以自定義程式設計演算法。方法也放到這裡吧
Define FLASH Algorithms
The ΜVision environment allows you to define additional FLASH PROGRAMMING algorithms. For example an algorithm for an off-chip FLASH ROM that is connected via the BUS of the XC16x DEVICE.

Define a New FLASH PROGRAMMING Algorithm
You should perform the following steps to configure a new
FLASH
PROGRAMMING Algorithm:

Create a new empty sub-folder in ..\ARM\FLASH.
Copy the content of an existing FLASH algorithm (for example ..\ARM\FLASH\LPC_IAP_256) to this new folder as a template for new DEVICE algorithms.
ReNAME the project file LPC_IAP_256.UV2 to represent the new FLASH ROM DEVICE
NAME, for example: 29F400.UV2 and open this new project with the ΜVision IDE.
In the DIALOG Project - Options for Target - OUTPUT replace all OUTPUT NAMEs (i.e. LPC_IAP_256) to the new DEVICE NAME.
Edit the file FLASHPrg.C and define the function code for EraseChip, EraseBlock and ProgramBlock. The Init and UnInit function allows you to write initializations and de-initialization code required for the algorithm.
Define the
DEVICE
parameters in the struct FLASHDevice in the file FLASHDev.C.
Build the new FLASH PROGRAMMING algorithm. The OUTPUT file with the extension *.FLX contains the new PROGRAMMING algorithm. Use the Add button in the Configure FLASH Download DIALOG to add this PROGRAMMING algorithm file to the ΜVision project of the target application.
TEST a New FLASH PROGRAMMING Algorithm
The folder ..\ARM\FLASH\LPC_IAP_256\TEST contains a project that allows you to TEST a new FLASH PROGRAMMING Algorithm.

Note

At this point in time, the generation of new FLASH PROGRAMMING algorithms requires the ARM ADS development tools. It is not possible to generate own FLASH PROGRAMMING algorithms with the GNU toolchain. However, you may use the existing FLASH PROGRAMMING algorithms.