Aiming at implementing loading custom code automatically when the TMS320C6416 DSP runs offline in the Photoelectrical and real-time Tracking system，this paper adopts the way of ROM Bootloader. But in default mode，it can only copy 1KB data. It is necessary to write the secondary bootloader programmes so that the rest custom code in external ROM/FLASH could be copied into the high speed of DSP. In this paper the detailed secondary bootloader programmes are written detailedly in the Non-BIOS and the BIOS system. The experiments show the method described in this paper achieved complete success. The Bootloader based on TMS320C6416 is well realized and thus the design requirement on the real-time and reliable ability of the Photoelectrical and real-time Tracking System can be satisfied.