8.4.1 Data-init Option

The --data-init option creates a special output section named .dinit as a template for the run-time initialization of data. The C start-up module in libpic32.a interprets this template and copies initial data values into initialized data sections. Other data sections (such as .bss) are cleared before the main() function is called. Note that the persistent data section (.pbss) is not affected by this option. This is the default action if no option is specified.

The --no-data-init form of this option selects an implementation of the C start-up module in libpic32.a that contains weak definitions for the data initialization routines. You should override these in your code as required to prevent an error at runtime. For PIC32M targets, override the routine __pic32_data_init, for PIC32C/SAM devices, override the routine __pic32c_data_initialization. Alternatively, remove the call to the data-init function from the device startup code.