How do I setup Custom MFG Tokens?
The first thing to do when setting you custom manufacturing tokens depends on whether or not you want to use a custom token header file. It does not matter if you choose to use a custom header file, or if you modify the generated token header file as it will be the only one used in the project. However, if you do decide to use your own custom header file you must define APPLICATION_MFG_TOKEN_HEADER to be your custom header file in your IAR preprocessor. When creating a custom token header file, token.h has helpful instructions. It is also important not to use inclusion guards (#ifndef/#define) in your application header files as the token reference scheme will not work with them. (If you are adding the define to App Builder, make sure to select the -D option).
Please note that if you do decide to modify the generated file you will need to be very careful not to overwrite it once modified. The main concern of it being overwritten is when you regenerate your project. At that point it will, by default, have the tokens file selected as being overwritten. Make sure to deselect it any time if you have made edits to the file that you want to keep.
General token definition found in token.h:
* The most general format of a token definition is: * * @code * #define CREATOR_name 16bit_value * #define NVM3KEY_name 20bit_value * #ifdef DEFINETYPES * typedef data_type type * #endif * #ifdef DEFINETOKENS * DEFINE_*_TOKEN(name, type, ... ,defaults) * #endif * @endcode