Keil Logo

User Flash Algorithms

New Flash programming algorithms can be created with µVision. 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. Create a new and empty sub-folder in \KEIL\ARM\FLASH\.
  2. Copy the content of an existing Flash algorithm to this new folder, for example copy \KEIL\ARM\FLASH\LPC_IAP_256.
  3. Rename the files LPC_IAP_256.uv2 and LPC_IAP_256.opt to 29F400.uv2 and 29F400.opt, to represent the new Flash ROM device name.
  4. Open the project with µVision and replace the target name using Project — Manage — Project Items.
  5. Select the device using Project — Options for Target — Device. Ensure to use the correct endianness.
    • Device ARM - Cortex-Mx will fit for Cortex-Mx processor-based devices.
  6. Adjust the names in the field Run #1 of the Project — Options for Target — User dialog.
    • Cortex-M processor-based devices use the suffix FLM
  7. Enable Read-Only Position Independent and Read-Write Position Independent in both dialogs Project — Options for Target — C/C++ and Project — Options for Target — Asm.
  8. Open Project — Options for Target — Linker and enter .\Target.lin in the Scatter File field.
  9. In Misc controls use
    • --diag_suppress L6305 for Cortex-M processor-based devices.
  10. Edit the FlashDev.c file and define the device parameters within the FlashDevice structure.
  11. Build the new Flash programming algorithm. The output file, which has the extension *.FLX or *.FLM, contains the programming algorithm. The file is copied to the appropriate folder automatically.

Note

  • This feature is not supported by the MDK-Lite (evaluation) Edition. Refer to Limitations for additional information.
  • Use the Add button in the Flash Download Setup dialog to add this programming algorithm to a µVision project.
  • The \KEIL\ARM\FLASH\LPC_IAP_256\TEST folder contains a project that shows how to test a new Flash Programming Algorithm.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.