Keil Logo Arm Logo

Configuration Wizard

The Configuration Wizard is a utility integrated in the editor for generating GUI-like configuration controls in assembler, C/C++, or initialization files. Configuration Wizard Annotations generate the controls.

This picture is the result of the example source code further down.

Configuration Wizard Example

Where

Option Are the device properties, which can be represented in a tree structure. Each item can have an explanatory tool-tip.
Value Sets the option value. Can contain controls to encapsulate data in predefined drop-down lists.

Click the tab Configuration Wizard and set device options via graphical controls. Click the tab Text Editor to view or change the source code.

Example

The example code below generates the Configuration Wizard represented above and could be part of an initialization file:

//*** <<< Use Configuration Wizard in Context Menu >>> ***


FUNC void Setup (void) {

// <h> External Bus Interface (EBI)

//   <e1.13> Enable Chip Select 0 (CSR0)
//     <o1.20..31> BA: Base Address <0x0-0xFFF00000:0x100000><#/0x100000>
//                 <i> Start Address for Chip Select Signal
//     <o1.7..8>   PAGES: Page Size      <0=> 1M Byte    <1=> 4M Bytes
//                                       <2=> 16M Bytes  <3=> 64M Bytes
//                 <i> Selects Active Bits in Base Address
//     <o1.0..1>   DBW: Data Bus Width   <1=> 16-bit     <2=> 8-bit
//     <o1.12>     BAT: Byte Access Type <0=> Byte-write
//                                       <1=> Byte-select
//     <e1.5>      WSE: Enable Wait State Generation
//       <o1.2..4>   NWS: Number of Standard Wait States <1-8><#-1>
//     </e>
//     <o1.9..11>  TDF: Data Float Output Time <0-7>
//                 <i> Number of Cycles Added after the Transfer
//   </e>
  _WDWORD(0xFFE00000, 0x010024A9);   // EBI_CSR0: Flash

//   <e1.13> Enable Chip Select 1 (CSR1)
//     <o1.20..31> BA: Base Address <0x0-0xFFF00000:0x100000><#/0x100000>
//                 <i> Start Address for Chip Select Signal
//     <o1.7..8>   PAGES: Page Size      <0=> 1M Byte    <1=> 4M Bytes
//                                       <2=> 16M Bytes  <3=> 64M Bytes
//                 <i> Selects Active Bits in Base Address
//     <o1.0..1>   DBW: Data Bus Width   <1=> 16-bit     <2=> 8-bit
//     <o1.12>     BAT: Byte Access Type <0=> Byte-write
//                                       <1=> Byte-select
//     <e1.5>      WSE: Enable Wait State Generation
//       <o1.2..4>   NWS: Number of Standard Wait States <1-8><#-1>
//     </e>
//     <o1.9..11>  TDF: Data Float Output Time <0-7>
//                 <i> Number of Cycles Added after the Transfer
//   </e>
  _WDWORD(0xFFE00004, 0x040034A5);   // EBI_CSR1: RAM

//   <q1.4>        DRP: Data Read Protocol
//                      <0=> Standard Read
//                      <1=> Early Read
  _WDWORD(0xFFE00024, 0x00000010);   // EBI_MCR:  Data Read Protocol

  _WDWORD(0xFFE00020, 0x00000001);   // EBI_RCR:  Remap Command

// </h>

// <o> Program Entry Point
  PC = 0x04000000;

}

// <s> Change ID
// <s1.30> Change Password String
#define ID  "My User ID"
char pw[] = "My Password";


/*********************************************************/
/*  Example for enabling and disabling code              */

// <c1> Use MY_CPU_VARIANT
// <i> Use MY_CPU_VARIANT, and set the include file
#define MY_CPU_VARIANT
#include "MyCpuVariant.h"
// </c>

// <!c1> Disable log
// <i> Disable log file generation
#define _USE_LOG
// </c>

// <c1>  Example of inconsistent comment
// <i> a mix of commented and uncommented lines in the block create an inconsistency

// This type of comment, mixed with uncommented lines, creates the inconsistency
/* You can use this type of comment without creating an inconsistency */

   do_whatever;              // adding this type of comment here is allowed

// </c>


//*** <<< end of configuration section >>>    ***

Configuration Wizard Annotations

Configuration Wizard annotations are items and modifiers which create the GUI-like elements. The following rules apply:

  • Annotations are written as comments in the code.
  • The Configuration Wizard section must begin within the first 100 lines of code and must start with:
    // <<< Use Configuration Wizard in Context Menu >>>
    
    Optionally, the section can explicitly end with:
    // <<< end of configuration section >>>
    
  • The next value that follows the annotation is modified. However, items marked with § can have a skip-value to jump a number of values (or lines in <c> and <!c> items). The example skips the first and modifies the second number that follows the comment.
    // <o1>
    
  • White space characters are ignored in items or modifiers.
  • Avoid using < or > within Configuration Wizard lines other than for enclosing annotation items.

The table lists the Configuration Wizard annotations:

Item Text Description
<c>§ yes Code enable: creates a checkbox to uncomment or comment code. All lines, including those with white spaces, get commented with double slashes (//) at the first found character when you disable the checkbox. Red text in the Configuration Wizard indicates an inconsistency. Do not nest this item.
<!c>§ yes Code disable: creates a checkbox to comment or uncomment code. All lines, including those with white spaces, get commented with double slashes (//) at the first found character when you enable the checkbox. Red text in the Configuration Wizard indicates an inconsistency. Do not nest this item.
</c> no End of code enable/disable block started with <c> or <!c>.
<h> yes Heading: the following options belong to a group.
<e>§ yes Heading with Enable: the following options belong to a group, which can be enabled via a checkbox.
<e.4>§ yes Heading with Enable: modifies a specific bit (bit 4, in this example).
</h> or </e> no Heading or Enable end.
<i> yes Tool-tip help for previous item.
<q>§ yes Option for bit values which can be set via a checkbox.
<o>§ yes Option with selection or number entry.
<o.4..5>§ yes Modify a range of bits (example: bit 4 to 5).
<o.4>§ yes Modify a single bit (example: bit 4).
<s>§ yes Option with ASCII string entry.
<s.10>§ yes Option with ASCII string entry and a size limit of 10 characters.
Modifier Text Description
<0-31> no Value range for option fields.
<0-100:10> no Value range for option fields with step 10.
<0x40-0x1000:0x10> no Value range in hex format and step 10.
<0=> yes Value and text for selection.
<#+1>   <#-1>
<#*8>   <#/3>
no Value modification (add, sub, mul, div) before number is merged into field.

Keil logo

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.