From 9f95ff5b6ba01db09552b84a0ab79607060a2666 Mon Sep 17 00:00:00 2001 From: Ali Labbene Date: Wed, 11 Dec 2019 08:59:21 +0100 Subject: Official ARM version: v5.4.0 Add CMSIS V5.4.0, please refer to index.html available under \docs folder. Note: content of \CMSIS\Core\Include has been copied under \Include to keep the same structure used in existing projects, and thus avoid projects mass update Note: the following components have been removed from ARM original delivery (as not used in ST packages) - CMSIS_EW2018.pdf - .gitattributes - .gitignore - \Device - \CMSIS - \CoreValidation - \DAP - \Documentation - \DoxyGen - \Driver - \Pack - \RTOS\CMSIS_RTOS_Tutorial.pdf - \RTOS\RTX - \RTOS\Template - \RTOS2\RTX - \Utilities - All ARM/GCC projects files are deleted from \DSP, \RTOS and \RTOS2 Change-Id: Ia026c3f0f0d016627a4fb5a9032852c33d24b4d3 --- docs/Pack/html/flashAlgorithm.html | 195 +++++++++++++++++++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 docs/Pack/html/flashAlgorithm.html (limited to 'docs/Pack/html/flashAlgorithm.html') diff --git a/docs/Pack/html/flashAlgorithm.html b/docs/Pack/html/flashAlgorithm.html new file mode 100644 index 0000000..a76a8f8 --- /dev/null +++ b/docs/Pack/html/flashAlgorithm.html @@ -0,0 +1,195 @@ + + + + + +Flash Programming +CMSIS-Pack: Flash Programming + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-Pack +  Version 1.5.0 +
+
Delivery Mechanism for Software Packs
+
+
+ +
+
    + +
+
+ + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+
+
Flash Programming
+
+
+

Flash Programming Algorithms are a piece of software to erase or download applications to Flash devices. A Pack with Device Support usually contains predefined Flash algorithms for programming the devices that are supported by the DFP. A template for creating new algorithms are available in the ARM:CMSIS Pack. The following section describes the process in more detail.

+

+Creating a new Algorithm

+

Flash programming algorithms are defined with functions to erase and program the Flash device. Special compiler and linker settings are required. Follow these steps to create and configure a new Flash programming algorithm:

+
    +
  1. Copy the content from the ARM:CMSIS Pack folder (usually C:\Keil\ARM\Pack\ARM\CMSIS\version\Device\_Template_Flash) to a new folder.
  2. +
  3. Rename the project file NewDevice.uvprojx to represent the new Flash ROM device name, for example MyDevice.uvprojx.
  4. +
  5. Open the project with uVision. From the toolbar, use the drop-down Select Target to define the processor architecture. Cortex-M fits for all Cortex-M0/M0+, M3, and M4 devices. The configuration assumes a little-endian microcontroller. In case of a big-endian microcontroller, select the correct processor core with Project - Options for Target - Device.
  6. +
  7. Open the dialog Project - Options for Target - Output and change the content of the field Name of Executable to represent the device, for example MyDevice.
  8. +
  9. Adapt the programming algorithms in the file FlashPrg.
  10. +
  11. Adapt the device parameters in the file FlashDev.
  12. +
  13. Use Project - Build Target to generate the new Flash programming algorithm. The output file (for example MyDevice.FLM) has to be added to the DFP.
  14. +
+
Note
    +
  • Creating a Flash programming algorithm with MDK-Lite is not supported.
  • +
  • Flash programming algorithms use Read-Only Position Independent and Read-Write Position Independent program code. These options are set in the dialogs Project - Options for Target - C/C++ and Project - Options for Target - Asm.
  • +
  • The dialog Project - Options for Target - Linker defines the linker scatter file Target.lin. The error L6305 is disabled with –diag_suppress L6305.
  • +
  • The Flash Algorithm Functions section contains reference for all the available functions.
  • +
+
+

+

FlashPrg.c

+

The file FlashPrg.c contains the mandatory Flash programming functions Init, UnInit, EraseSector, and ProgramPage. Optionally, depending on the device features (or to speed-up execution), the functions EraseChip, BlankCheck, and Verify can be implemented.

+

+

FlashDev.c

+

The file FlashDev.c contains parameter definitions for:

+
    +
  1. the Flash programming functions.
  2. +
  3. the FlashDevice structure:
    struct FlashDevice const FlashDevice = {
    +
    FLASH_DRV_VERS, // Driver Version, do not modify!
    +
    "New Device 256kB Flash", // Device Name
    +
    ONCHIP, // Device Type
    +
    0x00000000, // Device Start Address
    +
    0x00040000, // Device Size in Bytes (256kB)
    +
    1024, // Programming Page Size
    +
    0, // Reserved, must be 0
    +
    0xFF, // Initial Content of Erased Memory
    +
    100, // Program Page Timeout 100 mSec
    +
    3000, // Erase Sector Timeout 3000 mSec
    +
    +
    // Specify Size and Address of Sectors
    +
    0x002000, 0x000000, // Sector Size 8kB (8 Sectors)
    +
    0x010000, 0x010000, // Sector Size 64kB (2 Sectors)
    +
    0x002000, 0x030000, // Sector Size 8kB (8 Sectors)
    +
    SECTOR_END
    +
    };
    +
  4. +
+
Note
The Device Name will usually be shown in tools to identify the Flash algorithm. Make sure that this is changed to the correct device name from the DFP.
+

+Adding an Algorithm to a Pack

+

The generated *.FLM file needs to be added to the Pack with Device Support, so that it is available to the tool user for programming his device. Usually, a directory Flash is created and the algorithm is saved in this directory.

+

The algorithm is specified within the the /package/devices/family level:

+
<family Dfamily="STM32F4" Dvendor="STMicroelectronics:13">
+
...
+
<algorithm name="Flash/STM32F2xx_512.flm" start=0x08000000 size=0x10000 default="1"/> <!-- valid for all devices of the family -->
+
+
<subFamily DsubFamily="STM32F405">
+
<algorithm name="Flash/STM32F2xx_1024.flm" start=0x08000000 size=0x20000 default="1"/> <!-- valid for all devices of a subFamily -->
+
+
<device Dname="STM32F405OE">
+
<algorithm name="Flash/STM32F2xx_2048.flm" start=0x08000000 size=0x40000 default="1"/> <!-- finally, this is the default for the device -->
+
</device>
+
...
+
</family>
+

The argument start specifies the base address for the Flash programming algorithm.

+

The argument size specifies the size covered by the Flash programming algorithm. End address = start + size - 1.

+

The argument default specifies whether a Flash programming algorithm is set as the default algorithm in a project (when true). If default is not set or false, the Flash programming algorithm can be configured on a lower level. However, the Flash programming algorithm of a project can be changed manually at any time during development.

+
+
+ + + + -- cgit