To add your own code:
- In the CPU component properties, click the Build options tab.
- Select User code before PE initialization from the User initialization group.
Figure 1. User Code before PE initialization
- Click (...) button from the Value column.
The String list editor dialog box appears.
- In the String list editor dialog box, specify the code you want to be inserted as part of the system startup.
- Click OK.
- To add the user defined header file, select User data declarations from the User Initialization group.
Figure 2. User data declarations
- Click (...) button from the Value column.
The String list editor dialog box appears.
- In the String list editor dialog box, specify the header file to be inserted as part of the system startup.
- Click OK.
The code snippets get added to the __init_hardware() function which is called from the bootloader startup code:
Figure 3. Custom Startup Code with Bootloader Code Inserted